diff mbox

[net-next] switchdev: Fix return value of switchdev_port_fdb_dump().

Message ID 1472814717-11339-1-git-send-email-rami.rosen@intel.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Rami Rosen Sept. 2, 2016, 11:11 a.m. UTC
This patch fixes the retun value of switchdev_port_fdb_dump() when
CONFIG_NET_SWITCHDEV is not set. This avoids getting "warning: return makes
integer from pointer without a cast [-Wint-conversion]" when building
when CONFIG_NET_SWITCHDEV is not set under several compiler versions.
This warning is due to commit d297653dd6f07afbe7e6c702a4bcd7615680002e
("rtnetlink: fdb dump: optimize by saving last interface markers").

Signed-off-by: Rami Rosen <rami.rosen@intel.com>
---
 include/net/switchdev.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Roopa Prabhu Sept. 2, 2016, 1:11 p.m. UTC | #1
On 9/2/16, 4:11 AM, Rami Rosen wrote:
> This patch fixes the retun value of switchdev_port_fdb_dump() when
> CONFIG_NET_SWITCHDEV is not set. This avoids getting "warning: return makes
> integer from pointer without a cast [-Wint-conversion]" when building
> when CONFIG_NET_SWITCHDEV is not set under several compiler versions.
> This warning is due to commit d297653dd6f07afbe7e6c702a4bcd7615680002e
> ("rtnetlink: fdb dump: optimize by saving last interface markers").
>
> Signed-off-by: Rami Rosen <rami.rosen@intel.com>
> ---

Acked-by: Roopa Prabhu <roopa@cumulusnetworks.com>

Thanks Rami.
>  include/net/switchdev.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/net/switchdev.h b/include/net/switchdev.h
> index 6279f2f..729fe15 100644
> --- a/include/net/switchdev.h
> +++ b/include/net/switchdev.h
> @@ -344,7 +344,7 @@ static inline int switchdev_port_fdb_dump(struct sk_buff *skb,
>  					  struct net_device *filter_dev,
>  					  int *idx)
>  {
> -       return idx;
> +       return *idx;
>  }
>  
>  static inline bool switchdev_port_same_parent_id(struct net_device *a,
Eric Dumazet Sept. 2, 2016, 1:48 p.m. UTC | #2
On Fri, 2016-09-02 at 14:11 +0300, Rami Rosen wrote:
> This patch fixes the retun value of switchdev_port_fdb_dump() when
> CONFIG_NET_SWITCHDEV is not set. This avoids getting "warning: return makes
> integer from pointer without a cast [-Wint-conversion]" when building
> when CONFIG_NET_SWITCHDEV is not set under several compiler versions.
> This warning is due to commit d297653dd6f07afbe7e6c702a4bcd7615680002e
> ("rtnetlink: fdb dump: optimize by saving last interface markers").
> 
> Signed-off-by: Rami Rosen <rami.rosen@intel.com>
> ---
>  include/net/switchdev.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/net/switchdev.h b/include/net/switchdev.h
> index 6279f2f..729fe15 100644
> --- a/include/net/switchdev.h
> +++ b/include/net/switchdev.h
> @@ -344,7 +344,7 @@ static inline int switchdev_port_fdb_dump(struct sk_buff *skb,
>  					  struct net_device *filter_dev,
>  					  int *idx)
>  {
> -       return idx;
> +       return *idx;
>  }
>  
>  static inline bool switchdev_port_same_parent_id(struct net_device *a,


Thanks a lot Rami !

Reported-by: Eric Dumazet <edumazet@google.com>
David Miller Sept. 2, 2016, 6 p.m. UTC | #3
From: Rami Rosen <rami.rosen@intel.com>
Date: Fri,  2 Sep 2016 14:11:57 +0300

> This patch fixes the retun value of switchdev_port_fdb_dump() when
> CONFIG_NET_SWITCHDEV is not set. This avoids getting "warning: return makes
> integer from pointer without a cast [-Wint-conversion]" when building
> when CONFIG_NET_SWITCHDEV is not set under several compiler versions.
> This warning is due to commit d297653dd6f07afbe7e6c702a4bcd7615680002e
> ("rtnetlink: fdb dump: optimize by saving last interface markers").
> 
> Signed-off-by: Rami Rosen <rami.rosen@intel.com>

Applied, thanks.
diff mbox

Patch

diff --git a/include/net/switchdev.h b/include/net/switchdev.h
index 6279f2f..729fe15 100644
--- a/include/net/switchdev.h
+++ b/include/net/switchdev.h
@@ -344,7 +344,7 @@  static inline int switchdev_port_fdb_dump(struct sk_buff *skb,
 					  struct net_device *filter_dev,
 					  int *idx)
 {
-       return idx;
+       return *idx;
 }
 
 static inline bool switchdev_port_same_parent_id(struct net_device *a,