diff options
author | Marc Kleine-Budde <mkl@pengutronix.de> | 2013-10-04 07:35:57 -0400 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2013-10-31 15:55:14 -0400 |
commit | 57a59b9ef58f3422f9d9f2cf7631da1727686991 (patch) | |
tree | 53548507ae9211f7a542ab39b98a3f8ea5b11b3f /drivers/net/can/dev.c | |
parent | c13c64d8d7c0b6457aeb9aed8647714a50786c62 (diff) |
can: dev: sort can_fill_info() by IFLA_CAN_*
This patch sorts the call to nla_put() by IFLA_CAN_*.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/can/dev.c')
-rw-r--r-- | drivers/net/can/dev.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c index 19ebab085156..8d6f7212ae22 100644 --- a/drivers/net/can/dev.c +++ b/drivers/net/can/dev.c | |||
@@ -726,23 +726,20 @@ static int can_fill_info(struct sk_buff *skb, const struct net_device *dev) | |||
726 | 726 | ||
727 | if (priv->do_get_state) | 727 | if (priv->do_get_state) |
728 | priv->do_get_state(dev, &state); | 728 | priv->do_get_state(dev, &state); |
729 | if (nla_put_u32(skb, IFLA_CAN_STATE, state) || | 729 | if (nla_put(skb, IFLA_CAN_BITTIMING, |
730 | nla_put(skb, IFLA_CAN_CTRLMODE, sizeof(cm), &cm) || | ||
731 | nla_put_u32(skb, IFLA_CAN_RESTART_MS, priv->restart_ms) || | ||
732 | nla_put(skb, IFLA_CAN_BITTIMING, | ||
733 | sizeof(priv->bittiming), &priv->bittiming) || | 730 | sizeof(priv->bittiming), &priv->bittiming) || |
731 | (priv->bittiming_const && | ||
732 | nla_put(skb, IFLA_CAN_BITTIMING_CONST, | ||
733 | sizeof(*priv->bittiming_const), priv->bittiming_const)) || | ||
734 | nla_put(skb, IFLA_CAN_CLOCK, sizeof(cm), &priv->clock) || | 734 | nla_put(skb, IFLA_CAN_CLOCK, sizeof(cm), &priv->clock) || |
735 | nla_put_u32(skb, IFLA_CAN_STATE, state) || | ||
736 | nla_put(skb, IFLA_CAN_CTRLMODE, sizeof(cm), &cm) || | ||
737 | nla_put_u32(skb, IFLA_CAN_RESTART_MS, priv->restart_ms) || | ||
735 | (priv->do_get_berr_counter && | 738 | (priv->do_get_berr_counter && |
736 | !priv->do_get_berr_counter(dev, &bec) && | 739 | !priv->do_get_berr_counter(dev, &bec) && |
737 | nla_put(skb, IFLA_CAN_BERR_COUNTER, sizeof(bec), &bec)) || | 740 | nla_put(skb, IFLA_CAN_BERR_COUNTER, sizeof(bec), &bec))) |
738 | (priv->bittiming_const && | 741 | return -EMSGSIZE; |
739 | nla_put(skb, IFLA_CAN_BITTIMING_CONST, | ||
740 | sizeof(*priv->bittiming_const), priv->bittiming_const))) | ||
741 | goto nla_put_failure; | ||
742 | return 0; | 742 | return 0; |
743 | |||
744 | nla_put_failure: | ||
745 | return -EMSGSIZE; | ||
746 | } | 743 | } |
747 | 744 | ||
748 | static size_t can_get_xstats_size(const struct net_device *dev) | 745 | static size_t can_get_xstats_size(const struct net_device *dev) |