tipc: correct return value of link_cmd_set_value routine
authorYing Xue <ying.xue@windriver.com>
Fri, 18 Oct 2013 05:23:20 +0000 (07:23 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 18 Oct 2013 17:20:43 +0000 (13:20 -0400)
commit636c0371a737c27510df867161fb8100c2f086bd
tree8112f958eeab13d16c07212ddb8bf6e264d47777
parent679815834857d5305dae108a03addccf16d86868
tipc: correct return value of link_cmd_set_value routine

link_cmd_set_value() takes commands for link, bearer and media related
configuration. Genereally the function returns 0 when a command is
recognized, and -EINVAL when it is not. However, in the switch for link
related commands it returns 0 even when the command is unrecognized. This
will sometimes make it look as if a failed configuration command has been
successful, but has otherwise no negative effects.

We remove this anomaly by returning -EINVAL even for link commands. We also
rework all three switches to make them  conforming to common kernel coding
style.

Signed-off-by: Ying Xue <ying.xue@windriver.com>
Reviewed-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/link.c