can: slcan: Replace sizeof struct can_frame with CAN_MTU
authorMarek Vasut <marex@denx.de>
Thu, 9 Jun 2016 19:21:00 +0000 (21:21 +0200)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Fri, 17 Jun 2016 13:39:42 +0000 (15:39 +0200)
Use CAN_MTU macro instead of sizeof(struct can_frame) just like the
other drivers do.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Oliver Hartkopp <socketcan@hartkopp.net>
Cc: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/slcan.c

index 9a3f15cb7ef4883abebe6bac8ffc5909077d475f..eb7173713bbcb0c339ae6ccbf99fc8014fb17133 100644 (file)
@@ -354,7 +354,7 @@ static netdev_tx_t slc_xmit(struct sk_buff *skb, struct net_device *dev)
 {
        struct slcan *sl = netdev_priv(dev);
 
-       if (skb->len != sizeof(struct can_frame))
+       if (skb->len != CAN_MTU)
                goto out;
 
        spin_lock(&sl->lock);
@@ -442,7 +442,7 @@ static void slc_setup(struct net_device *dev)
        dev->addr_len           = 0;
        dev->tx_queue_len       = 10;
 
-       dev->mtu                = sizeof(struct can_frame);
+       dev->mtu                = CAN_MTU;
        dev->type               = ARPHRD_CAN;
 
        /* New-style flags. */