Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3512688pxj; Tue, 1 Jun 2021 07:04:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwbuOcJWv7jAXzr2TYsdmbxIROD/lHzzERJTsw5/P/5XG3bHhGbwd5YNL352g7HZQB2QZnc X-Received: by 2002:a05:6e02:218f:: with SMTP id j15mr21603495ila.249.1622556274859; Tue, 01 Jun 2021 07:04:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622556274; cv=none; d=google.com; s=arc-20160816; b=m7JU0a9CXVktrJ4mPZJZP4vZb/YeOyVZlCKtwQtEx/TZdeIAFUn3vwlsJ4ARt5Guer h1WEeqDrd+CJRTHa2BphIJHMFNJva6r9Bc/JXC7EBu4WJQP+W2IVuWATv1iJSKhoYJHW CJ1xcvsCJ8DyWN7n+5A1nBORhUttCP0LpGgI7rvhgFoqsupN65bHXkv0EVWM9UltYTOY Q7rd1R/zzbnqd0Bt6oNxjQy+R0KImZsd7V7o9TQ8NQ7J/O4EhAI17dPL2ObbUF2E2kno vlNz/SbNb8S+joqk9M9T3420/Goyd6PxzXQENY6vgDiEm4zBj6rgOXFdPclQLxkqv8Py ukWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=zVoUdvn3eEWei3G8J3bfjkOJcT9yt8sd8bRXyli9BwI=; b=u/BQde9njhzboxiIr6v5TlIZRooWQ+3zgvmiVmOA4uWPP8pEZTtUG/uC8gTTFv2R/i OZ9UDSNYVJ8VnoCagM7vAbWcFdubZcWXt9SwgEq7JXNwhc0Ngn34IW46+CDAOc6hgQOA GiK2uqFEUFdQ4/Jwe1Aga0GC6GInxcV0C7/WdOAPLnt9jMqNuVIgcHQx7fUwHFGRdU8l 3SgUC50N7wdYlcKF83ch0VPY+a2IzNxoAQtwIIEZcPMvJRSPiydecBTsmejq+tqH8l7o hUBX3gpfCrfwmkswahCQq8JDENvhb9IiPQOUAXw7fbCsTa4mRk5mjCLtuZkXzvJ6LzWk L2MQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o10si10249719ilc.147.2021.06.01.07.04.18; Tue, 01 Jun 2021 07:04:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234249AbhFAOEc (ORCPT + 99 others); Tue, 1 Jun 2021 10:04:32 -0400 Received: from szxga08-in.huawei.com ([45.249.212.255]:3325 "EHLO szxga08-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234228AbhFAOEb (ORCPT ); Tue, 1 Jun 2021 10:04:31 -0400 Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.55]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4FvYdp3brmz1BGgh; Tue, 1 Jun 2021 21:58:06 +0800 (CST) Received: from dggema769-chm.china.huawei.com (10.1.198.211) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Tue, 1 Jun 2021 22:02:48 +0800 Received: from localhost (10.174.179.215) by dggema769-chm.china.huawei.com (10.1.198.211) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Tue, 1 Jun 2021 22:02:47 +0800 From: YueHaibing To: , , , CC: , , , YueHaibing Subject: [PATCH net-next] igb: Fix -Wunused-const-variable warning Date: Tue, 1 Jun 2021 22:02:38 +0800 Message-ID: <20210601140238.20712-1-yuehaibing@huawei.com> X-Mailer: git-send-email 2.10.2.windows.1 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.179.215] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggema769-chm.china.huawei.com (10.1.198.211) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If CONFIG_IGB_HWMON is n, gcc warns: drivers/net/ethernet/intel/igb/e1000_82575.c:2765:17: warning: ‘e1000_emc_therm_limit’ defined but not used [-Wunused-const-variable=] static const u8 e1000_emc_therm_limit[4] = { ^~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/intel/igb/e1000_82575.c:2759:17: warning: ‘e1000_emc_temp_data’ defined but not used [-Wunused-const-variable=] static const u8 e1000_emc_temp_data[4] = { ^~~~~~~~~~~~~~~~~~~ Move it into #ifdef block to fix this. Signed-off-by: YueHaibing --- drivers/net/ethernet/intel/igb/e1000_82575.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/igb/e1000_82575.c b/drivers/net/ethernet/intel/igb/e1000_82575.c index 50863fd87d53..cbe92fd23a70 100644 --- a/drivers/net/ethernet/intel/igb/e1000_82575.c +++ b/drivers/net/ethernet/intel/igb/e1000_82575.c @@ -2756,6 +2756,7 @@ s32 igb_get_eee_status_i354(struct e1000_hw *hw, bool *status) return ret_val; } +#ifdef CONFIG_IGB_HWMON static const u8 e1000_emc_temp_data[4] = { E1000_EMC_INTERNAL_DATA, E1000_EMC_DIODE1_DATA, @@ -2769,7 +2770,6 @@ static const u8 e1000_emc_therm_limit[4] = { E1000_EMC_DIODE3_THERM_LIMIT }; -#ifdef CONFIG_IGB_HWMON /** * igb_get_thermal_sensor_data_generic - Gathers thermal sensor data * @hw: pointer to hardware structure -- 2.17.1