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

USB: image: microtek: 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 -9
+10 -9
drivers/usb/image/microtek.c
··· 189 189 #define MTS_DEBUG_INT() \ 190 190 do { MTS_DEBUG_GOT_HERE(); \ 191 191 MTS_DEBUG("transfer = 0x%x context = 0x%x\n",(int)transfer,(int)context ); \ 192 - MTS_DEBUG("status = 0x%x data-length = 0x%x sent = 0x%x\n",(int)transfer->status,(int)context->data_length, (int)transfer->actual_length ); \ 192 + MTS_DEBUG("status = 0x%x data-length = 0x%x sent = 0x%x\n",transfer->status,(int)context->data_length, (int)transfer->actual_length ); \ 193 193 mts_debug_dump(context->instance);\ 194 194 } while(0) 195 195 #else ··· 393 393 context 394 394 ); 395 395 396 - transfer->status = 0; 397 - 398 396 res = usb_submit_urb( transfer, GFP_ATOMIC ); 399 397 if ( unlikely(res) ) { 400 398 MTS_INT_ERROR( "could not submit URB! Error was %d\n",(int)res ); ··· 442 444 static void mts_data_done( struct urb* transfer ) 443 445 /* Interrupt context! */ 444 446 { 447 + int status = transfer->status; 445 448 MTS_INT_INIT(); 446 449 447 450 if ( context->data_length != transfer->actual_length ) { 448 451 context->srb->resid = context->data_length - transfer->actual_length; 449 - } else if ( unlikely(transfer->status) ) { 450 - context->srb->result = (transfer->status == -ENOENT ? DID_ABORT : DID_ERROR)<<16; 452 + } else if ( unlikely(status) ) { 453 + context->srb->result = (status == -ENOENT ? DID_ABORT : DID_ERROR)<<16; 451 454 } 452 455 453 456 mts_get_status(transfer); ··· 460 461 static void mts_command_done( struct urb *transfer ) 461 462 /* Interrupt context! */ 462 463 { 464 + int status = transfer->status; 463 465 MTS_INT_INIT(); 464 466 465 - if ( unlikely(transfer->status) ) { 466 - if (transfer->status == -ENOENT) { 467 + if ( unlikely(status) ) { 468 + if (status == -ENOENT) { 467 469 /* We are being killed */ 468 470 MTS_DEBUG_GOT_HERE(); 469 471 context->srb->result = DID_ABORT<<16; ··· 502 502 static void mts_do_sg (struct urb* transfer) 503 503 { 504 504 struct scatterlist * sg; 505 + int status = transfer->status; 505 506 MTS_INT_INIT(); 506 507 507 508 MTS_DEBUG("Processing fragment %d of %d\n", context->fragment,context->srb->use_sg); 508 509 509 - if (unlikely(transfer->status)) { 510 - context->srb->result = (transfer->status == -ENOENT ? DID_ABORT : DID_ERROR)<<16; 510 + if (unlikely(status)) { 511 + context->srb->result = (status == -ENOENT ? DID_ABORT : DID_ERROR)<<16; 511 512 mts_transfer_cleanup(transfer); 512 513 } 513 514