linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: linux-can@vger.kernel.org
Cc: Marek Vasut <marex@denx.de>,
	Oliver Hartkopp <socketcan@hartkopp.net>,
	Marc Kleine-Budde <mkl@pengutronix.de>
Subject: [PATCH 1/5][RFC] can: slcan: Replace sizeof struct can_frame with CAN_MTU
Date: Thu,  9 Jun 2016 21:21:00 +0200	[thread overview]
Message-ID: <1465500064-5402-1-git-send-email-marex@denx.de> (raw)

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>
---
 drivers/net/can/slcan.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/can/slcan.c b/drivers/net/can/slcan.c
index 9a3f15c..eb71737 100644
--- a/drivers/net/can/slcan.c
+++ b/drivers/net/can/slcan.c
@@ -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. */
-- 
2.7.0


             reply	other threads:[~2016-06-09 19:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-09 19:21 Marek Vasut [this message]
2016-06-09 19:21 ` [PATCH 2/5][RFC] can: Factor out alloc_socketdev() Marek Vasut
2016-06-09 19:21 ` [PATCH 3/5][RFC] can: Add register_candevice() Marek Vasut
2016-06-09 19:21 ` [PATCH 4/5][RFC] can: kline: Add KLine rtnl configuration options Marek Vasut
2016-06-09 20:21   ` Menschel.P
2016-06-11 19:40     ` Marek Vasut
2016-06-12 15:36       ` Patrick Menschel
2016-06-12 17:34         ` Marek Vasut
2016-06-09 19:21 ` [PATCH 5/5][RFC] can: kline: Add KLine ldisc Marek Vasut
2016-06-17  9:24 ` [PATCH 1/5][RFC] can: slcan: Replace sizeof struct can_frame with CAN_MTU Marc Kleine-Budde
2016-06-17  9:25   ` Marek Vasut

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1465500064-5402-1-git-send-email-marex@denx.de \
    --to=marex@denx.de \
    --cc=linux-can@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=socketcan@hartkopp.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).