[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAAfSe-vFxpQnkV95ySZpkzqhFLN2gh0YHSYuVvQpej0U7F3dow@mail.gmail.com>
Date: Tue, 3 Nov 2020 10:00:49 +0800
From: Chunyan Zhang <zhang.lyra@...il.com>
To: Bjorn Andersson <bjorn.andersson@...aro.org>
Cc: Baolin Wang <baolin.wang7@...il.com>,
Ohad Ben-Cohen <ohad@...ery.com>,
"linux-remoteproc@...r.kernel.org" <linux-remoteproc@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Orson Zhai <orsonzhai@...il.com>,
Chunyan Zhang <chunyan.zhang@...soc.com>
Subject: Re: [PATCH v2 1/2] hwspinlock: sprd: fixed warning of unused variable 'sprd_hwspinlock_of_match'
On Tue, 3 Nov 2020 at 07:58, Bjorn Andersson <bjorn.andersson@...aro.org> wrote:
>
> On Mon 02 Nov 17:34 CST 2020, Baolin Wang wrote:
>
> > On Friday, October 30, 2020, Chunyan Zhang <zhang.lyra@...il.com> wrote:
> > > From: Chunyan Zhang <chunyan.zhang@...soc.com>
> > >
> > > The macro function of_match_ptr() is NULL if CONFIG_OF is not set, then
> > > Clang compiler would complain the of_device_id variable is unused.
> > >
> > > But using of_match_ptr() is space saving, for this case, the unused
> > structure
> > > 'sprd_hwspinlock_of_match' would be not built into symbol table if
> > CONFIG_OF
> > > is not set, probably depends on the compiler though.
> > >
> > > So adding __maybe_unsed seems a good approach to fix this warning.
> > >
> > > Reported-by: kernel test robot <lkp@...el.com>
> > > Fixes: d8c8bbbb1aba ("hwspinlock: sprd: Add hardware spinlock driver")
> > > Signed-off-by: Chunyan Zhang <chunyan.zhang@...soc.com>
> > > ---
> >
> > I'd like to remove this wrapper, and just depend on the CONFIG_OF. But I
> > have no objection for this patch. So
> > Reviewed-by: Baolin Wang <baolin.wang7@...il.com>
> >
>
> As noted on the first line of the probe function, this driver isn't
> going to do anything when CONFIG_OF is disabled - and I don't think we
> should worry too much about space savings during COMPILE_TEST.
>
> So I would prefer that we simply drop the of_match_ptr()
Ok, that's what the v1 does.
Bjorn, could you please pick up the 1st patch in v1 [1]?
Thanks,
Chunyan
[1] https://lkml.org/lkml/2020/10/26/87
>
> But I believe that's what you're saying as well Baolin?
>
> Regards,
> Bjorn
>
> >
> > > drivers/hwspinlock/sprd_hwspinlock.c | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/hwspinlock/sprd_hwspinlock.c
> > b/drivers/hwspinlock/sprd_hwspinlock.c
> > > index 36dc8038bbb4..4c63e2546064 100644
> > > --- a/drivers/hwspinlock/sprd_hwspinlock.c
> > > +++ b/drivers/hwspinlock/sprd_hwspinlock.c
> > > @@ -138,7 +138,7 @@ static int sprd_hwspinlock_probe(struct
> > platform_device *pdev)
> > > SPRD_HWLOCKS_NUM);
> > > }
> > >
> > > -static const struct of_device_id sprd_hwspinlock_of_match[] = {
> > > +static const __maybe_unused struct of_device_id
> > sprd_hwspinlock_of_match[] = {
> > > { .compatible = "sprd,hwspinlock-r3p0", },
> > > { /* sentinel */ }
> > > };
> > > --
> > > 2.20.1
> > >
> > >
> >
> > --
> > Baolin Wang
Powered by blists - more mailing lists