lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 5 Oct 2020 07:07:52 +0000
From:   Michael Brunner <Michael.Brunner@...tron.com>
To:     "lee.jones@...aro.org" <lee.jones@...aro.org>
CC:     "mibru@....de" <mibru@....de>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mfd: kempld-core: Mark kempld-acpi_table as
 __maybe_unused

On Fri, 2020-10-02 at 08:01 +0100, Lee Jones wrote:
> On Thu, 01 Oct 2020, Michael Brunner wrote:
> 
> > The Intel 0-DAY CI Kernel Test Service reports an unused variable
> > warning when compiling with clang for PowerPC:
> > 
> > > > drivers/mfd/kempld-core.c:556:36: warning: unused variable
> > > > 'kempld_acpi_table' [-Wunused-const-variable]
> >    static const struct acpi_device_id kempld_acpi_table[] = {
> > 
> > The issue can be fixed by marking kempld_acpi_table as
> > __maybe_unused.
> > 
> > Fixes: e8299c7313af ("[PATCH] mfd: Add ACPI support to Kontron PLD
> > driver")
> > 
> > Reported-by: kernel test robot <lkp@...el.com>
> > Signed-off-by: Michael Brunner <michael.brunner@...tron.com>
> > ---
> >  drivers/mfd/kempld-core.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/mfd/kempld-core.c b/drivers/mfd/kempld-core.c
> > index 1dfe556df038..273481dfaad4 100644
> > --- a/drivers/mfd/kempld-core.c
> > +++ b/drivers/mfd/kempld-core.c
> > @@ -553,7 +553,7 @@ static int kempld_remove(struct platform_device
> > *pdev)
> >  	return 0;
> >  }
> >  
> > -static const struct acpi_device_id kempld_acpi_table[] = {
> > +static const struct acpi_device_id __maybe_unused
> > kempld_acpi_table[] = {
> >  	{ "KEM0001", (kernel_ulong_t)&kempld_platform_data_generic },
> >  	{}
> >  };
> 
> This is not the right fix.  Better just to compile it out completely
> in these circumstances.  I already have a fix for this in soak.

Ok - thank you for the other fix you submitted!

But just out of curiosity - in process/coding-style.rst is written that
__maybe_unused should be preferred over wrapping in preprocessor
conditionals, if a function or variable may potentially go unused in a
particular configuration. So why is my patch not the right one here? At
least in my tests it seemed to solve the issue.

Thanks,
  Michael

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ