Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp492763imm; Thu, 5 Jul 2018 04:03:26 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcsXJhVgpjR6h3Fr1MVcf4hyDLeWPEb/lPFWF5Cg3chuKBOhqFzhK14tVD5x2tHSmkTDD9v X-Received: by 2002:a62:789:: with SMTP id 9-v6mr5950617pfh.213.1530788606213; Thu, 05 Jul 2018 04:03:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530788606; cv=none; d=google.com; s=arc-20160816; b=fp8XvWXFa/uyinjdHhgj6UC8JYV92YYe1YBYTvUkdxnf2C+6equxlRWleR8M4qm5hR 2Viyphz16rk88e7jmp77mvHuO+U+8sZ9yuJ99fAmgid6mrpBbbeyfz/yjXubGc0CeM40 U2Sfgl/yq2c1Vqd4+dpoejXwjAiIxyE8gIENsAJD1hWA1JsDYb9RUFXqxmRcwYaVp8ra IRJj+ro/Wu4m7f3I+wUNqzJlY0Wj6anLRePWE7eWjP/SRSmA1hw+qLgDpGzM74CJylG8 EE7jfprEXQhI3ObfpDNy1UsYNSJl1HcyPGKT+q/4VpoIkxCNpS2Ut30iu+RomEZfSnP9 X28A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=F1aA1ax12ZymA2H8f4pPw5LezJWkSMRyf4RYv1QXjNw=; b=pwFHr8LIIDauUr9SYHk3/9mo2nx1BwYUbU9Hxn30oJ1s9fw0meTlcoZYoH2pGvxtXY L4ejHj70lLxFTdKN84bLtV7s80cCaOZo+qFo3PYEc/2vp5FWQ4gN5nj2KhXsOA0rIKmo UbHrqZDS/lgUXkOfO7iEq2uA5ib3kaXqbsRJ7LYfetU5f1/jIV1Ict4Wn9j+aBLBW+us 0aTx3ru9/pe0cnjZ0H+nOMkbau8eXoiAT8ONIvee/Acd09ST+k8dkcSn2rbCbO/Z/8l+ kC9g8spNA71RCinWedotfDsK9iOuCud7Jlm7j5V2LIEJ/2bs59E88zxtiZcWdAgG9VWq 4hgQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x5-v6si5298726pgc.210.2018.07.05.04.03.09; Thu, 05 Jul 2018 04:03:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753797AbeGELBp (ORCPT + 99 others); Thu, 5 Jul 2018 07:01:45 -0400 Received: from mx2.suse.de ([195.135.220.15]:59886 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753598AbeGELBo (ORCPT ); Thu, 5 Jul 2018 07:01:44 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 14DD0AFA9; Thu, 5 Jul 2018 11:01:43 +0000 (UTC) From: Johannes Thumshirn To: "Martin K . Petersen" Cc: Linux Kernel Mailinglist , Linux SCSI Mailinglist , Johannes Thumshirn Subject: [PATCH 2/4] scsi: bfa: remove ScsiResult macro Date: Thu, 5 Jul 2018 13:01:38 +0200 Message-Id: <20180705110140.19545-3-jthumshirn@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20180705110140.19545-1-jthumshirn@suse.de> References: <20180705110140.19545-1-jthumshirn@suse.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove the ScsiResult macro and open code it on all call sites. This will make subsequent refactoring in this area easier. Signed-off-by: Johannes Thumshirn --- drivers/scsi/bfa/bfad_im.c | 19 ++++++++----------- drivers/scsi/bfa/bfad_im.h | 1 - 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/drivers/scsi/bfa/bfad_im.c b/drivers/scsi/bfa/bfad_im.c index c05d6e91e4bd..c4a33317d344 100644 --- a/drivers/scsi/bfa/bfad_im.c +++ b/drivers/scsi/bfa/bfad_im.c @@ -70,21 +70,18 @@ bfa_cb_ioim_done(void *drv, struct bfad_ioim_s *dio, host_status = DID_ERROR; } } - cmnd->result = ScsiResult(host_status, scsi_status); + cmnd->result = host_status << 16 | scsi_status; break; case BFI_IOIM_STS_TIMEDOUT: - host_status = DID_TIME_OUT; - cmnd->result = ScsiResult(host_status, 0); + cmnd->result = DID_TIME_OUT << 16; break; case BFI_IOIM_STS_PATHTOV: - host_status = DID_TRANSPORT_DISRUPTED; - cmnd->result = ScsiResult(host_status, 0); + cmnd->result = DID_TRANSPORT_DISRUPTED << 16; break; default: - host_status = DID_ERROR; - cmnd->result = ScsiResult(host_status, 0); + cmnd->result = DID_ERROR << 16; } /* Unmap DMA, if host is NULL, it means a scsi passthru cmd */ @@ -117,7 +114,7 @@ bfa_cb_ioim_good_comp(void *drv, struct bfad_ioim_s *dio) struct bfad_itnim_data_s *itnim_data; struct bfad_itnim_s *itnim; - cmnd->result = ScsiResult(DID_OK, SCSI_STATUS_GOOD); + cmnd->result = DID_OK << 16 | SCSI_STATUS_GOOD; /* Unmap DMA, if host is NULL, it means a scsi passthru cmd */ if (cmnd->device->host != NULL) @@ -144,7 +141,7 @@ bfa_cb_ioim_abort(void *drv, struct bfad_ioim_s *dio) struct scsi_cmnd *cmnd = (struct scsi_cmnd *)dio; struct bfad_s *bfad = drv; - cmnd->result = ScsiResult(DID_ERROR, 0); + cmnd->result = DID_ERROR << 16; /* Unmap DMA, if host is NULL, it means a scsi passthru cmd */ if (cmnd->device->host != NULL) @@ -1253,14 +1250,14 @@ bfad_im_queuecommand_lck(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd printk(KERN_WARNING "bfad%d, queuecommand %p %x failed, BFA stopped\n", bfad->inst_no, cmnd, cmnd->cmnd[0]); - cmnd->result = ScsiResult(DID_NO_CONNECT, 0); + cmnd->result = DID_NO_CONNECT << 16; goto out_fail_cmd; } itnim = itnim_data->itnim; if (!itnim) { - cmnd->result = ScsiResult(DID_IMM_RETRY, 0); + cmnd->result = DID_IMM_RETRY << 16; goto out_fail_cmd; } diff --git a/drivers/scsi/bfa/bfad_im.h b/drivers/scsi/bfa/bfad_im.h index af66275570c3..e61ed8dad0b4 100644 --- a/drivers/scsi/bfa/bfad_im.h +++ b/drivers/scsi/bfa/bfad_im.h @@ -44,7 +44,6 @@ u32 bfad_im_supported_speeds(struct bfa_s *bfa); #define MAX_FCP_LUN 16384 #define BFAD_TARGET_RESET_TMO 60 #define BFAD_LUN_RESET_TMO 60 -#define ScsiResult(host_code, scsi_code) (((host_code) << 16) | scsi_code) #define BFA_QUEUE_FULL_RAMP_UP_TIME 120 /* -- 2.16.4