mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-13 17:28:56 +00:00
[PATCH] s390: improve response code handling in chsc_enable_facility()
Rather than checking for some known failures, check positively for the success response code 0x0001 and return -EIO for unrecognized failure response codes. Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Cc: Greg Smith <gsmith@nc.rr.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
de1d9c033f
commit
15730ddbf7
@ -1115,6 +1115,9 @@ chsc_enable_facility(int operation_code)
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
switch (sda_area->response.code) {
|
switch (sda_area->response.code) {
|
||||||
|
case 0x0001: /* everything ok */
|
||||||
|
ret = 0;
|
||||||
|
break;
|
||||||
case 0x0003: /* invalid request block */
|
case 0x0003: /* invalid request block */
|
||||||
case 0x0007:
|
case 0x0007:
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
@ -1123,6 +1126,8 @@ chsc_enable_facility(int operation_code)
|
|||||||
case 0x0101: /* facility not provided */
|
case 0x0101: /* facility not provided */
|
||||||
ret = -EOPNOTSUPP;
|
ret = -EOPNOTSUPP;
|
||||||
break;
|
break;
|
||||||
|
default: /* something went wrong */
|
||||||
|
ret = -EIO;
|
||||||
}
|
}
|
||||||
out:
|
out:
|
||||||
free_page((unsigned long)sda_area);
|
free_page((unsigned long)sda_area);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user