diff mbox series

linux-next: build failure after merge of the net-next tree

Message ID 20200929130446.0c2630d2@canb.auug.org.au
State Not Applicable
Delegated to: David Miller
Headers show
Series linux-next: build failure after merge of the net-next tree | expand

Commit Message

Stephen Rothwell Sept. 29, 2020, 3:04 a.m. UTC
Hi all,

After merging the net-next tree, today's linux-next build (x86_64
allmodconfig) failed like this:

drivers/net/ethernet/marvell/prestera/prestera_main.c: In function 'prestera_port_dev_lower_find':
drivers/net/ethernet/marvell/prestera/prestera_main.c:504:33: error: passing argument 2 of 'netdev_walk_all_lower_dev' from incompatible pointer type [-Werror=incompatible-pointer-types]
  504 |  netdev_walk_all_lower_dev(dev, prestera_lower_dev_walk, &port);
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~
      |                                 |
      |                                 int (*)(struct net_device *, void *)
In file included from include/linux/etherdevice.h:21,
                 from drivers/net/ethernet/marvell/prestera/prestera_main.c:4:
include/linux/netdevice.h:4571:16: note: expected 'int (*)(struct net_device *, struct netdev_nested_priv *)' but argument is of type 'int (*)(struct net_device *, void *)'
 4571 |          int (*fn)(struct net_device *lower_dev,
      |          ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 4572 |      struct netdev_nested_priv *priv),
      |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/marvell/prestera/prestera_main.c:504:58: error: passing argument 3 of 'netdev_walk_all_lower_dev' from incompatible pointer type [-Werror=incompatible-pointer-types]
  504 |  netdev_walk_all_lower_dev(dev, prestera_lower_dev_walk, &port);
      |                                                          ^~~~~
      |                                                          |
      |                                                          struct prestera_port **
In file included from include/linux/etherdevice.h:21,
                 from drivers/net/ethernet/marvell/prestera/prestera_main.c:4:
include/linux/netdevice.h:4573:37: note: expected 'struct netdev_nested_priv *' but argument is of type 'struct prestera_port **'
 4573 |          struct netdev_nested_priv *priv);
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
cc1: some warnings being treated as errors

Caused by commit

  eff7423365a6 ("net: core: introduce struct netdev_nested_priv for nested interface infrastructure")

interacting with commit

  e1189d9a5fbe ("net: marvell: prestera: Add Switchdev driver implementation")

also in the net-next tree.

I applied the following fix patch.

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Tue, 29 Sep 2020 12:57:59 +1000
Subject: [PATCH] fix up for "net: core: introduce struct netdev_nested_priv for nested interface infrastructure"

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 drivers/net/ethernet/marvell/prestera/prestera_main.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

Comments

Stephen Rothwell Sept. 30, 2020, 10:09 p.m. UTC | #1
Hi all,

On Tue, 29 Sep 2020 13:04:46 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> After merging the net-next tree, today's linux-next build (x86_64
> allmodconfig) failed like this:
> 
> drivers/net/ethernet/marvell/prestera/prestera_main.c: In function 'prestera_port_dev_lower_find':
> drivers/net/ethernet/marvell/prestera/prestera_main.c:504:33: error: passing argument 2 of 'netdev_walk_all_lower_dev' from incompatible pointer type [-Werror=incompatible-pointer-types]
>   504 |  netdev_walk_all_lower_dev(dev, prestera_lower_dev_walk, &port);
>       |                                 ^~~~~~~~~~~~~~~~~~~~~~~
>       |                                 |
>       |                                 int (*)(struct net_device *, void *)
> In file included from include/linux/etherdevice.h:21,
>                  from drivers/net/ethernet/marvell/prestera/prestera_main.c:4:
> include/linux/netdevice.h:4571:16: note: expected 'int (*)(struct net_device *, struct netdev_nested_priv *)' but argument is of type 'int (*)(struct net_device *, void *)'
>  4571 |          int (*fn)(struct net_device *lower_dev,
>       |          ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>  4572 |      struct netdev_nested_priv *priv),
>       |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/net/ethernet/marvell/prestera/prestera_main.c:504:58: error: passing argument 3 of 'netdev_walk_all_lower_dev' from incompatible pointer type [-Werror=incompatible-pointer-types]
>   504 |  netdev_walk_all_lower_dev(dev, prestera_lower_dev_walk, &port);
>       |                                                          ^~~~~
>       |                                                          |
>       |                                                          struct prestera_port **
> In file included from include/linux/etherdevice.h:21,
>                  from drivers/net/ethernet/marvell/prestera/prestera_main.c:4:
> include/linux/netdevice.h:4573:37: note: expected 'struct netdev_nested_priv *' but argument is of type 'struct prestera_port **'
>  4573 |          struct netdev_nested_priv *priv);
>       |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
> cc1: some warnings being treated as errors
> 
> Caused by commit
> 
>   eff7423365a6 ("net: core: introduce struct netdev_nested_priv for nested interface infrastructure")
> 
> interacting with commit
> 
>   e1189d9a5fbe ("net: marvell: prestera: Add Switchdev driver implementation")
> 
> also in the net-next tree.
> 
> I applied the following fix patch.
> 
> From: Stephen Rothwell <sfr@canb.auug.org.au>
> Date: Tue, 29 Sep 2020 12:57:59 +1000
> Subject: [PATCH] fix up for "net: core: introduce struct netdev_nested_priv for nested interface infrastructure"
> 
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
>  drivers/net/ethernet/marvell/prestera/prestera_main.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/marvell/prestera/prestera_main.c b/drivers/net/ethernet/marvell/prestera/prestera_main.c
> index 9bd57b89d1d0..633d8770be35 100644
> --- a/drivers/net/ethernet/marvell/prestera/prestera_main.c
> +++ b/drivers/net/ethernet/marvell/prestera/prestera_main.c
> @@ -482,9 +482,10 @@ bool prestera_netdev_check(const struct net_device *dev)
>  	return dev->netdev_ops == &prestera_netdev_ops;
>  }
>  
> -static int prestera_lower_dev_walk(struct net_device *dev, void *data)
> +static int prestera_lower_dev_walk(struct net_device *dev,
> +				   struct netdev_nested_priv *priv)
>  {
> -	struct prestera_port **pport = data;
> +	struct prestera_port **pport = (struct prestera_port **)priv->data;
>  
>  	if (prestera_netdev_check(dev)) {
>  		*pport = netdev_priv(dev);
> @@ -497,11 +498,13 @@ static int prestera_lower_dev_walk(struct net_device *dev, void *data)
>  struct prestera_port *prestera_port_dev_lower_find(struct net_device *dev)
>  {
>  	struct prestera_port *port = NULL;
> +	struct netdev_nested_priv priv;
>  
>  	if (prestera_netdev_check(dev))
>  		return netdev_priv(dev);
>  
> -	netdev_walk_all_lower_dev(dev, prestera_lower_dev_walk, &port);
> +	priv.data = (void *)&port;
> +	netdev_walk_all_lower_dev(dev, prestera_lower_dev_walk, &priv);
>  
>  	return port;
>  }

I am still getting this build failure ...
Vadym Kochan Sept. 30, 2020, 11:06 p.m. UTC | #2
Hi Stephen,

On Thu, Oct 01, 2020 at 08:09:16AM +1000, Stephen Rothwell wrote:
> Hi all,
> 
[CUT]
> 
> I am still getting this build failure ...
> 
> -- 

I just 've checked linux-next/master and it builds fine at least with my custom
config, do/how I need to handle this case ?

I see the changes you applied already in linux-next/master.

> Cheers,
> Stephen Rothwell
Stephen Rothwell Sept. 30, 2020, 11:19 p.m. UTC | #3
Hi Vadym,

On Thu, 1 Oct 2020 02:06:05 +0300 Vadym Kochan <vadym.kochan@plvision.eu> wrote:
>
> On Thu, Oct 01, 2020 at 08:09:16AM +1000, Stephen Rothwell wrote:
> > Hi all,
> >   
> [CUT]
> > 
> > I am still getting this build failure ...
> > 
> > --   
> 
> I just 've checked linux-next/master and it builds fine at least with my custom
> config, do/how I need to handle this case ?

If you take the net-next tree alone and do an x86_64 allmodconfig
build, it currently fails, right?

> I see the changes you applied already in linux-next/master.

Linux-next builds fine because it contains the fix patch I posted (I
added it to the net-next merge).  It needs to be explicitly fixed in the
net-next tree either using my patch or something more correct (if
necessary).
David Miller Oct. 2, 2020, 1:40 a.m. UTC | #4
From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Tue, 29 Sep 2020 13:04:46 +1000

> Caused by commit
> 
>   eff7423365a6 ("net: core: introduce struct netdev_nested_priv for nested interface infrastructure")
> 
> interacting with commit
> 
>   e1189d9a5fbe ("net: marvell: prestera: Add Switchdev driver implementation")
> 
> also in the net-next tree.

I would argue against that "also" as the first commit is only in the
'net' tree right now. :-)

This is simply something I'll have to resolve the next time net is merged
into net-next.

Thanks.
Stephen Rothwell Oct. 2, 2020, 2 a.m. UTC | #5
Hi Dave,

On Thu, 01 Oct 2020 18:40:13 -0700 (PDT) David Miller <davem@davemloft.net> wrote:
>
> From: Stephen Rothwell <sfr@canb.auug.org.au>
> Date: Tue, 29 Sep 2020 13:04:46 +1000
> 
> > Caused by commit
> > 
> >   eff7423365a6 ("net: core: introduce struct netdev_nested_priv for nested interface infrastructure")
> > 
> > interacting with commit
> > 
> >   e1189d9a5fbe ("net: marvell: prestera: Add Switchdev driver implementation")
> > 
> > also in the net-next tree.  
> 
> I would argue against that "also" as the first commit is only in the
> 'net' tree right now. :-)

Sorry, my mistake.  I was wondering why your testing did not seem to be
affected.

> This is simply something I'll have to resolve the next time net is merged
> into net-next.

Absolutely, no problem.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/marvell/prestera/prestera_main.c b/drivers/net/ethernet/marvell/prestera/prestera_main.c
index 9bd57b89d1d0..633d8770be35 100644
--- a/drivers/net/ethernet/marvell/prestera/prestera_main.c
+++ b/drivers/net/ethernet/marvell/prestera/prestera_main.c
@@ -482,9 +482,10 @@  bool prestera_netdev_check(const struct net_device *dev)
 	return dev->netdev_ops == &prestera_netdev_ops;
 }
 
-static int prestera_lower_dev_walk(struct net_device *dev, void *data)
+static int prestera_lower_dev_walk(struct net_device *dev,
+				   struct netdev_nested_priv *priv)
 {
-	struct prestera_port **pport = data;
+	struct prestera_port **pport = (struct prestera_port **)priv->data;
 
 	if (prestera_netdev_check(dev)) {
 		*pport = netdev_priv(dev);
@@ -497,11 +498,13 @@  static int prestera_lower_dev_walk(struct net_device *dev, void *data)
 struct prestera_port *prestera_port_dev_lower_find(struct net_device *dev)
 {
 	struct prestera_port *port = NULL;
+	struct netdev_nested_priv priv;
 
 	if (prestera_netdev_check(dev))
 		return netdev_priv(dev);
 
-	netdev_walk_all_lower_dev(dev, prestera_lower_dev_walk, &port);
+	priv.data = (void *)&port;
+	netdev_walk_all_lower_dev(dev, prestera_lower_dev_walk, &priv);
 
 	return port;
 }