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

USB: class: cdc-acm: 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>

+10 -8
+10 -8
drivers/usb/class/cdc-acm.c
··· 257 257 struct usb_cdc_notification *dr = urb->transfer_buffer; 258 258 unsigned char *data; 259 259 int newctrl; 260 - int status; 260 + int retval; 261 + int status = urb->status; 261 262 262 - switch (urb->status) { 263 + switch (status) { 263 264 case 0: 264 265 /* success */ 265 266 break; ··· 268 267 case -ENOENT: 269 268 case -ESHUTDOWN: 270 269 /* this urb is terminated, clean up */ 271 - dbg("%s - urb shutting down with status: %d", __FUNCTION__, urb->status); 270 + dbg("%s - urb shutting down with status: %d", __FUNCTION__, status); 272 271 return; 273 272 default: 274 - dbg("%s - nonzero urb status received: %d", __FUNCTION__, urb->status); 273 + dbg("%s - nonzero urb status received: %d", __FUNCTION__, status); 275 274 goto exit; 276 275 } 277 276 ··· 312 311 break; 313 312 } 314 313 exit: 315 - status = usb_submit_urb (urb, GFP_ATOMIC); 316 - if (status) 314 + retval = usb_submit_urb (urb, GFP_ATOMIC); 315 + if (retval) 317 316 err ("%s - usb_submit_urb failed with result %d", 318 - __FUNCTION__, status); 317 + __FUNCTION__, retval); 319 318 } 320 319 321 320 /* data interface returns incoming bytes, or we got unthrottled */ ··· 325 324 struct acm_ru *rcv = urb->context; 326 325 struct acm *acm = rcv->instance; 327 326 int status = urb->status; 328 - dbg("Entering acm_read_bulk with status %d", urb->status); 327 + 328 + dbg("Entering acm_read_bulk with status %d", status); 329 329 330 330 if (!ACM_READY(acm)) 331 331 return;