Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

USB: misc: auerswald: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

+15 -10
+15 -10
drivers/usb/misc/auerswald.c
··· 862 862 pauerbuf_t bp = (pauerbuf_t) urb->context; 863 863 pauerswald_t cp; 864 864 int ret; 865 + int status = urb->status; 866 + 865 867 dbg ("auerswald_ctrlread_wretcomplete called"); 866 - dbg ("complete with status: %d", urb->status); 868 + dbg ("complete with status: %d", status); 867 869 cp = ((pauerswald_t)((char *)(bp->list)-(unsigned long)(&((pauerswald_t)0)->bufctl))); 868 870 869 871 /* check if it is possible to advance */ 870 - if (!auerswald_status_retry (urb->status) || !cp->usbdev) { 872 + if (!auerswald_status_retry(status) || !cp->usbdev) { 871 873 /* reuse the buffer */ 872 - err ("control dummy: transmission error %d, can not retry", urb->status); 874 + err ("control dummy: transmission error %d, can not retry", status); 873 875 auerbuf_releasebuf (bp); 874 876 /* Wake up all processes waiting for a buffer */ 875 877 wake_up (&cp->bufferwait); ··· 904 902 pauerswald_t cp; 905 903 pauerscon_t scp; 906 904 pauerbuf_t bp = (pauerbuf_t) urb->context; 905 + int status = urb->status; 907 906 int ret; 907 + 908 908 dbg ("auerswald_ctrlread_complete called"); 909 909 910 910 cp = ((pauerswald_t)((char *)(bp->list)-(unsigned long)(&((pauerswald_t)0)->bufctl))); 911 911 912 912 /* check if there is valid data in this urb */ 913 - if (urb->status) { 914 - dbg ("complete with non-zero status: %d", urb->status); 913 + if (status) { 914 + dbg ("complete with non-zero status: %d", status); 915 915 /* should we do a retry? */ 916 - if (!auerswald_status_retry (urb->status) 916 + if (!auerswald_status_retry(status) 917 917 || !cp->usbdev 918 918 || (cp->version < AUV_RETRY) 919 919 || (bp->retries >= AU_RETRIES)) { 920 920 /* reuse the buffer */ 921 - err ("control read: transmission error %d, can not retry", urb->status); 921 + err ("control read: transmission error %d, can not retry", status); 922 922 auerbuf_releasebuf (bp); 923 923 /* Wake up all processes waiting for a buffer */ 924 924 wake_up (&cp->bufferwait); ··· 978 974 unsigned int channelid; 979 975 unsigned int bytecount; 980 976 int ret; 977 + int status = urb->status; 981 978 pauerbuf_t bp = NULL; 982 979 pauerswald_t cp = (pauerswald_t) urb->context; 983 980 984 981 dbg ("%s called", __FUNCTION__); 985 982 986 - switch (urb->status) { 983 + switch (status) { 987 984 case 0: 988 985 /* success */ 989 986 break; ··· 992 987 case -ENOENT: 993 988 case -ESHUTDOWN: 994 989 /* this urb is terminated, clean up */ 995 - dbg("%s - urb shutting down with status: %d", __FUNCTION__, urb->status); 990 + dbg("%s - urb shutting down with status: %d", __FUNCTION__, status); 996 991 return; 997 992 default: 998 - dbg("%s - nonzero urb status received: %d", __FUNCTION__, urb->status); 993 + dbg("%s - nonzero urb status received: %d", __FUNCTION__, status); 999 994 goto exit; 1000 995 } 1001 996