From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F5D9C433DB for ; Thu, 4 Mar 2021 20:05:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 944D864F77 for ; Thu, 4 Mar 2021 20:05:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 944D864F77 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C16326B0005; Thu, 4 Mar 2021 15:05:41 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BEC496B0006; Thu, 4 Mar 2021 15:05:41 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A8D2F6B0007; Thu, 4 Mar 2021 15:05:41 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0100.hostedemail.com [216.40.44.100]) by kanga.kvack.org (Postfix) with ESMTP id 88C9E6B0005 for ; Thu, 4 Mar 2021 15:05:41 -0500 (EST) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 3D74C18001746 for ; Thu, 4 Mar 2021 20:05:41 +0000 (UTC) X-FDA: 77883272082.15.4D66B0C Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf10.hostedemail.com (Postfix) with ESMTP id 4BADF40001DE for ; Thu, 4 Mar 2021 20:05:30 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 1BDB964F6F; Thu, 4 Mar 2021 20:05:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1614888331; bh=Y4YsXvjTJ6Vfn4PgfEjWu6Lmi5jcoEunYnVYp+H4FB4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rzMCnefGJV6I0RfuRATvp/WAd58YxGSHOJFqtKLjH1WbCGhguISQpTQqB8VyjOMrM pwMdV1FudmNxV0u8EEOUPsMsAm6/kf0R4WcgTb+qU1eTDWZMjXRn5FncFCQneRJNzy pGfxr4RERZ56Lgkc/aFL0C9cto2Js7lxTvP3mjJPWqDi5/ivxZQQBdYcYO9z3CWBBl 9zsQM9JkZtlOvVQX0fm2hclVhiPf/tfEXPNxefOXDux9SLtqaSR5PyBcJulKWbSlM8 l7XHi868zcqzXwfkNNUE73r5qu90Ytvh/H92N07Ws0XeJycjuB47aVED+ZabS7G1GK ZDQhLu+UMYK2g== Date: Thu, 4 Mar 2021 13:05:26 -0700 From: Nathan Chancellor To: Hans de Goede Cc: kernel test robot , Mario Limonciello , kbuild-all@lists.01.org, clang-built-linux@googlegroups.com, Linux Memory Management List Subject: Re: [linux-next:master 7714/11865] drivers/platform/x86/dell/dell-smbios-smm.c:27:35: warning: unused variable 'dell_device_table' Message-ID: <20210304200526.io7weii5xk2tlh4g@archlinux-ax161> References: <202102202323.OkXTM7bf-lkp@intel.com> <1b24561f-5d9d-dcfb-a231-11be10722074@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1b24561f-5d9d-dcfb-a231-11be10722074@redhat.com> X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 4BADF40001DE X-Stat-Signature: q9i89z5i45xrreac893ga1eohebibg6n Received-SPF: none (kernel.org>: No applicable sender policy available) receiver=imf10; identity=mailfrom; envelope-from=""; helo=mail.kernel.org; client-ip=198.145.29.99 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1614888330-361956 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Mar 04, 2021 at 12:59:08PM +0100, Hans de Goede wrote: > Hi, > > On 2/20/21 4:16 PM, kernel test robot wrote: > > Hi Mario, > > > > First bad commit (maybe != root cause): > > > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master > > head: abaf6f60176f1ae9d946d63e4db63164600b7b1a > > commit: f1e1ea516721d1ea0b21327ff9e6cb2c2bb86e28 [7714/11865] platform/x86: Move all dell drivers to their own subdirectory > > config: x86_64-randconfig-r014-20210220 (attached as .config) > > compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project c9439ca36342fb6013187d0a69aef92736951476) > > reproduce (this is a W=1 build): > > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross > > chmod +x ~/bin/make.cross > > # install x86_64 cross compiling tool for clang build > > # apt-get install binutils-x86-64-linux-gnu > > # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=f1e1ea516721d1ea0b21327ff9e6cb2c2bb86e28 > > git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git > > git fetch --no-tags linux-next master > > git checkout f1e1ea516721d1ea0b21327ff9e6cb2c2bb86e28 > > # save the attached .config to linux build tree > > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 > > > > If you fix the issue, kindly add following tag as appropriate > > Reported-by: kernel test robot > > > > All warnings (new ones prefixed by >>): > > > >>> drivers/platform/x86/dell/dell-smbios-smm.c:27:35: warning: unused variable 'dell_device_table' [-Wunused-const-variable] > > static const struct dmi_system_id dell_device_table[] __initconst = { > > ^ > > 1 warning generated. > > So this table is only there so that it can be passed to the MODULE_DEVICE_TABLE() macro for auto-loading the module. > > I guess that that macro used to give enough of a reference to the table for the compiler to not complain but that > seems to have changed. This particular config has CONFIG_DELL_SMBIOS_SMM=y, which means that MODULE_DEVICE_TABLE() expands to nothing so it is indeed unused. I do not think that anything changed on the compiler side as this is reproducible with both GCC and clang. Do note that W=1 is needed to reproduce this. > I suggest that we just add an __maybe_unused to the declaration of the table to silence the warning. Yes, this would probably be the best fix. Cheers, Nathan > Regards, > > Hans > > > > > > > > > > > vim +/dell_device_table +27 drivers/platform/x86/dell/dell-smbios-smm.c > > > > 549b4930f05765 drivers/platform/x86/dell-smbios-smm.c Mario Limonciello 2017-11-01 26 > > 549b4930f05765 drivers/platform/x86/dell-smbios-smm.c Mario Limonciello 2017-11-01 @27 static const struct dmi_system_id dell_device_table[] __initconst = { > > 549b4930f05765 drivers/platform/x86/dell-smbios-smm.c Mario Limonciello 2017-11-01 28 { > > 549b4930f05765 drivers/platform/x86/dell-smbios-smm.c Mario Limonciello 2017-11-01 29 .ident = "Dell laptop", > > 549b4930f05765 drivers/platform/x86/dell-smbios-smm.c Mario Limonciello 2017-11-01 30 .matches = { > > 549b4930f05765 drivers/platform/x86/dell-smbios-smm.c Mario Limonciello 2017-11-01 31 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), > > 549b4930f05765 drivers/platform/x86/dell-smbios-smm.c Mario Limonciello 2017-11-01 32 DMI_MATCH(DMI_CHASSIS_TYPE, "8"), > > 549b4930f05765 drivers/platform/x86/dell-smbios-smm.c Mario Limonciello 2017-11-01 33 }, > > 549b4930f05765 drivers/platform/x86/dell-smbios-smm.c Mario Limonciello 2017-11-01 34 }, > > 549b4930f05765 drivers/platform/x86/dell-smbios-smm.c Mario Limonciello 2017-11-01 35 { > > 549b4930f05765 drivers/platform/x86/dell-smbios-smm.c Mario Limonciello 2017-11-01 36 .matches = { > > 549b4930f05765 drivers/platform/x86/dell-smbios-smm.c Mario Limonciello 2017-11-01 37 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), > > 549b4930f05765 drivers/platform/x86/dell-smbios-smm.c Mario Limonciello 2017-11-01 38 DMI_MATCH(DMI_CHASSIS_TYPE, "9"), /*Laptop*/ > > 549b4930f05765 drivers/platform/x86/dell-smbios-smm.c Mario Limonciello 2017-11-01 39 }, > > 549b4930f05765 drivers/platform/x86/dell-smbios-smm.c Mario Limonciello 2017-11-01 40 }, > > 549b4930f05765 drivers/platform/x86/dell-smbios-smm.c Mario Limonciello 2017-11-01 41 { > > 549b4930f05765 drivers/platform/x86/dell-smbios-smm.c Mario Limonciello 2017-11-01 42 .matches = { > > 549b4930f05765 drivers/platform/x86/dell-smbios-smm.c Mario Limonciello 2017-11-01 43 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), > > 549b4930f05765 drivers/platform/x86/dell-smbios-smm.c Mario Limonciello 2017-11-01 44 DMI_MATCH(DMI_CHASSIS_TYPE, "10"), /*Notebook*/ > > 549b4930f05765 drivers/platform/x86/dell-smbios-smm.c Mario Limonciello 2017-11-01 45 }, > > 549b4930f05765 drivers/platform/x86/dell-smbios-smm.c Mario Limonciello 2017-11-01 46 }, > > 549b4930f05765 drivers/platform/x86/dell-smbios-smm.c Mario Limonciello 2017-11-01 47 { > > 549b4930f05765 drivers/platform/x86/dell-smbios-smm.c Mario Limonciello 2017-11-01 48 .ident = "Dell Computer Corporation", > > 549b4930f05765 drivers/platform/x86/dell-smbios-smm.c Mario Limonciello 2017-11-01 49 .matches = { > > 549b4930f05765 drivers/platform/x86/dell-smbios-smm.c Mario Limonciello 2017-11-01 50 DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"), > > 549b4930f05765 drivers/platform/x86/dell-smbios-smm.c Mario Limonciello 2017-11-01 51 DMI_MATCH(DMI_CHASSIS_TYPE, "8"), > > 549b4930f05765 drivers/platform/x86/dell-smbios-smm.c Mario Limonciello 2017-11-01 52 }, > > 549b4930f05765 drivers/platform/x86/dell-smbios-smm.c Mario Limonciello 2017-11-01 53 }, > > 549b4930f05765 drivers/platform/x86/dell-smbios-smm.c Mario Limonciello 2017-11-01 54 { } > > 549b4930f05765 drivers/platform/x86/dell-smbios-smm.c Mario Limonciello 2017-11-01 55 }; > > 549b4930f05765 drivers/platform/x86/dell-smbios-smm.c Mario Limonciello 2017-11-01 56 MODULE_DEVICE_TABLE(dmi, dell_device_table); > > 549b4930f05765 drivers/platform/x86/dell-smbios-smm.c Mario Limonciello 2017-11-01 57 > > > > :::::: The code at line 27 was first introduced by commit > > :::::: 549b4930f057658dc50d8010e66219233119a4d8 platform/x86: dell-smbios: Introduce dispatcher for SMM calls > > > > :::::: TO: Mario Limonciello > > :::::: CC: Darren Hart (VMware) > > > > --- > > 0-DAY CI Kernel Test Service, Intel Corporation > > https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org > > > >