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]
Message-ID: <decb7338-eeb8-3c0c-88f2-c0b00fb8b0e7@collabora.com>
Date:   Thu, 28 Jul 2022 13:15:14 +0200
From:   AngeloGioacchino Del Regno 
        <angelogioacchino.delregno@...labora.com>
To:     Jean Delvare <jdelvare@...e.de>, linux-kernel@...r.kernel.org,
        linux-mediatek@...ts.infradead.org, Mark Brown <broonie@...nel.org>
Cc:     Liam Girdwood <lgirdwood@...il.com>,
        Mark Brown <broonie@...nel.org>,
        Matthias Brugger <matthias.bgg@...il.com>,
        Chenglin Xu <chenglin.xu@...iatek.com>,
        Sean Wang <sean.wang@...iatek.com>
Subject: Re: [PATCH RFC] regulator: mt6380: Fix unused array warning

Il 27/07/22 13:26, Jean Delvare ha scritto:
> With the following configuration options:
> CONFIG_OF is not set
> CONFIG_REGULATOR_MT6380=y
> we get the following build warning:
> 
>    CC      drivers/regulator/mt6380-regulator.o
> drivers/regulator/mt6380-regulator.c:322:34: warning: ‘mt6380_of_match’ defined but not used [-Wunused-const-variable=]
> 
> Fix this by annotating that array with __maybe_unused, as done in
> various regulator drivers.

I know I'm late to the party, but I would've preferred to see the
of_match_ptr() dropped instead of adding a __maybe_unused.

Cheers,
Angelo

> 
> Signed-off-by: Jean Delvare <jdelvare@...e.de>
> Reported-by: kernel test robot <lkp@...el.com>
> Link: https://lore.kernel.org/all/202207240252.ZY5hSCNB-lkp@intel.com/
> Cc: Liam Girdwood <lgirdwood@...il.com>
> Cc: Mark Brown <broonie@...nel.org>
> Cc: Matthias Brugger <matthias.bgg@...il.com>
> Cc: Chenglin Xu <chenglin.xu@...iatek.com>
> ---
> This assumes that the mt6380 driver can be used without OF support.
> However, I can't find any in-tree piece of code instantiating the
> "mt6380-regulator" platform device by name. So unless there's an
> out-of-tree user, a better fix would be to remove mt6380_platform_ids
> and make the driver depend on OF. Chenglin, would that be OK with
> you?
> 
>   drivers/regulator/mt6380-regulator.c |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- linux-5.18.orig/drivers/regulator/mt6380-regulator.c	2022-07-27 11:55:21.672421481 +0200
> +++ linux-5.18/drivers/regulator/mt6380-regulator.c	2022-07-27 12:01:53.151833378 +0200
> @@ -319,7 +319,7 @@ static const struct platform_device_id m
>   };
>   MODULE_DEVICE_TABLE(platform, mt6380_platform_ids);
>   
> -static const struct of_device_id mt6380_of_match[] = {
> +static const struct of_device_id  __maybe_unused mt6380_of_match[] = {
>   	{ .compatible = "mediatek,mt6380-regulator", },
>   	{ /* sentinel */ },
>   };
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ