From patchwork Wed Sep 16 10:03:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver Neukum X-Patchwork-Id: 258534 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5501BC43461 for ; Wed, 16 Sep 2020 10:03:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 29CFE2076B for ; Wed, 16 Sep 2020 10:03:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726473AbgIPKDV (ORCPT ); Wed, 16 Sep 2020 06:03:21 -0400 Received: from mx2.suse.de ([195.135.220.15]:58608 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726536AbgIPKDQ (ORCPT ); Wed, 16 Sep 2020 06:03:16 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id D61F3AED9; Wed, 16 Sep 2020 10:03:29 +0000 (UTC) From: Oliver Neukum To: gregKH@linuxfoundation.org, linux-usb@vger.kernel.org Cc: Oliver Neukum Subject: [PATCH] microtek: use set_host_byte() Date: Wed, 16 Sep 2020 12:03:02 +0200 Message-Id: <20200916100302.30855-1-oneukum@suse.com> X-Mailer: git-send-email 2.16.4 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The SCSI layer is providing a new macro. Let's use it. Signed-off-by: Oliver Neukum --- drivers/usb/image/microtek.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/usb/image/microtek.c b/drivers/usb/image/microtek.c index 360416680e82..59b02a539963 100644 --- a/drivers/usb/image/microtek.c +++ b/drivers/usb/image/microtek.c @@ -389,7 +389,7 @@ void mts_int_submit_urb (struct urb* transfer, res = usb_submit_urb( transfer, GFP_ATOMIC ); if ( unlikely(res) ) { MTS_INT_ERROR( "could not submit URB! Error was %d\n",(int)res ); - context->srb->result = DID_ERROR << 16; + set_host_byte(context->srb, DID_ERROR); mts_transfer_cleanup(transfer); } } @@ -438,7 +438,7 @@ static void mts_data_done( struct urb* transfer ) scsi_set_resid(context->srb, context->data_length - transfer->actual_length); } else if ( unlikely(status) ) { - context->srb->result = (status == -ENOENT ? DID_ABORT : DID_ERROR)<<16; + set_host_byte(context->srb, (status == -ENOENT ? DID_ABORT : DID_ERROR)); } mts_get_status(transfer); @@ -455,12 +455,12 @@ static void mts_command_done( struct urb *transfer ) if (status == -ENOENT) { /* We are being killed */ MTS_DEBUG_GOT_HERE(); - context->srb->result = DID_ABORT<<16; + set_host_byte(context->srb, DID_ABORT); } else { /* A genuine error has occurred */ MTS_DEBUG_GOT_HERE(); - context->srb->result = DID_ERROR<<16; + set_host_byte(context->srb, DID_ERROR); } mts_transfer_cleanup(transfer); @@ -495,7 +495,7 @@ static void mts_do_sg (struct urb* transfer) scsi_sg_count(context->srb)); if (unlikely(status)) { - context->srb->result = (status == -ENOENT ? DID_ABORT : DID_ERROR)<<16; + set_host_byte(context->srb, (status == -ENOENT ? DID_ABORT : DID_ERROR)); mts_transfer_cleanup(transfer); } @@ -578,7 +578,7 @@ mts_scsi_queuecommand_lck(struct scsi_cmnd *srb, mts_scsi_cmnd_callback callback MTS_DEBUG("this device doesn't exist\n"); - srb->result = DID_BAD_TARGET << 16; + set_host_byte(srb, DID_BAD_TARGET); if(likely(callback != NULL)) callback(srb); @@ -605,7 +605,7 @@ mts_scsi_queuecommand_lck(struct scsi_cmnd *srb, mts_scsi_cmnd_callback callback if(unlikely(res)){ MTS_ERROR("error %d submitting URB\n",(int)res); - srb->result = DID_ERROR << 16; + set_host_byte(srb, DID_ERROR); if(likely(callback != NULL)) callback(srb);