History

Merge tag 'linux-can-next-for-3.19-20141207' of git://gitorious.org/linux-can/linux-can-next

Marc Kleine-Budde says: ==================== pull-request: can-next 2014-12-07 this is a pull request of 8 patches for net-next/master. Andri Yngvason contributes 4 patches in which the CAN state change handling is consolidated and unified among the sja1000, mscan and flexcan driver. The three patches by Jeremiah Mahler fix spelling mistakes and eliminate the banner[] variable in various parts. And a patch by me that switches on sparse endianess checking by default. ====================

David S. Miller committed 11 years ago

Commit 602de7e2 parents 605ad7f 71a3aed14 files · +154 −174Browse files

Unified · Split

14 files
  1. drivers/net/can/Makefile +2 −1
  2. drivers/net/can/cc770/cc770.c +1 −1
  3. drivers/net/can/dev.c +78 −0
  4. drivers/net/can/flexcan.c +18 −83
  5. drivers/net/can/mscan/mscan.c +14 −34
  6. drivers/net/can/sja1000/sja1000.c +23 −28
  7. drivers/net/can/slcan.c +2 −5
  8. drivers/net/can/vcan.c +1 −4
  9. include/linux/can/dev.h +3 −0
  10. include/uapi/linux/can/error.h +1 −0
  11. net/can/af_can.c +2 −5
  12. net/can/bcm.c +7 −9
  13. net/can/gw.c +1 −1
  14. net/can/raw.c +1 −3
drivers/net/can/Makefile+2−1
@@ -29,4 +29,5 @@ obj-$(CONFIG_CAN_GRCAN) += grcan.o · 28 unmodified lines
2929 obj-$(CONFIG_CAN_RCAR) += rcar_can.o
3030 obj-$(CONFIG_CAN_XILINXCAN) += xilinx_can.o
3131
32−subdir-ccflags-$(CONFIG_CAN_DEBUG_DEVICES) := -DDEBUG
32+subdir-ccflags-y += -D__CHECK_ENDIAN__
33+subdir-ccflags-$(CONFIG_CAN_DEBUG_DEVICES) += -DDEBUG
drivers/net/can/cc770/cc770.c+1−1
@@ -60,7 +60,7 @@ MODULE_DESCRIPTION(KBUILD_MODNAME "CAN netdevice driver"); · 59 unmodified lines
6060 *
6161 * The message objects 1..14 can be used for TX and RX while the message
6262 * objects 15 is optimized for RX. It has a shadow register for reliable
63− * data receiption under heavy bus load. Therefore it makes sense to use
63+ * data reception under heavy bus load. Therefore it makes sense to use
6464 * this message object for the needed use case. The frame type (EFF/SFF)
6565 * for the message object 15 can be defined via kernel module parameter
6666 * "msgobj15_eff". If not equal 0, it will receive 29-bit EFF frames,
drivers/net/can/dev.c+78−0
@@ -273,6 +273,84 @@ static int can_get_bittiming(struct net_device *dev, struct can_bittiming *bt, · 272 unmodified lines
273273 return err;
274274 }
275275
276+static void can_update_state_error_stats(struct net_device *dev,
277+ enum can_state new_state)
278+{
279+ struct can_priv *priv = netdev_priv(dev);
280+
281+ if (new_state <= priv->state)
282+ return;
283+
284+ switch (new_state) {
285+ case CAN_STATE_ERROR_WARNING:
286+ priv->can_stats.error_warning++;
287+ break;
288+ case CAN_STATE_ERROR_PASSIVE:
289+ priv->can_stats.error_passive++;
290+ break;
291+ case CAN_STATE_BUS_OFF:
292+ default:
293+ break;
294+ };
295+}
296+
297+static int can_tx_state_to_frame(struct net_device *dev, enum can_state state)
298+{
299+ switch (state) {
300+ case CAN_STATE_ERROR_ACTIVE:
301+ return CAN_ERR_CRTL_ACTIVE;
302+ case CAN_STATE_ERROR_WARNING:
303+ return CAN_ERR_CRTL_TX_WARNING;
304+ case CAN_STATE_ERROR_PASSIVE:
305+ return CAN_ERR_CRTL_TX_PASSIVE;
306+ default:
307+ return 0;
308+ }
309+}
310+
311+static int can_rx_state_to_frame(struct net_device *dev, enum can_state state)
312+{
313+ switch (state) {
314+ case CAN_STATE_ERROR_ACTIVE:
315+ return CAN_ERR_CRTL_ACTIVE;
316+ case CAN_STATE_ERROR_WARNING:
317+ return CAN_ERR_CRTL_RX_WARNING;
318+ case CAN_STATE_ERROR_PASSIVE:
319+ return CAN_ERR_CRTL_RX_PASSIVE;
320+ default:
321+ return 0;
322+ }
323+}
324+
325+void can_change_state(struct net_device *dev, struct can_frame *cf,
326+ enum can_state tx_state, enum can_state rx_state)
327+{
328+ struct can_priv *priv = netdev_priv(dev);
329+ enum can_state new_state = max(tx_state, rx_state);
330+
331+ if (unlikely(new_state == priv->state)) {
332+ netdev_warn(dev, "%s: oops, state did not change", __func__);
333+ return;
334+ }
335+
336+ netdev_dbg(dev, "New error state: %d\n", new_state);
337+
338+ can_update_state_error_stats(dev, new_state);
339+ priv->state = new_state;
340+
341+ if (unlikely(new_state == CAN_STATE_BUS_OFF)) {
342+ cf->can_id |= CAN_ERR_BUSOFF;
343+ return;
344+ }
345+
346+ cf->can_id |= CAN_ERR_CRTL;
347+ cf->data[1] |= tx_state >= rx_state ?
348+ can_tx_state_to_frame(dev, tx_state) : 0;
349+ cf->data[1] |= tx_state <= rx_state ?
350+ can_rx_state_to_frame(dev, rx_state) : 0;
351+}
352+EXPORT_SYMBOL_GPL(can_change_state);
353+
276354 /*
277355 * Local echo of CAN messages
278356 *
drivers/net/can/flexcan.c+18−83
@@ -577,98 +577,30 @@ static int flexcan_poll_bus_err(struct net_device *dev, u32 reg_esr) · 576 unmodified lines
577577 return 1;
578578 }
579579
580−static void do_state(struct net_device *dev,
581− struct can_frame *cf, enum can_state new_state)
582−{
583− struct flexcan_priv *priv = netdev_priv(dev);
584− struct can_berr_counter bec;
585−
586− __flexcan_get_berr_counter(dev, &bec);
587−
588− switch (priv->can.state) {
589− case CAN_STATE_ERROR_ACTIVE:
590− /*
591− * from: ERROR_ACTIVE
592− * to : ERROR_WARNING, ERROR_PASSIVE, BUS_OFF
593− * => : there was a warning int
594− */
595− if (new_state >= CAN_STATE_ERROR_WARNING &&
596− new_state <= CAN_STATE_BUS_OFF) {
597− netdev_dbg(dev, "Error Warning IRQ\n");
598− priv->can.can_stats.error_warning++;
599−
600− cf->can_id |= CAN_ERR_CRTL;
601− cf->data[1] = (bec.txerr > bec.rxerr) ?
602− CAN_ERR_CRTL_TX_WARNING :
603− CAN_ERR_CRTL_RX_WARNING;
604− }
605− case CAN_STATE_ERROR_WARNING: /* fallthrough */
606− /*
607− * from: ERROR_ACTIVE, ERROR_WARNING
608− * to : ERROR_PASSIVE, BUS_OFF
609− * => : error passive int
610− */
611− if (new_state >= CAN_STATE_ERROR_PASSIVE &&
612− new_state <= CAN_STATE_BUS_OFF) {
613− netdev_dbg(dev, "Error Passive IRQ\n");
614− priv->can.can_stats.error_passive++;
615−
616− cf->can_id |= CAN_ERR_CRTL;
617− cf->data[1] = (bec.txerr > bec.rxerr) ?
618− CAN_ERR_CRTL_TX_PASSIVE :
619− CAN_ERR_CRTL_RX_PASSIVE;
620− }
621− break;
622− case CAN_STATE_BUS_OFF:
623− netdev_err(dev, "BUG! "
624− "hardware recovered automatically from BUS_OFF\n");
625− break;
626− default:
627− break;
628− }
629−
630− /* process state changes depending on the new state */
631− switch (new_state) {
632− case CAN_STATE_ERROR_WARNING:
633− netdev_dbg(dev, "Error Warning\n");
634− cf->can_id |= CAN_ERR_CRTL;
635− cf->data[1] = (bec.txerr > bec.rxerr) ?
636− CAN_ERR_CRTL_TX_WARNING :
637− CAN_ERR_CRTL_RX_WARNING;
638− break;
639− case CAN_STATE_ERROR_ACTIVE:
640− netdev_dbg(dev, "Error Active\n");
641− cf->can_id |= CAN_ERR_PROT;
642− cf->data[2] = CAN_ERR_PROT_ACTIVE;
643− break;
644− case CAN_STATE_BUS_OFF:
645− cf->can_id |= CAN_ERR_BUSOFF;
646− can_bus_off(dev);
647− break;
648− default:
649− break;
650− }
651−}
652−
653580 static int flexcan_poll_state(struct net_device *dev, u32 reg_esr)
654581 {
655582 struct flexcan_priv *priv = netdev_priv(dev);
656583 struct sk_buff *skb;
657584 struct can_frame *cf;
658− enum can_state new_state;
585+ enum can_state new_state = 0, rx_state = 0, tx_state = 0;
659586 int flt;
587+ struct can_berr_counter bec;
660588
661589 flt = reg_esr & FLEXCAN_ESR_FLT_CONF_MASK;
662590 if (likely(flt == FLEXCAN_ESR_FLT_CONF_ACTIVE)) {
663− if (likely(!(reg_esr & (FLEXCAN_ESR_TX_WRN |
664− FLEXCAN_ESR_RX_WRN))))
665− new_state = CAN_STATE_ERROR_ACTIVE;
666− else
667− new_state = CAN_STATE_ERROR_WARNING;
668− } else if (unlikely(flt == FLEXCAN_ESR_FLT_CONF_PASSIVE))
591+ tx_state = unlikely(reg_esr & FLEXCAN_ESR_TX_WRN) ?
592+ CAN_STATE_ERROR_WARNING : CAN_STATE_ERROR_ACTIVE;
593+ rx_state = unlikely(reg_esr & FLEXCAN_ESR_RX_WRN) ?
594+ CAN_STATE_ERROR_WARNING : CAN_STATE_ERROR_ACTIVE;
595+ new_state = max(tx_state, rx_state);
596+ } else if (unlikely(flt == FLEXCAN_ESR_FLT_CONF_PASSIVE)) {
597+ __flexcan_get_berr_counter(dev, &bec);
669598 new_state = CAN_STATE_ERROR_PASSIVE;
670− else
599+ rx_state = bec.rxerr >= bec.txerr ? new_state : 0;
600+ tx_state = bec.rxerr <= bec.txerr ? new_state : 0;
601+ } else {
671602 new_state = CAN_STATE_BUS_OFF;
603+ }
672604
673605 /* state hasn't changed */
674606 if (likely(new_state == priv->can.state))
@@ -678,8 +610,11 @@ static int flexcan_poll_state(struct net_device *dev, u32 reg_esr) · 3 unmodified lines
678610 if (unlikely(!skb))
679611 return 0;
680612
681− do_state(dev, cf, new_state);
682− priv->can.state = new_state;
613+ can_change_state(dev, cf, tx_state, rx_state);
614+
615+ if (unlikely(new_state == CAN_STATE_BUS_OFF))
616+ can_bus_off(dev);
617+
683618 netif_receive_skb(skb);
684619
685620 dev->stats.rx_packets++;
drivers/net/can/mscan/mscan.c+14−34
@@ -289,18 +289,15 @@ static netdev_tx_t mscan_start_xmit(struct sk_buff *skb, struct net_device *dev) · 288 unmodified lines
289289 return NETDEV_TX_OK;
290290 }
291291
292−/* This function returns the old state to see where we came from */
293−static enum can_state check_set_state(struct net_device *dev, u8 canrflg)
292+static enum can_state get_new_state(struct net_device *dev, u8 canrflg)
294293 {
295294 struct mscan_priv *priv = netdev_priv(dev);
296− enum can_state state, old_state = priv->can.state;
297295
298− if (canrflg & MSCAN_CSCIF && old_state <= CAN_STATE_BUS_OFF) {
299− state = state_map[max(MSCAN_STATE_RX(canrflg),
300− MSCAN_STATE_TX(canrflg))];
301− priv->can.state = state;
302− }
303− return old_state;
296+ if (unlikely(canrflg & MSCAN_CSCIF))
297+ return state_map[max(MSCAN_STATE_RX(canrflg),
298+ MSCAN_STATE_TX(canrflg))];
299+
300+ return priv->can.state;
304301 }
305302
306303 static void mscan_get_rx_frame(struct net_device *dev, struct can_frame *frame)
@@ -349,7 +346,7 @@ static void mscan_get_err_frame(struct net_device *dev, struct can_frame *frame, · 42 unmodified lines
349346 struct mscan_priv *priv = netdev_priv(dev);
350347 struct mscan_regs __iomem *regs = priv->reg_base;
351348 struct net_device_stats *stats = &dev->stats;
352− enum can_state old_state;
349+ enum can_state new_state;
353350
354351 netdev_dbg(dev, "error interrupt (canrflg=%#x)\n", canrflg);
355352 frame->can_id = CAN_ERR_FLAG;
@@ -363,27 +360,13 @@ static void mscan_get_err_frame(struct net_device *dev, struct can_frame *frame, · 7 unmodified lines
363360 frame->data[1] = 0;
364361 }
365362
366− old_state = check_set_state(dev, canrflg);
367− /* State changed */
368− if (old_state != priv->can.state) {
369− switch (priv->can.state) {
370− case CAN_STATE_ERROR_WARNING:
371− frame->can_id |= CAN_ERR_CRTL;
372− priv->can.can_stats.error_warning++;
373− if ((priv->shadow_statflg & MSCAN_RSTAT_MSK) <
374− (canrflg & MSCAN_RSTAT_MSK))
375− frame->data[1] |= CAN_ERR_CRTL_RX_WARNING;
376− if ((priv->shadow_statflg & MSCAN_TSTAT_MSK) <
377− (canrflg & MSCAN_TSTAT_MSK))
378− frame->data[1] |= CAN_ERR_CRTL_TX_WARNING;
379− break;
380− case CAN_STATE_ERROR_PASSIVE:
381− frame->can_id |= CAN_ERR_CRTL;
382− priv->can.can_stats.error_passive++;
383− frame->data[1] |= CAN_ERR_CRTL_RX_PASSIVE;
384− break;
385− case CAN_STATE_BUS_OFF:
386− frame->can_id |= CAN_ERR_BUSOFF;
363+ new_state = get_new_state(dev, canrflg);
364+ if (new_state != priv->can.state) {
365+ can_change_state(dev, frame,
366+ state_map[MSCAN_STATE_TX(canrflg)],
367+ state_map[MSCAN_STATE_RX(canrflg)]);
368+
369+ if (priv->can.state == CAN_STATE_BUS_OFF) {
387370 /*
388371 * The MSCAN on the MPC5200 does recover from bus-off
389372 * automatically. To avoid that we stop the chip doing
@@ -396,9 +379,6 @@ static void mscan_get_err_frame(struct net_device *dev, struct can_frame *frame, · 6 unmodified lines
396379 MSCAN_SLPRQ | MSCAN_INITRQ);
397380 }
398381 can_bus_off(dev);
399− break;
400− default:
401− break;
402382 }
403383 }
404384 priv->shadow_statflg = canrflg & MSCAN_STAT_MSK;
drivers/net/can/sja1000/sja1000.c+23−28
@@ -392,12 +392,20 @@ static int sja1000_err(struct net_device *dev, uint8_t isrc, uint8_t status) · 391 unmodified lines
392392 struct can_frame *cf;
393393 struct sk_buff *skb;
394394 enum can_state state = priv->can.state;
395+ enum can_state rx_state, tx_state;
396+ unsigned int rxerr, txerr;
395397 uint8_t ecc, alc;
396398
397399 skb = alloc_can_err_skb(dev, &cf);
398400 if (skb == NULL)
399401 return -ENOMEM;
400402
403+ txerr = priv->read_reg(priv, SJA1000_TXERR);
404+ rxerr = priv->read_reg(priv, SJA1000_RXERR);
405+
406+ cf->data[6] = txerr;
407+ cf->data[7] = rxerr;
408+
401409 if (isrc & IRQ_DOI) {
402410 /* data overrun interrupt */
403411 netdev_dbg(dev, "data overrun interrupt\n");
@@ -412,13 +420,11 @@ static int sja1000_err(struct net_device *dev, uint8_t isrc, uint8_t status) · 8 unmodified lines
412420 /* error warning interrupt */
413421 netdev_dbg(dev, "error warning interrupt\n");
414422
415− if (status & SR_BS) {
423+ if (status & SR_BS)
416424 state = CAN_STATE_BUS_OFF;
417− cf->can_id |= CAN_ERR_BUSOFF;
418− can_bus_off(dev);
419− } else if (status & SR_ES) {
425+ else if (status & SR_ES)
420426 state = CAN_STATE_ERROR_WARNING;
421− } else
427+ else
422428 state = CAN_STATE_ERROR_ACTIVE;
423429 }
424430 if (isrc & IRQ_BEI) {
@@ -452,10 +458,11 @@ static int sja1000_err(struct net_device *dev, uint8_t isrc, uint8_t status) · 27 unmodified lines
452458 if (isrc & IRQ_EPI) {
453459 /* error passive interrupt */
454460 netdev_dbg(dev, "error passive interrupt\n");
455− if (status & SR_ES)
456− state = CAN_STATE_ERROR_PASSIVE;
461+
462+ if (state == CAN_STATE_ERROR_PASSIVE)
463+ state = CAN_STATE_ERROR_WARNING;
457464 else
458− state = CAN_STATE_ERROR_ACTIVE;
465+ state = CAN_STATE_ERROR_PASSIVE;
459466 }
460467 if (isrc & IRQ_ALI) {
461468 /* arbitration lost interrupt */
@@ -467,27 +474,15 @@ static int sja1000_err(struct net_device *dev, uint8_t isrc, uint8_t status) · 5 unmodified lines
467474 cf->data[0] = alc & 0x1f;
468475 }
469476
470− if (state != priv->can.state && (state == CAN_STATE_ERROR_WARNING ||
471− state == CAN_STATE_ERROR_PASSIVE)) {
472− uint8_t rxerr = priv->read_reg(priv, SJA1000_RXERR);
473− uint8_t txerr = priv->read_reg(priv, SJA1000_TXERR);
474− cf->can_id |= CAN_ERR_CRTL;
475− if (state == CAN_STATE_ERROR_WARNING) {
476− priv->can.can_stats.error_warning++;
477− cf->data[1] = (txerr > rxerr) ?
478− CAN_ERR_CRTL_TX_WARNING :
479− CAN_ERR_CRTL_RX_WARNING;
480− } else {
481− priv->can.can_stats.error_passive++;
482− cf->data[1] = (txerr > rxerr) ?
483− CAN_ERR_CRTL_TX_PASSIVE :
484− CAN_ERR_CRTL_RX_PASSIVE;
485− }
486− cf->data[6] = txerr;
487− cf->data[7] = rxerr;
488− }
477+ if (state != priv->can.state) {
478+ tx_state = txerr >= rxerr ? state : 0;
479+ rx_state = txerr <= rxerr ? state : 0;
489480
490− priv->can.state = state;
481+ can_change_state(dev, cf, tx_state, rx_state);
482+
483+ if(state == CAN_STATE_BUS_OFF)
484+ can_bus_off(dev);
485+ }
491486
492487 netif_rx(skb);
493488
drivers/net/can/slcan.c+2−5
@@ -56,9 +56,6 @@ · 55 unmodified lines
5656 #include <linux/can.h>
5757 #include <linux/can/skb.h>
5858
59−static __initconst const char banner[] =
60− KERN_INFO "slcan: serial line CAN interface driver\n";
61−
6259 MODULE_ALIAS_LDISC(N_SLCAN);
6360 MODULE_DESCRIPTION("serial line CAN interface");
6461 MODULE_LICENSE("GPL");
@@ -702,8 +699,8 @@ static int __init slcan_init(void) · 637 unmodified lines
702699 if (maxdev < 4)
703700 maxdev = 4; /* Sanity */
704701
705− printk(banner);
706− printk(KERN_INFO "slcan: %d dynamic interface channels.\n", maxdev);
702+ pr_info("slcan: serial line CAN interface driver\n");
703+ pr_info("slcan: %d dynamic interface channels.\n", maxdev);
707704
708705 slcan_devs = kzalloc(sizeof(struct net_device *)*maxdev, GFP_KERNEL);
709706 if (!slcan_devs)
drivers/net/can/vcan.c+1−4
@@ -50,9 +50,6 @@ · 49 unmodified lines
5050 #include <linux/slab.h>
5151 #include <net/rtnetlink.h>
5252
53−static __initconst const char banner[] =
54− KERN_INFO "vcan: Virtual CAN interface driver\n";
55−
5653 MODULE_DESCRIPTION("virtual CAN interface");
5754 MODULE_LICENSE("Dual BSD/GPL");
5855 MODULE_AUTHOR("Urs Thuermann <urs.thuermann@volkswagen.de>");
@@ -173,7 +170,7 @@ static struct rtnl_link_ops vcan_link_ops __read_mostly = { · 114 unmodified lines
173170
174171 static __init int vcan_init_module(void)
175172 {
176− printk(banner);
173+ pr_info("vcan: Virtual CAN interface driver\n");
177174
178175 if (echo)
179176 printk(KERN_INFO "vcan: enabled echo on driver level.\n");
include/linux/can/dev.h+3−0
@@ -127,6 +127,9 @@ void unregister_candev(struct net_device *dev); · 126 unmodified lines
127127 int can_restart_now(struct net_device *dev);
128128 void can_bus_off(struct net_device *dev);
129129
130+void can_change_state(struct net_device *dev, struct can_frame *cf,
131+ enum can_state tx_state, enum can_state rx_state);
132+
130133 void can_put_echo_skb(struct sk_buff *skb, struct net_device *dev,
131134 unsigned int idx);
132135 unsigned int can_get_echo_skb(struct net_device *dev, unsigned int idx);
include/uapi/linux/can/error.h+1−0
@@ -71,6 +71,7 @@ · 70 unmodified lines
7171 #define CAN_ERR_CRTL_TX_PASSIVE 0x20 /* reached error passive status TX */
7272 /* (at least one error counter exceeds */
7373 /* the protocol-defined level of 127) */
74+#define CAN_ERR_CRTL_ACTIVE 0x40 /* recovered to error active state */
7475
7576 /* error in CAN protocol (type) / data[2] */
7677 #define CAN_ERR_PROT_UNSPEC 0x00 /* unspecified */
net/can/af_can.c+2−5
@@ -64,9 +64,6 @@ · 63 unmodified lines
6464
6565 #include "af_can.h"
6666
67−static __initconst const char banner[] = KERN_INFO
68− "can: controller area network core (" CAN_VERSION_STRING ")\n";
69−
7067 MODULE_DESCRIPTION("Controller Area Network PF_CAN core");
7168 MODULE_LICENSE("Dual BSD/GPL");
7269 MODULE_AUTHOR("Urs Thuermann <urs.thuermann@volkswagen.de>, "
@@ -524,7 +521,7 @@ static void can_rx_delete_receiver(struct rcu_head *rp) · 451 unmodified lines
524521
525522 /**
526523 * can_rx_unregister - unsubscribe CAN frames from a specific interface
527− * @dev: pointer to netdevice (NULL => unsubcribe from 'all' CAN devices list)
524+ * @dev: pointer to netdevice (NULL => unsubscribe from 'all' CAN devices list)
528525 * @can_id: CAN identifier
529526 * @mask: CAN mask
530527 * @func: callback function on filter match
@@ -896,7 +893,7 @@ static __init int can_init(void) · 365 unmodified lines
896893 offsetof(struct can_frame, data) !=
897894 offsetof(struct canfd_frame, data));
898895
899− printk(banner);
896+ pr_info("can: controller area network core (" CAN_VERSION_STRING ")\n");
900897
901898 memset(&can_rx_alldev_list, 0, sizeof(can_rx_alldev_list));
902899
net/can/bcm.c+7−9
@@ -78,8 +78,6 @@ · 77 unmodified lines
7878 (CAN_SFF_MASK | CAN_EFF_FLAG | CAN_RTR_FLAG))
7979
8080 #define CAN_BCM_VERSION CAN_VERSION
81−static __initconst const char banner[] = KERN_INFO
82− "can: broadcast manager protocol (rev " CAN_BCM_VERSION " t)\n";
8381
8482 MODULE_DESCRIPTION("PF_CAN broadcast manager protocol");
8583 MODULE_LICENSE("Dual BSD/GPL");
@@ -441,7 +439,7 @@ static void bcm_rx_update_and_send(struct bcm_op *op, · 355 unmodified lines
441439 /* mark as used and throttled by default */
442440 lastdata->can_dlc |= (RX_RECV|RX_THR);
443441
444− /* throtteling mode inactive ? */
442+ /* throttling mode inactive ? */
445443 if (!op->kt_ival2.tv64) {
446444 /* send RX_CHANGED to the user immediately */
447445 bcm_rx_changed(op, lastdata);
@@ -452,7 +450,7 @@ static void bcm_rx_update_and_send(struct bcm_op *op, · 4 unmodified lines
452450 if (hrtimer_active(&op->thrtimer))
453451 return;
454452
455− /* first receiption with enabled throttling mode */
453+ /* first reception with enabled throttling mode */
456454 if (!op->kt_lastmsg.tv64)
457455 goto rx_changed_settime;
458456
@@ -480,7 +478,7 @@ static void bcm_rx_cmp_to_index(struct bcm_op *op, unsigned int index, · 21 unmodified lines
480478 const struct can_frame *rxdata)
481479 {
482480 /*
483− * no one uses the MSBs of can_dlc for comparation,
481+ * no one uses the MSBs of can_dlc for comparison,
484482 * so we use it here to detect the first time of reception
485483 */
486484
@@ -510,7 +508,7 @@ static void bcm_rx_cmp_to_index(struct bcm_op *op, unsigned int index, · 23 unmodified lines
510508 }
511509
512510 /*
513− * bcm_rx_starttimer - enable timeout monitoring for CAN frame receiption
511+ * bcm_rx_starttimer - enable timeout monitoring for CAN frame reception
514512 */
515513 static void bcm_rx_starttimer(struct bcm_op *op)
516514 {
@@ -539,7 +537,7 @@ static void bcm_rx_timeout_tsklet(unsigned long data) · 22 unmodified lines
539537 }
540538
541539 /*
542− * bcm_rx_timeout_handler - when the (cyclic) CAN frame receiption timed out
540+ * bcm_rx_timeout_handler - when the (cyclic) CAN frame reception timed out
543541 */
544542 static enum hrtimer_restart bcm_rx_timeout_handler(struct hrtimer *hrtimer)
545543 {
@@ -627,7 +625,7 @@ static enum hrtimer_restart bcm_rx_thr_handler(struct hrtimer *hrtimer) · 81 unmodified lines
627625 }
628626
629627 /*
630− * bcm_rx_handler - handle a CAN frame receiption
628+ * bcm_rx_handler - handle a CAN frame reception
631629 */
632630 static void bcm_rx_handler(struct sk_buff *skb, void *data)
633631 {
@@ -1612,7 +1610,7 @@ static int __init bcm_module_init(void) · 978 unmodified lines
16121610 {
16131611 int err;
16141612
1615− printk(banner);
1613+ pr_info("can: broadcast manager protocol (rev " CAN_BCM_VERSION " t)\n");
16161614
16171615 err = can_proto_register(&bcm_can_proto);
16181616 if (err < 0) {
net/can/gw.c+1−1
@@ -361,7 +361,7 @@ static void can_can_gw_rcv(struct sk_buff *skb, void *data) · 360 unmodified lines
361361 * The Controller Area Network controllers only accept CAN frames with
362362 * correct CRCs - which are not visible in the controller registers.
363363 * According to skbuff.h documentation the csum_start element for IP
364− * checksums is undefined/unsued when ip_summed == CHECKSUM_UNNECESSARY.
364+ * checksums is undefined/unused when ip_summed == CHECKSUM_UNNECESSARY.
365365 * Only CAN skbs can be processed here which already have this property.
366366 */
367367
net/can/raw.c+1−3
@@ -56,8 +56,6 @@ · 55 unmodified lines
5656 #include <net/net_namespace.h>
5757
5858 #define CAN_RAW_VERSION CAN_VERSION
59−static __initconst const char banner[] =
60− KERN_INFO "can: raw protocol (rev " CAN_RAW_VERSION ")\n";
6159
6260 MODULE_DESCRIPTION("PF_CAN raw protocol");
6361 MODULE_LICENSE("Dual BSD/GPL");
@@ -810,7 +808,7 @@ static __init int raw_module_init(void) · 746 unmodified lines
810808 {
811809 int err;
812810
813− printk(banner);
811+ pr_info("can: raw protocol (rev " CAN_RAW_VERSION ")\n");
814812
815813 err = can_proto_register(&raw_can_proto);
816814 if (err < 0)