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: <20220728001648.cwfcmcg75lpqip5v@skbuf>
Date:   Thu, 28 Jul 2022 03:16:48 +0300
From:   Vladimir Oltean <olteanv@...il.com>
To:     Souptick Joarder <jrdr.linux@...il.com>
Cc:     woojung.huh@...rochip.com, UNGLinuxDriver@...rochip.com,
        andrew@...n.ch, vivien.didelot@...il.com, f.fainelli@...il.com,
        davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
        pabeni@...hat.com, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org, kernel test robot <lkp@...el.com>
Subject: Re: [PATCH] net: dsa: microchip: remove of_match_ptr() from
 ksz9477_dt_ids

On Wed, Jul 27, 2022 at 08:22:55AM +0530, Souptick Joarder wrote:
> From: "Souptick Joarder (HPE)" <jrdr.linux@...il.com>
>
> >> drivers/net/dsa/microchip/ksz9477_i2c.c:89:34:
> warning: 'ksz9477_dt_ids' defined but not used [-Wunused-const-variable=]
>       89 | static const struct of_device_id ksz9477_dt_ids[] = {
>          |                                  ^~~~~~~~~~~~~~
>
> Removed of_match_ptr() from ksz9477_dt_ids.
>
> Reported-by: kernel test robot <lkp@...el.com>
> Signed-off-by: Souptick Joarder (HPE) <jrdr.linux@...il.com>
> ---

I have to say, this is a major fail for what of_match_ptr() intended to do.

commit 3a1e362e3f3cd571b3974b8d44b8e358ec7a098c
Author: Ben Dooks <ben-linux@...ff.org>
Date:   Wed Aug 3 10:11:42 2011 +0100

    OF: Add of_match_ptr() macro

    Add a macro of_match_ptr() that allows the .of_match_table
    entry in the driver structures to be assigned without having
    an #ifdef xxx NULL for the case that OF is not enabled

    Signed-off-by: Ben Dooks <ben-linux@...ff.org>
    Signed-off-by: Grant Likely <grant.likely@...retlab.ca>

Should we also depend on CONFIG_OF?

>  drivers/net/dsa/microchip/ksz9477_i2c.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/dsa/microchip/ksz9477_i2c.c b/drivers/net/dsa/microchip/ksz9477_i2c.c
> index 99966514d444..c967a03a22c6 100644
> --- a/drivers/net/dsa/microchip/ksz9477_i2c.c
> +++ b/drivers/net/dsa/microchip/ksz9477_i2c.c
> @@ -118,7 +118,7 @@ MODULE_DEVICE_TABLE(of, ksz9477_dt_ids);
>  static struct i2c_driver ksz9477_i2c_driver = {
>  	.driver = {
>  		.name	= "ksz9477-switch",
> -		.of_match_table = of_match_ptr(ksz9477_dt_ids),
> +		.of_match_table = ksz9477_dt_ids,
>  	},
>  	.probe	= ksz9477_i2c_probe,
>  	.remove	= ksz9477_i2c_remove,
> --
> 2.25.1
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ