All of lore.kernel.org
 help / color / mirror / Atom feed
* re: can: Allwinner A10/A20 CAN Controller support - Kernel module
@ 2015-09-23  7:19 Dan Carpenter
  2015-09-23  7:51 ` Gerhard Bertelsmann
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2015-09-23  7:19 UTC (permalink / raw)
  To: info; +Cc: linux-can

Hello Gerhard Bertelsmann,

The patch 0738eff14d81: "can: Allwinner A10/A20 CAN Controller
support - Kernel module" from Sep 16, 2015, leads to the following
static checker warning:

	drivers/net/can/sun4i_can.c:604 sun4i_can_err()
	warn: mask and shift to zero

drivers/net/can/sun4i_can.c
   596          if (isrc & SUN4I_INT_ARB_LOST) {
   597                  /* arbitration lost interrupt */
   598                  netdev_dbg(dev, "arbitration lost interrupt\n");
   599                  alc = readl(priv->base + SUN4I_REG_STA_ADDR);
   600                  priv->can.can_stats.arbitration_lost++;
   601                  stats->tx_errors++;
   602                  if (likely(skb)) {
   603                          cf->can_id |= CAN_ERR_LOSTARB;
   604                          cf->data[0] = (alc & 0x1f) >> 8;
                                              ^^^^^^^^^^^^^^^^^^
This is zero.  No idea what was intended.

   605                  }
   606          }

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 2+ messages in thread

* re: can: Allwinner A10/A20 CAN Controller support - Kernel module
  2015-09-23  7:19 can: Allwinner A10/A20 CAN Controller support - Kernel module Dan Carpenter
@ 2015-09-23  7:51 ` Gerhard Bertelsmann
  0 siblings, 0 replies; 2+ messages in thread
From: Gerhard Bertelsmann @ 2015-09-23  7:51 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: linux-can, linux-can-owner

Hi Dan,

Am 2015-09-23 09:19, schrieb Dan Carpenter:
> Hello Gerhard Bertelsmann,
> 
> The patch 0738eff14d81: "can: Allwinner A10/A20 CAN Controller
> support - Kernel module" from Sep 16, 2015, leads to the following
> static checker warning:
> 
> 	drivers/net/can/sun4i_can.c:604 sun4i_can_err()
> 	warn: mask and shift to zero
> 
> drivers/net/can/sun4i_can.c
>    596          if (isrc & SUN4I_INT_ARB_LOST) {
>    597                  /* arbitration lost interrupt */
>    598                  netdev_dbg(dev, "arbitration lost 
> interrupt\n");
>    599                  alc = readl(priv->base + SUN4I_REG_STA_ADDR);
>    600                  priv->can.can_stats.arbitration_lost++;
>    601                  stats->tx_errors++;
>    602                  if (likely(skb)) {
>    603                          cf->can_id |= CAN_ERR_LOSTARB;
>    604                          cf->data[0] = (alc & 0x1f) >> 8;
>                                               ^^^^^^^^^^^^^^^^^^
> This is zero.  No idea what was intended.

indeed, that's wrong - mask should be 0x1f00.
I will send an update. Thanks for your hint.

> 
>    605                  }
>    606          }
> 
> regards,
> dan carpenter

Regards,

Gerd

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-09-23  7:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-23  7:19 can: Allwinner A10/A20 CAN Controller support - Kernel module Dan Carpenter
2015-09-23  7:51 ` Gerhard Bertelsmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.