提交 57a59b9e 编写于 作者: M Marc Kleine-Budde

can: dev: sort can_fill_info() by IFLA_CAN_*

This patch sorts the call to nla_put() by IFLA_CAN_*.
Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
上级 c13c64d8
...@@ -726,23 +726,20 @@ static int can_fill_info(struct sk_buff *skb, const struct net_device *dev) ...@@ -726,23 +726,20 @@ static int can_fill_info(struct sk_buff *skb, const struct net_device *dev)
if (priv->do_get_state) if (priv->do_get_state)
priv->do_get_state(dev, &state); priv->do_get_state(dev, &state);
if (nla_put_u32(skb, IFLA_CAN_STATE, state) || if (nla_put(skb, IFLA_CAN_BITTIMING,
nla_put(skb, IFLA_CAN_CTRLMODE, sizeof(cm), &cm) ||
nla_put_u32(skb, IFLA_CAN_RESTART_MS, priv->restart_ms) ||
nla_put(skb, IFLA_CAN_BITTIMING,
sizeof(priv->bittiming), &priv->bittiming) || sizeof(priv->bittiming), &priv->bittiming) ||
(priv->bittiming_const &&
nla_put(skb, IFLA_CAN_BITTIMING_CONST,
sizeof(*priv->bittiming_const), priv->bittiming_const)) ||
nla_put(skb, IFLA_CAN_CLOCK, sizeof(cm), &priv->clock) || nla_put(skb, IFLA_CAN_CLOCK, sizeof(cm), &priv->clock) ||
nla_put_u32(skb, IFLA_CAN_STATE, state) ||
nla_put(skb, IFLA_CAN_CTRLMODE, sizeof(cm), &cm) ||
nla_put_u32(skb, IFLA_CAN_RESTART_MS, priv->restart_ms) ||
(priv->do_get_berr_counter && (priv->do_get_berr_counter &&
!priv->do_get_berr_counter(dev, &bec) && !priv->do_get_berr_counter(dev, &bec) &&
nla_put(skb, IFLA_CAN_BERR_COUNTER, sizeof(bec), &bec)) || nla_put(skb, IFLA_CAN_BERR_COUNTER, sizeof(bec), &bec)))
(priv->bittiming_const && return -EMSGSIZE;
nla_put(skb, IFLA_CAN_BITTIMING_CONST,
sizeof(*priv->bittiming_const), priv->bittiming_const)))
goto nla_put_failure;
return 0; return 0;
nla_put_failure:
return -EMSGSIZE;
} }
static size_t can_get_xstats_size(const struct net_device *dev) static size_t can_get_xstats_size(const struct net_device *dev)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册