Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp339167ybl; Thu, 12 Dec 2019 19:33:07 -0800 (PST) X-Google-Smtp-Source: APXvYqzDyR+9mt/oKo6cTAurBiAJxBSeAyEaiJCxP63FscBLVoFI3j/R0cUkewNCDu13/jOG+N+H X-Received: by 2002:a9d:1d07:: with SMTP id m7mr12328627otm.261.1576207987241; Thu, 12 Dec 2019 19:33:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576207987; cv=none; d=google.com; s=arc-20160816; b=s81d3CDipPTVT9nuq/73BAXNjanpfrNonbHKK25+nhT95IdngKqD2RzxUmfjkJRogJ USOeR3Pv16qAFKS2HRM5q+kT9sK2MkHyGNOWTeOZYXx1s/YR4BD0gojvhkT7ZGbVAY96 itn7SSd+JhNEJDsTOZpGGlqRJn5Hp7icI/w1+m39lnlEa8Y1nzUDJiMX1Bfeq5r1w/GV NF2ecjrlU/Ppyjsw0D46n4UKO/gudcvGUBqrmqoTYjA/fUt3KwclZbT0ohpJZg6fpwhJ qrdmKHHq8EAeBLU/+NrEQodePv5QWxxloUCIX6L8FFA5VTOGSoPv8MCMtJ9b/JjsHwS+ Yunw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=m0/SOGqn9rwlTwCjPtOfQ0RYIh7Xa8wmU/K5dqaUAiI=; b=BTWg6wRWm2yssPlIdF9SCkgg97yGhY87xyrLfZp9N7aUgA9+tiogGSOs4QLQYZkzuU cMI7ZHizUR6eV3VmHIwzU8cW4lfRtIabJwLIXhJQ8wu54tUXJR4B5tXexjR0VLLl5Sli 22+X93xA13GS4pAbmtcgN0jECbo3YVGBGhMDtbD1Ed0ZzPuITNL0V/2W4B/lAAFmdN1M d+CLFsMLPVX/QoW6OjEIYTBehAl/FFmUEADhYJjIhoklM4hWwgYXvDVRapfrr/S/8Fiz MN2tdVlz0WessnJLQDwfB9yFN3Hm2MnE64K2ikvxcZlGwpV3i4YAKy34CpHuK1KKhNSP +AAQ== 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 d6si4001936otq.41.2019.12.12.19.32.40; Thu, 12 Dec 2019 19:33:07 -0800 (PST) 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 S1731428AbfLMDOz (ORCPT + 99 others); Thu, 12 Dec 2019 22:14:55 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:7229 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726631AbfLMDOz (ORCPT ); Thu, 12 Dec 2019 22:14:55 -0500 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 3FD2FB1B068FFFE16816; Fri, 13 Dec 2019 11:14:53 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.439.0; Fri, 13 Dec 2019 11:14:45 +0800 From: Hongbo Yao To: CC: , , , Subject: [PATCH] ata: acard-ahci: removeset but not used variable 'n_elem' Date: Fri, 13 Dec 2019 11:11:57 +0800 Message-ID: <20191213031157.52115-1-yaohongbo@huawei.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fixes gcc '-Wunused-but-set-variable' warning: drivers/ata/acard-ahci.c: In function acard_ahci_qc_prep: drivers/ata/acard-ahci.c:268:15: warning: variable n_elem set but not used [-Wunused-but-set-variable] It is never used so can be removed. acard_ahci_fill_sg() is called only in one place, use 'void' instead of 'int'. Reported-by: Hulk Robot Signed-off-by: Hongbo Yao --- drivers/ata/acard-ahci.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/ata/acard-ahci.c b/drivers/ata/acard-ahci.c index 46dc54d18f0b..0613c1269292 100644 --- a/drivers/ata/acard-ahci.c +++ b/drivers/ata/acard-ahci.c @@ -179,7 +179,7 @@ static void acard_ahci_pci_print_info(struct ata_host *host) ahci_print_info(host, scc_s); } -static unsigned int acard_ahci_fill_sg(struct ata_queued_cmd *qc, void *cmd_tbl) +static void acard_ahci_fill_sg(struct ata_queued_cmd *qc, void *cmd_tbl) { struct scatterlist *sg; struct acard_sg *acard_sg = cmd_tbl + AHCI_CMD_TBL_HDR_SZ; @@ -206,8 +206,6 @@ static unsigned int acard_ahci_fill_sg(struct ata_queued_cmd *qc, void *cmd_tbl) } acard_sg[last_si].size |= cpu_to_le32(1 << 31); /* set EOT */ - - return si; } static enum ata_completion_errors acard_ahci_qc_prep(struct ata_queued_cmd *qc) @@ -218,7 +216,6 @@ static enum ata_completion_errors acard_ahci_qc_prep(struct ata_queued_cmd *qc) void *cmd_tbl; u32 opts; const u32 cmd_fis_len = 5; /* five dwords */ - unsigned int n_elem; /* * Fill in command table information. First, the header, @@ -232,9 +229,8 @@ static enum ata_completion_errors acard_ahci_qc_prep(struct ata_queued_cmd *qc) memcpy(cmd_tbl + AHCI_CMD_TBL_CDB, qc->cdb, qc->dev->cdb_len); } - n_elem = 0; if (qc->flags & ATA_QCFLAG_DMAMAP) - n_elem = acard_ahci_fill_sg(qc, cmd_tbl); + acard_ahci_fill_sg(qc, cmd_tbl); /* * Fill in command slot information. -- 2.20.1