* [PATCH] net: dsa: microchip: remove of_match_ptr() from ksz9477_dt_ids
@ 2022-07-27 2:52 Souptick Joarder
2022-07-28 0:16 ` Vladimir Oltean
2022-07-28 13:15 ` Paolo Abeni
0 siblings, 2 replies; 6+ messages in thread
From: Souptick Joarder @ 2022-07-27 2:52 UTC (permalink / raw)
To: woojung.huh, UNGLinuxDriver, andrew, vivien.didelot, f.fainelli,
olteanv, davem, edumazet, kuba, pabeni
Cc: netdev, linux-kernel, Souptick Joarder (HPE), kernel test robot
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>
---
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
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] net: dsa: microchip: remove of_match_ptr() from ksz9477_dt_ids
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
2022-07-28 0:46 ` Souptick Joarder
2022-07-28 13:15 ` Paolo Abeni
1 sibling, 1 reply; 6+ messages in thread
From: Vladimir Oltean @ 2022-07-28 0:16 UTC (permalink / raw)
To: Souptick Joarder
Cc: woojung.huh, UNGLinuxDriver, andrew, vivien.didelot, f.fainelli,
davem, edumazet, kuba, pabeni, netdev, linux-kernel,
kernel test robot
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
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] net: dsa: microchip: remove of_match_ptr() from ksz9477_dt_ids
2022-07-28 0:16 ` Vladimir Oltean
@ 2022-07-28 0:46 ` Souptick Joarder
2022-07-28 0:55 ` Vladimir Oltean
0 siblings, 1 reply; 6+ messages in thread
From: Souptick Joarder @ 2022-07-28 0:46 UTC (permalink / raw)
To: Vladimir Oltean
Cc: woojung.huh, UNGLinuxDriver, Andrew Lunn, vivien.didelot,
Florian Fainelli, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, netdev, linux-kernel, kernel test robot
On Thu, Jul 28, 2022 at 5:46 AM Vladimir Oltean <olteanv@gmail.com> wrote:
>
> 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?
Few other drivers threw similar warnings and the suggestion was to
remove of_match_ptr(). Anyway both approaches look fine.
>
> > 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
> >
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] net: dsa: microchip: remove of_match_ptr() from ksz9477_dt_ids
2022-07-28 0:46 ` Souptick Joarder
@ 2022-07-28 0:55 ` Vladimir Oltean
0 siblings, 0 replies; 6+ messages in thread
From: Vladimir Oltean @ 2022-07-28 0:55 UTC (permalink / raw)
To: Souptick Joarder
Cc: woojung.huh, UNGLinuxDriver, Andrew Lunn, vivien.didelot,
Florian Fainelli, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, netdev, linux-kernel, kernel test robot
On Thu, Jul 28, 2022 at 06:16:50AM +0530, Souptick Joarder wrote:
> Few other drivers threw similar warnings and the suggestion was to
> remove of_match_ptr(). Anyway both approaches look fine.
I don't disagree with this change, I'm just saying that as a next step
we may block this driver from even being compiled if CONFIG_OF=n.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] net: dsa: microchip: remove of_match_ptr() from ksz9477_dt_ids
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
@ 2022-07-28 13:15 ` Paolo Abeni
2022-07-30 1:38 ` Souptick Joarder
1 sibling, 1 reply; 6+ messages in thread
From: Paolo Abeni @ 2022-07-28 13:15 UTC (permalink / raw)
To: Souptick Joarder, woojung.huh, UNGLinuxDriver, andrew,
vivien.didelot, f.fainelli, olteanv, davem, edumazet, kuba
Cc: netdev, linux-kernel, kernel test robot
On Wed, 2022-07-27 at 08:22 +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>
As this looks like a fix, could you please post a new revision of the
patch including into the commit message a proper 'Fixes' tag?
Thanks!
Paolo
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] net: dsa: microchip: remove of_match_ptr() from ksz9477_dt_ids
2022-07-28 13:15 ` Paolo Abeni
@ 2022-07-30 1:38 ` Souptick Joarder
0 siblings, 0 replies; 6+ messages in thread
From: Souptick Joarder @ 2022-07-30 1:38 UTC (permalink / raw)
To: Paolo Abeni
Cc: woojung.huh, UNGLinuxDriver, Andrew Lunn, vivien.didelot,
Florian Fainelli, Vladimir Oltean, David S. Miller, Eric Dumazet,
Jakub Kicinski, netdev, linux-kernel, kernel test robot
On Thu, Jul 28, 2022 at 6:45 PM Paolo Abeni <pabeni@redhat.com> wrote:
>
> On Wed, 2022-07-27 at 08:22 +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>
>
> As this looks like a fix, could you please post a new revision of the
> patch including into the commit message a proper 'Fixes' tag?
Sure.
>
> Thanks!
>
> Paolo
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-07-30 1:41 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).