mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michael Brunner <Michael.Brunner@kontron.com>
To: "lee.jones@linaro.org" <lee.jones@linaro.org>
Cc: "mibru@gmx.de" <mibru@gmx.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mfd: kempld-core: Mark kempld-acpi_table as __maybe_unused
Date: Mon, 5 Oct 2020 07:07:52 +0000	[thread overview]
Message-ID: <b7fb20174aa7fd8a15132b6de679498fe0b18fd1.camel@kontron.com> (raw)
In-Reply-To: <20201002070134.GR6148@dell>

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@intel.com>
> > Signed-off-by: Michael Brunner <michael.brunner@kontron.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

  reply	other threads:[~2020-10-05  7:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-01  9:52 Michael Brunner
2020-10-02  7:01 ` Lee Jones
2020-10-05  7:07   ` Michael Brunner [this message]
2020-10-06  6:53     ` Lee Jones
2020-10-06 15:54       ` Michael Brunner
2020-10-07  7:10         ` Lee Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b7fb20174aa7fd8a15132b6de679498fe0b18fd1.camel@kontron.com \
    --to=michael.brunner@kontron.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mibru@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®