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

Subsystems: networking [general], switchdev, the rest

STALE3702d

4 messages, 4 authors, 2016-09-02 · open the first message on its own page

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

From: Rami Rosen <hidden>
Date: 2016-09-02 11:12:04

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 <redacted>
---
 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,
-- 
2.5.5

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

From: Roopa Prabhu <hidden>
Date: 2016-09-02 13:11:40

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 <redacted>
---
Acked-by: Roopa Prabhu <redacted>

Thanks Rami.
quoted hunk
 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,

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

From: Eric Dumazet <hidden>
Date: 2016-09-02 13:48:04

On Fri, 2016-09-02 at 14:11 +0300, Rami Rosen wrote:
quoted hunk
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 <redacted>
---
 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 <redacted>

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

From: David Miller <davem@davemloft.net>
Date: 2016-09-02 18:00:43

From: Rami Rosen <redacted>
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 <redacted>
Applied, thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help