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

USB: microtek: use set_host_byte()

The SCSI layer is providing a new macro. Let's use it.

Signed-off-by: Oliver Neukum <oneukum@suse.com>
Link: https://lore.kernel.org/r/20200916100302.30855-1-oneukum@suse.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Oliver Neukum and committed by
Greg Kroah-Hartman
be171e48 4f6d57e4

+7 -7
+7 -7
drivers/usb/image/microtek.c
··· 389 389 res = usb_submit_urb( transfer, GFP_ATOMIC ); 390 390 if ( unlikely(res) ) { 391 391 MTS_INT_ERROR( "could not submit URB! Error was %d\n",(int)res ); 392 - context->srb->result = DID_ERROR << 16; 392 + set_host_byte(context->srb, DID_ERROR); 393 393 mts_transfer_cleanup(transfer); 394 394 } 395 395 } ··· 438 438 scsi_set_resid(context->srb, context->data_length - 439 439 transfer->actual_length); 440 440 } else if ( unlikely(status) ) { 441 - context->srb->result = (status == -ENOENT ? DID_ABORT : DID_ERROR)<<16; 441 + set_host_byte(context->srb, (status == -ENOENT ? DID_ABORT : DID_ERROR)); 442 442 } 443 443 444 444 mts_get_status(transfer); ··· 455 455 if (status == -ENOENT) { 456 456 /* We are being killed */ 457 457 MTS_DEBUG_GOT_HERE(); 458 - context->srb->result = DID_ABORT<<16; 458 + set_host_byte(context->srb, DID_ABORT); 459 459 } else { 460 460 /* A genuine error has occurred */ 461 461 MTS_DEBUG_GOT_HERE(); 462 462 463 - context->srb->result = DID_ERROR<<16; 463 + set_host_byte(context->srb, DID_ERROR); 464 464 } 465 465 mts_transfer_cleanup(transfer); 466 466 ··· 495 495 scsi_sg_count(context->srb)); 496 496 497 497 if (unlikely(status)) { 498 - context->srb->result = (status == -ENOENT ? DID_ABORT : DID_ERROR)<<16; 498 + set_host_byte(context->srb, (status == -ENOENT ? DID_ABORT : DID_ERROR)); 499 499 mts_transfer_cleanup(transfer); 500 500 } 501 501 ··· 578 578 579 579 MTS_DEBUG("this device doesn't exist\n"); 580 580 581 - srb->result = DID_BAD_TARGET << 16; 581 + set_host_byte(srb, DID_BAD_TARGET); 582 582 583 583 if(likely(callback != NULL)) 584 584 callback(srb); ··· 605 605 606 606 if(unlikely(res)){ 607 607 MTS_ERROR("error %d submitting URB\n",(int)res); 608 - srb->result = DID_ERROR << 16; 608 + set_host_byte(srb, DID_ERROR); 609 609 610 610 if(likely(callback != NULL)) 611 611 callback(srb);