public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Oltean <olteanv@gmail.com>
To: Souptick Joarder <jrdr.linux@gmail.com>
Cc: woojung.huh@microchip.com, UNGLinuxDriver@microchip.com,
	andrew@lunn.ch, vivien.didelot@gmail.com, f.fainelli@gmail.com,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, kernel test robot <lkp@intel.com>
Subject: Re: [PATCH] net: dsa: microchip: remove of_match_ptr() from ksz9477_dt_ids
Date: Thu, 28 Jul 2022 03:16:48 +0300	[thread overview]
Message-ID: <20220728001648.cwfcmcg75lpqip5v@skbuf> (raw)
In-Reply-To: <20220727025255.61232-1-jrdr.linux@gmail.com>

On Wed, Jul 27, 2022 at 08:22:55AM +0530, Souptick Joarder wrote:
> From: "Souptick Joarder (HPE)" <jrdr.linux@gmail.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@intel.com>
> Signed-off-by: Souptick Joarder (HPE) <jrdr.linux@gmail.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@fluff.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@fluff.org>
    Signed-off-by: Grant Likely <grant.likely@secretlab.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
>

  reply	other threads:[~2022-07-28  0:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-27  2:52 [PATCH] net: dsa: microchip: remove of_match_ptr() from ksz9477_dt_ids Souptick Joarder
2022-07-28  0:16 ` Vladimir Oltean [this message]
2022-07-28  0:46   ` Souptick Joarder
2022-07-28  0:55     ` Vladimir Oltean
2022-07-28 13:15 ` Paolo Abeni
2022-07-30  1:38   ` Souptick Joarder

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=20220728001648.cwfcmcg75lpqip5v@skbuf \
    --to=olteanv@gmail.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=jrdr.linux@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=vivien.didelot@gmail.com \
    --cc=woojung.huh@microchip.com \
    /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