From: "Arnd Bergmann" <arnd@kernel.org>
To: "Nick Desaulniers" <ndesaulniers@google.com>,
"Sergio Paracuellos" <sergio.paracuellos@gmail.com>,
"Nathan Chancellor" <nathan@kernel.org>
Cc: linux-clk@vger.kernel.org,
"Thomas Bogendoerfer" <tsbogend@alpha.franken.de>,
"Stephen Boyd" <sboyd@kernel.org>,
"Michael Turquette" <mturquette@baylibre.com>,
linux-kernel@vger.kernel.org, "kernel test robot" <lkp@intel.com>,
clang-built-linux <llvm@lists.linux.dev>
Subject: Re: [PATCH] clk: ralink: mtmips: quiet unused variable warning
Date: Thu, 03 Aug 2023 00:01:25 +0200 [thread overview]
Message-ID: <9a22ecee-ebb0-437e-bd2b-99b5c6944855@app.fastmail.com> (raw)
In-Reply-To: <CAKwvOd=SvHUPd8+sWtqgxghPEciD5sqPiggZx+OOEqxtJrML6Q@mail.gmail.com>
On Wed, Aug 2, 2023, at 23:26, Nick Desaulniers wrote:
> On Wed, Aug 2, 2023 at 2:26 AM Sergio Paracuellos <sergio.paracuellos@gmail.com> wrote:
>>
>> When CONFIG_OF is disabled then the matching table is not referenced and
>> the following warning appears:
>>
>> drivers/clk/ralink/clk-mtmips.c:821:34: warning: unused variable 'mtmips_of_match' [-Wunused-const-variable]
>> 821 | static const struct of_device_id mtmips_of_match[] = {
>> | ^
>>
>> Silence it declaring 'mtmips_of_match' with '__maybe_unused'.
>>
>> Fixes: 6f3b15586eef ("clk: ralink: add clock and reset driver for MTMIPS SoCs")
>> Reported-by: kernel test robot <lkp@intel.com>
>> Closes: https://lore.kernel.org/oe-kbuild-all/202307242310.CdOnd2py-lkp@intel.com/
>> Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
>
> I think this is fine; Arnd or Nathan do you have a preference? or thoughts here?
>
> If not, thanks for the patch.
> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
>
> (I have a slight preference for wrapping the use in `#ifdef CONFIG_OF`
> since with the approach used by this patch, if all users are removed
> we will never get a warning for this var. But it's a weak preference;
> it's more important to me that we don't have -Werror promote this
> warning to a build breakage)
I don't understand why there are two match tables in the same
driver, with almost the same contents. I have not looked very
closely here, but why can't we just drop the mtmips_clk_of_match[]
table (the one without the .data fields) and use the same
table for both? Is this because of the ralink,rt2880-reset entry
that is missing in mtmips_of_match, or is that another bug?
I also see that there is both a platform_driver instance for
late probing and a list of CLK_OF_DECLARE_DRIVER() entries.
Do we need both here?
Arnd
next prev parent reply other threads:[~2023-08-02 22:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-02 9:26 [PATCH] clk: ralink: mtmips: quiet unused variable warning Sergio Paracuellos
2023-08-02 21:26 ` Nick Desaulniers
2023-08-02 21:32 ` Nathan Chancellor
2023-08-02 22:01 ` Arnd Bergmann [this message]
[not found] ` <CAMhs-H-2g2QF8NjZOknEop_3UFc_R3YYhpEveU2fc-Ks-iM1bA@mail.gmail.com>
2023-08-03 7:58 ` Arnd Bergmann
2023-08-27 1:23 ` Sergio Paracuellos
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=9a22ecee-ebb0-437e-bd2b-99b5c6944855@app.fastmail.com \
--to=arnd@kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=llvm@lists.linux.dev \
--cc=mturquette@baylibre.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=sboyd@kernel.org \
--cc=sergio.paracuellos@gmail.com \
--cc=tsbogend@alpha.franken.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