diff options
author | Marc Kleine-Budde <mkl@pengutronix.de> | 2013-10-05 14:34:47 -0400 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2013-10-31 15:55:13 -0400 |
commit | c13c64d8d7c0b6457aeb9aed8647714a50786c62 (patch) | |
tree | 823f5e2b47d3652c524dd812f45c76c3a7ad1871 /drivers/net/can | |
parent | 51b2f451b50faa63fa5b32f4b7309878be235095 (diff) |
can: dev: sort can_get_size() by IFLA_CAN_*
This patch sorts the individual addends of the sum by IFLA_CAN_*.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/can')
-rw-r--r-- | drivers/net/can/dev.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c index 1870c4731a57..19ebab085156 100644 --- a/drivers/net/can/dev.c +++ b/drivers/net/can/dev.c | |||
@@ -702,17 +702,17 @@ static int can_changelink(struct net_device *dev, | |||
702 | static size_t can_get_size(const struct net_device *dev) | 702 | static size_t can_get_size(const struct net_device *dev) |
703 | { | 703 | { |
704 | struct can_priv *priv = netdev_priv(dev); | 704 | struct can_priv *priv = netdev_priv(dev); |
705 | size_t size; | 705 | size_t size = 0; |
706 | 706 | ||
707 | size = nla_total_size(sizeof(u32)); /* IFLA_CAN_STATE */ | 707 | size += nla_total_size(sizeof(struct can_bittiming)); /* IFLA_CAN_BITTIMING */ |
708 | size += nla_total_size(sizeof(struct can_ctrlmode)); /* IFLA_CAN_CTRLMODE */ | 708 | if (priv->bittiming_const) /* IFLA_CAN_BITTIMING_CONST */ |
709 | size += nla_total_size(sizeof(u32)); /* IFLA_CAN_RESTART_MS */ | ||
710 | size += nla_total_size(sizeof(struct can_bittiming)); /* IFLA_CAN_BITTIMING */ | ||
711 | size += nla_total_size(sizeof(struct can_clock)); /* IFLA_CAN_CLOCK */ | ||
712 | if (priv->do_get_berr_counter) /* IFLA_CAN_BERR_COUNTER */ | ||
713 | size += nla_total_size(sizeof(struct can_berr_counter)); | ||
714 | if (priv->bittiming_const) /* IFLA_CAN_BITTIMING_CONST */ | ||
715 | size += nla_total_size(sizeof(struct can_bittiming_const)); | 709 | size += nla_total_size(sizeof(struct can_bittiming_const)); |
710 | size += nla_total_size(sizeof(struct can_clock)); /* IFLA_CAN_CLOCK */ | ||
711 | size += nla_total_size(sizeof(u32)); /* IFLA_CAN_STATE */ | ||
712 | size += nla_total_size(sizeof(struct can_ctrlmode)); /* IFLA_CAN_CTRLMODE */ | ||
713 | size += nla_total_size(sizeof(u32)); /* IFLA_CAN_RESTART_MS */ | ||
714 | if (priv->do_get_berr_counter) /* IFLA_CAN_BERR_COUNTER */ | ||
715 | size += nla_total_size(sizeof(struct can_berr_counter)); | ||
716 | 716 | ||
717 | return size; | 717 | return size; |
718 | } | 718 | } |