Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp494705imm; Thu, 5 Jul 2018 04:05:15 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdn7sdKACaYgVy1kH6bCSbT4HyshvdAJ2d6YawJ+cz7sJr/hayZsJ1Zp9EWbqopRJyxS5I4 X-Received: by 2002:a17:902:3e3:: with SMTP id d90-v6mr5742288pld.12.1530788715068; Thu, 05 Jul 2018 04:05:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530788715; cv=none; d=google.com; s=arc-20160816; b=Mw/+8qZOxNMbRV2skkji2yZwZEObdyx3L6E8wpmwnROm4Kp/AvJz+59GFhYpwjEIan g87v5hprQhgAl1ubMxte8EKtcATA1nleWRDX2W/oKasrSvN65m8nJv6sIIQ1bTw9xRr0 yGfEul6fIGAHihel4Xhf5DgfTtIzJuMibPw9A39UVzN0D5gDgtvUdSd2e/O3i/nUGN7X v9eRuj5IecdHTrytB/PNqD1Um/AzD8EmZBhz449No4aGj44zWGCY/WYzxH7FRxp15i5h rjAvgRv2WHIgutHABPKCvsDaUjJpEZ5yUyEt+wXtoThfAqok8B5pTffm+1K8uG/Fbhmd P29A== 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=j8QQfP9AhHWR1M0XPN5tE0asKfUJqNMbwUbatd3cgv4=; b=U3rcDatBudu+2zSNa3Ry6tMybJefr2UWLIfwJf/ww+2JQGDL/RsGWpT9s8JO2e2Ujb 86K42J/CPA6GEC+x1nl9HrPhD9JpjsiCJ8I5rpf+bh1H+ltjkz00q7ACjVb8pQgXKy2J hGlH52wwp8I+UwL0DJZLzeIHJiCjzN5tqlSP5LONi+Z0JyBSbR8tl5CC+eCs7/50l/99 rYAoCtlV/HN/7wDa7HX51ithM7sE0xm1PvyskMFuVvDm2eprbVsX8pv4wKaYqlJPWuUw +gdZYmIN4llXvjtm1CCQpyJxlPUzYCy8S5rVXE8DKvEKC2bM7FcWKmUkznylBfsndbIL 1PCw== 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 c16-v6si5265971pgw.460.2018.07.05.04.05.00; Thu, 05 Jul 2018 04:05:15 -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 S1753919AbeGELCh (ORCPT + 99 others); Thu, 5 Jul 2018 07:02:37 -0400 Received: from mx2.suse.de ([195.135.220.15]:59904 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753635AbeGELBo (ORCPT ); Thu, 5 Jul 2018 07:01:44 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 3D5D8AFAF; 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 , James Smart , Dick Kennedy Subject: [PATCH 3/4] scsi: lpfc: remove ScsiResult macro Date: Thu, 5 Jul 2018 13:01:39 +0200 Message-Id: <20180705110140.19545-4-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 Cc: James Smart Cc: Dick Kennedy --- drivers/scsi/lpfc/lpfc_crtn.h | 1 - drivers/scsi/lpfc/lpfc_scsi.c | 44 +++++++++++++++++++++---------------------- 2 files changed, 22 insertions(+), 23 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_crtn.h b/drivers/scsi/lpfc/lpfc_crtn.h index 4ae9ba425e78..30f9e3ff6cb5 100644 --- a/drivers/scsi/lpfc/lpfc_crtn.h +++ b/drivers/scsi/lpfc/lpfc_crtn.h @@ -469,7 +469,6 @@ int lpfc_parse_vpd(struct lpfc_hba *, uint8_t *, int); void lpfc_start_fdiscs(struct lpfc_hba *phba); struct lpfc_vport *lpfc_find_vport_by_vpid(struct lpfc_hba *, uint16_t); struct lpfc_sglq *__lpfc_get_active_sglq(struct lpfc_hba *, uint16_t); -#define ScsiResult(host_code, scsi_code) (((host_code) << 16) | scsi_code) #define HBA_EVENT_RSCN 5 #define HBA_EVENT_LINK_UP 2 #define HBA_EVENT_LINK_DOWN 3 diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c index a94fb9f8bb44..924d7d672e9f 100644 --- a/drivers/scsi/lpfc/lpfc_scsi.c +++ b/drivers/scsi/lpfc/lpfc_scsi.c @@ -3017,8 +3017,8 @@ lpfc_calc_bg_err(struct lpfc_hba *phba, struct lpfc_scsi_buf *lpfc_cmd) if (err_type == BGS_GUARD_ERR_MASK) { scsi_build_sense_buffer(1, cmd->sense_buffer, ILLEGAL_REQUEST, 0x10, 0x1); - cmd->result = DRIVER_SENSE << 24 - | ScsiResult(DID_ABORT, SAM_STAT_CHECK_CONDITION); + cmd->result = DRIVER_SENSE << 24 | DID_ABORT << 16 | + SAM_STAT_CHECK_CONDITION; phba->bg_guard_err_cnt++; lpfc_printf_log(phba, KERN_WARNING, LOG_FCP | LOG_BG, "9069 BLKGRD: LBA %lx grd_tag error %x != %x\n", @@ -3028,8 +3028,8 @@ lpfc_calc_bg_err(struct lpfc_hba *phba, struct lpfc_scsi_buf *lpfc_cmd) } else if (err_type == BGS_REFTAG_ERR_MASK) { scsi_build_sense_buffer(1, cmd->sense_buffer, ILLEGAL_REQUEST, 0x10, 0x3); - cmd->result = DRIVER_SENSE << 24 - | ScsiResult(DID_ABORT, SAM_STAT_CHECK_CONDITION); + cmd->result = DRIVER_SENSE << 24 | DID_ABORT << 16 | + SAM_STAT_CHECK_CONDITION; phba->bg_reftag_err_cnt++; lpfc_printf_log(phba, KERN_WARNING, LOG_FCP | LOG_BG, @@ -3040,8 +3040,8 @@ lpfc_calc_bg_err(struct lpfc_hba *phba, struct lpfc_scsi_buf *lpfc_cmd) } else if (err_type == BGS_APPTAG_ERR_MASK) { scsi_build_sense_buffer(1, cmd->sense_buffer, ILLEGAL_REQUEST, 0x10, 0x2); - cmd->result = DRIVER_SENSE << 24 - | ScsiResult(DID_ABORT, SAM_STAT_CHECK_CONDITION); + cmd->result = DRIVER_SENSE << 24 | DID_ABORT << 16 | + SAM_STAT_CHECK_CONDITION; phba->bg_apptag_err_cnt++; lpfc_printf_log(phba, KERN_WARNING, LOG_FCP | LOG_BG, @@ -3096,7 +3096,7 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_scsi_buf *lpfc_cmd, spin_unlock(&_dump_buf_lock); if (lpfc_bgs_get_invalid_prof(bgstat)) { - cmd->result = ScsiResult(DID_ERROR, 0); + cmd->result = DID_ERROR << 16; lpfc_printf_log(phba, KERN_WARNING, LOG_FCP | LOG_BG, "9072 BLKGRD: Invalid BG Profile in cmd" " 0x%x lba 0x%llx blk cnt 0x%x " @@ -3108,7 +3108,7 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_scsi_buf *lpfc_cmd, } if (lpfc_bgs_get_uninit_dif_block(bgstat)) { - cmd->result = ScsiResult(DID_ERROR, 0); + cmd->result = DID_ERROR << 16; lpfc_printf_log(phba, KERN_WARNING, LOG_FCP | LOG_BG, "9073 BLKGRD: Invalid BG PDIF Block in cmd" " 0x%x lba 0x%llx blk cnt 0x%x " @@ -3124,8 +3124,8 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_scsi_buf *lpfc_cmd, scsi_build_sense_buffer(1, cmd->sense_buffer, ILLEGAL_REQUEST, 0x10, 0x1); - cmd->result = DRIVER_SENSE << 24 - | ScsiResult(DID_ABORT, SAM_STAT_CHECK_CONDITION); + cmd->result = DRIVER_SENSE << 24 | DID_ABORT << 16 | + SAM_STAT_CHECK_CONDITION; phba->bg_guard_err_cnt++; lpfc_printf_log(phba, KERN_WARNING, LOG_FCP | LOG_BG, "9055 BLKGRD: Guard Tag error in cmd" @@ -3140,8 +3140,8 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_scsi_buf *lpfc_cmd, scsi_build_sense_buffer(1, cmd->sense_buffer, ILLEGAL_REQUEST, 0x10, 0x3); - cmd->result = DRIVER_SENSE << 24 - | ScsiResult(DID_ABORT, SAM_STAT_CHECK_CONDITION); + cmd->result = DRIVER_SENSE << 24 | DID_ABORT << 16 | + SAM_STAT_CHECK_CONDITION; phba->bg_reftag_err_cnt++; lpfc_printf_log(phba, KERN_WARNING, LOG_FCP | LOG_BG, @@ -3157,8 +3157,8 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_scsi_buf *lpfc_cmd, scsi_build_sense_buffer(1, cmd->sense_buffer, ILLEGAL_REQUEST, 0x10, 0x2); - cmd->result = DRIVER_SENSE << 24 - | ScsiResult(DID_ABORT, SAM_STAT_CHECK_CONDITION); + cmd->result = DRIVER_SENSE << 24 | DID_ABORT << 16 | + SAM_STAT_CHECK_CONDITION; phba->bg_apptag_err_cnt++; lpfc_printf_log(phba, KERN_WARNING, LOG_FCP | LOG_BG, @@ -3866,7 +3866,7 @@ lpfc_handle_fcp_err(struct lpfc_vport *vport, struct lpfc_scsi_buf *lpfc_cmd, } out: - cmnd->result = ScsiResult(host_status, scsi_status); + cmnd->result = host_status << 16 | scsi_status; lpfc_send_scsi_error_event(vport->phba, vport, lpfc_cmd, rsp_iocb); } @@ -4019,7 +4019,7 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn, break; case IOSTAT_NPORT_BSY: case IOSTAT_FABRIC_BSY: - cmd->result = ScsiResult(DID_TRANSPORT_DISRUPTED, 0); + cmd->result = DID_TRANSPORT_DISRUPTED << 16; fast_path_evt = lpfc_alloc_fast_evt(phba); if (!fast_path_evt) break; @@ -4053,14 +4053,14 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn, lpfc_cmd->result == IOERR_ELXSEC_CRYPTO_ERROR || lpfc_cmd->result == IOERR_ELXSEC_CRYPTO_COMPARE_ERROR) { - cmd->result = ScsiResult(DID_NO_CONNECT, 0); + cmd->result = DID_NO_CONNECT << 16; break; } if (lpfc_cmd->result == IOERR_INVALID_RPI || lpfc_cmd->result == IOERR_NO_RESOURCES || lpfc_cmd->result == IOERR_ABORT_REQUESTED || lpfc_cmd->result == IOERR_SLER_CMD_RCV_FAILURE) { - cmd->result = ScsiResult(DID_REQUEUE, 0); + cmd->result = DID_REQUEUE << 16; break; } if ((lpfc_cmd->result == IOERR_RX_DMA_FAILED || @@ -4094,16 +4094,16 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn, } /* else: fall through */ default: - cmd->result = ScsiResult(DID_ERROR, 0); + cmd->result = DID_ERROR << 16; break; } if (!pnode || !NLP_CHK_NODE_ACT(pnode) || (pnode->nlp_state != NLP_STE_MAPPED_NODE)) - cmd->result = ScsiResult(DID_TRANSPORT_DISRUPTED, - SAM_STAT_BUSY); + cmd->result = DID_TRANSPORT_DISRUPTED << 16 | + SAM_STAT_BUSY; } else - cmd->result = ScsiResult(DID_OK, 0); + cmd->result = DID_OK << 16; if (cmd->result || lpfc_cmd->fcp_rsp->rspSnsLen) { uint32_t *lp = (uint32_t *)cmd->sense_buffer; -- 2.16.4