Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c13c64d8 authored by Marc Kleine-Budde's avatar Marc Kleine-Budde
Browse files

can: dev: sort can_get_size() by IFLA_CAN_*



This patch sorts the individual addends of the sum by IFLA_CAN_*.

Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent 51b2f451
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -702,17 +702,17 @@ static int can_changelink(struct net_device *dev,
static size_t can_get_size(const struct net_device *dev)
{
	struct can_priv *priv = netdev_priv(dev);
	size_t size;
	size_t size = 0;

	size = nla_total_size(sizeof(u32));   /* IFLA_CAN_STATE */
	size += nla_total_size(sizeof(struct can_ctrlmode));  /* IFLA_CAN_CTRLMODE */
	size += nla_total_size(sizeof(u32));  /* IFLA_CAN_RESTART_MS */
	size += nla_total_size(sizeof(struct can_bittiming));	/* IFLA_CAN_BITTIMING */
	if (priv->bittiming_const)				/* IFLA_CAN_BITTIMING_CONST */
		size += nla_total_size(sizeof(struct can_bittiming_const));
	size += nla_total_size(sizeof(struct can_clock));	/* IFLA_CAN_CLOCK */
	size += nla_total_size(sizeof(u32));			/* IFLA_CAN_STATE */
	size += nla_total_size(sizeof(struct can_ctrlmode));	/* IFLA_CAN_CTRLMODE */
	size += nla_total_size(sizeof(u32));			/* IFLA_CAN_RESTART_MS */
	if (priv->do_get_berr_counter)				/* IFLA_CAN_BERR_COUNTER */
		size += nla_total_size(sizeof(struct can_berr_counter));
	if (priv->bittiming_const)	      /* IFLA_CAN_BITTIMING_CONST */
		size += nla_total_size(sizeof(struct can_bittiming_const));

	return size;
}