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] [day] [month] [year] [list]
Date:   Thu, 03 Aug 2023 00:01:25 +0200
From:   "Arnd Bergmann" <arnd@...nel.org>
To:     "Nick Desaulniers" <ndesaulniers@...gle.com>,
        "Sergio Paracuellos" <sergio.paracuellos@...il.com>,
        "Nathan Chancellor" <nathan@...nel.org>
Cc:     linux-clk@...r.kernel.org,
        "Thomas Bogendoerfer" <tsbogend@...ha.franken.de>,
        "Stephen Boyd" <sboyd@...nel.org>,
        "Michael Turquette" <mturquette@...libre.com>,
        linux-kernel@...r.kernel.org, "kernel test robot" <lkp@...el.com>,
        clang-built-linux <llvm@...ts.linux.dev>
Subject: Re: [PATCH] clk: ralink: mtmips: quiet unused variable warning

On Wed, Aug 2, 2023, at 23:26, Nick Desaulniers wrote:
> On Wed, Aug 2, 2023 at 2:26 AM Sergio Paracuellos <sergio.paracuellos@...il.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@...el.com>
>> Closes: https://lore.kernel.org/oe-kbuild-all/202307242310.CdOnd2py-lkp@intel.com/
>> Signed-off-by: Sergio Paracuellos <sergio.paracuellos@...il.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@...gle.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ