Skip to contentSkip to conversation

switchdev: Fix return value of switchdev_port_fdb_dump().

PATCH Applied Rami Rosen 4 participants 4 messages Sep 2, 2016

Subsystems (3)
lore
Share & tools
lore

Rami Rosen

author
#0 lore raw

PATCH 1/1 switchdev: Fix return value of switchdev_port_fdb_dump().

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").

---
 include/net/switchdev.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/net/switchdev.h +1 -1
index 6279f2f..729fe15 100644
@@ -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,
Signature · 1 line
2.5.5
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Rami Rosen

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").

---

Thanks Rami.

Quoted 16 lines
 include/net/switchdev.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/net/switchdev.h +1 -1
index 6279f2f..729fe15 100644
@@ -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 lore raw
In reply to Rami Rosen
Quoted 17 lines · Rami Rosen

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").

---
 include/net/switchdev.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/net/switchdev.h +0 -0
index 6279f2f..729fe15 100644

include/net/switchdev.h static inline int switchdev_port_fdb_dump(struct sk_buff *skb, · line 350

Quoted 8 lines
include/net/switchdev.h +1 -1
@@ -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 !

maintainer Applied
#3 lore raw
In reply to Rami Rosen

From: Rami Rosen <[email protected]>
Date: Fri, 2 Sep 2016 14:11:57 +0300

Quoted 8 lines

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").

Applied, thanks.