Skip to contentSkip to conversation

nexthop: fix enum type confusion

PATCH In review Arnd Bergmann 2 participants 2 messages May 27, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nexthop: fix enum type confusion

Clang points out a mismatch between function arguments using a different enum type:

net/ipv4/nexthop.c:841:30: error: implicit conversion from enumeration type 'enum nexthop_event_type' to different enumeration type 'enum fib_event_type' [-Werror,-Wenum-conversion]

        call_nexthop_notifiers(net, NEXTHOP_EVENT_DEL, nh);
        ~~~~~~~~~~~~~~~~~~~~~~      ^~~~~~~~~~~~~~~~~

This looks like a copy-paste error, so just use the intended type instead.

Fixes 8590ceedb701 ("nexthop: add support for notifiers")
---
 net/ipv4/nexthop.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/nexthop.c +1 -1
index 143011f9b580..ec1282858cb7 100644
@@ -37,7 +37,7 @@ static const struct nla_policy rtm_nh_policy[NHA_MAX + 1] = {
 };
 
 static int call_nexthop_notifiers(struct net *net,
-				  enum fib_event_type event_type,
+				  enum nexthop_event_type event_type,
 				  struct nexthop *nh)
 {
 	int err;
Signature · 1 line
2.26.2
#1 lore raw
Quoted 7 lines · Arnd Bergmann

Clang points out a mismatch between function arguments using a different enum type:

net/ipv4/nexthop.c:841:30: error: implicit conversion from enumeration type 'enum nexthop_event_type' to different enumeration type 'enum fib_event_type' [-Werror,-Wenum-conversion]

        call_nexthop_notifiers(net, NEXTHOP_EVENT_DEL, nh);
        ~~~~~~~~~~~~~~~~~~~~~~      ^~~~~~~~~~~~~~~~~
Quoted 9 lines

This looks like a copy-paste error, so just use the intended type instead.

Fixes 8590ceedb701 ("nexthop: add support for notifiers")
---
 net/ipv4/nexthop.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Nate sent a fix a few hours ago:
https://lore.kernel.org/netdev/[email protected]/T/#u