From patchwork Tue Nov 13 07:09:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yue Haibing X-Patchwork-Id: 10679811 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DFC401747 for ; Tue, 13 Nov 2018 07:00:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C93C529F6A for ; Tue, 13 Nov 2018 07:00:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BD53829F70; Tue, 13 Nov 2018 07:00:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9C9CF29F8B for ; Tue, 13 Nov 2018 07:00:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730966AbeKMQ5E (ORCPT ); Tue, 13 Nov 2018 11:57:04 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:38227 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730964AbeKMQ5E (ORCPT ); Tue, 13 Nov 2018 11:57:04 -0500 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 7B93B8A75DE77; Tue, 13 Nov 2018 15:00:18 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.408.0; Tue, 13 Nov 2018 15:00:10 +0800 From: YueHaibing To: "James E.J. Bottomley" , "Martin K. Petersen" CC: YueHaibing , , Subject: [PATCH -next] scsi: pmcraid: remove set but not used variables 'res, access' Date: Tue, 13 Nov 2018 07:09:38 +0000 Message-ID: <1542092978-71192-1-git-send-email-yuehaibing@huawei.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fixes gcc '-Wunused-but-set-variable' warning: drivers/scsi/pmcraid.c: In function 'pmcraid_abort_cmd': drivers/scsi/pmcraid.c:2878:33: warning: variable 'res' set but not used [-Wunused-but-set-variable] drivers/scsi/pmcraid.c: In function 'pmcraid_ioctl_passthrough': drivers/scsi/pmcraid.c:3603:5: warning: variable 'access' set but not used [-Wunused-but-set-variable] 'res' never used since introduction in commit 89a368104150 ("[SCSI] pmcraid: PMC-Sierra MaxRAID driver to support 6Gb/s SAS RAID controller") 'access' not used any more since commit edb88cef0570 ("scsi: pmcraid: use normal copy_from_user") Signed-off-by: YueHaibing --- drivers/scsi/pmcraid.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c index 707d766..555e4a3 100644 --- a/drivers/scsi/pmcraid.c +++ b/drivers/scsi/pmcraid.c @@ -2875,10 +2875,8 @@ static struct pmcraid_cmd *pmcraid_abort_cmd(struct pmcraid_cmd *cmd) { struct pmcraid_cmd *cancel_cmd; struct pmcraid_instance *pinstance; - struct pmcraid_resource_entry *res; pinstance = (struct pmcraid_instance *)cmd->drv_inst; - res = cmd->scsi_cmd->device->hostdata; cancel_cmd = pmcraid_get_free_cmd(pinstance); @@ -3600,7 +3598,7 @@ static long pmcraid_ioctl_passthrough( u32 ioasc; int request_size; int buffer_size; - u8 access, direction; + u8 direction; int rc = 0; /* If IOA reset is in progress, wait 10 secs for reset to complete */ @@ -3648,13 +3646,10 @@ static long pmcraid_ioctl_passthrough( request_size = le32_to_cpu(buffer->ioarcb.data_transfer_length); - if (buffer->ioarcb.request_flags0 & TRANSFER_DIR_WRITE) { - access = VERIFY_READ; + if (buffer->ioarcb.request_flags0 & TRANSFER_DIR_WRITE) direction = DMA_TO_DEVICE; - } else { - access = VERIFY_WRITE; + else direction = DMA_FROM_DEVICE; - } if (request_size < 0) { rc = -EINVAL;