Skip to contentSkip to conversation

devlink: clean up a condition

PATCH In review Dan Carpenter 2 participants 2 messages Jun 16, 2016

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

PATCH 1/1 devlink: clean up a condition

Presumably having a _get() function implies that we also have a _set() function but lets make it match when we're calling.

net/core/devlink.c +1 -1
index a4f88cb..b2e592a 100644
@@ -1461,7 +1461,7 @@ static int devlink_nl_cmd_eswitch_mode_set_doit(struct sk_buff *skb,
 
 	mode = nla_get_u16(info->attrs[DEVLINK_ATTR_ESWITCH_MODE]);
 
-	if (ops && ops->eswitch_mode_get)
+	if (ops && ops->eswitch_mode_set)
 		return ops->eswitch_mode_set(devlink, mode);
 	return -EOPNOTSUPP;
 }
#1 lore raw
Quoted 10 lines · Dan Carpenter

Presumably having a _get() function implies that we also have a _set() function but lets make it match when we're calling.

net/core/devlink.c +0 -0
index a4f88cb..b2e592a 100644

net/core/devlink.c static int devlink_nl_cmd_eswitch_mode_set_doit(struct sk_buff *skb, · line 1467

Quoted 8 lines
net/core/devlink.c +1 -1
@@ -1461,7 +1461,7 @@ static int devlink_nl_cmd_eswitch_mode_set_doit(struct sk_buff *skb,
 
  	mode = nla_get_u16(info->attrs[DEVLINK_ATTR_ESWITCH_MODE]);
 
-	if (ops && ops->eswitch_mode_get)
+	if (ops && ops->eswitch_mode_set)
  		return ops->eswitch_mode_set(devlink, mode);
  	return -EOPNOTSUPP;
  }

good catch Dan, we will incorporate that into the patch set