-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Moin,
Oliver Hartkopp wrote:
> diff --git a/drivers/net/can/sja1000/sja1000.c
> b/drivers/net/can/sja1000/sja1000.c
> index 16d2ecd..988fa45 100644
> --- a/drivers/net/can/sja1000/sja1000.c
> +++ b/drivers/net/can/sja1000/sja1000.c
> @@ -303,7 +303,18 @@ static void sja1000_rx(struct net_device *dev)
> skb->protocol = htons(ETH_P_CAN);
>
> fi = priv->read_reg(priv, REG_FI);
> +
> dlc = fi & 0x0F;
> + if (unlikely(dlc > 8)) {
> +
> + static int print_dlc_err;
> +
> + if (!print_dlc_err) {
> + dev_err(dev->dev.parent, "illegal dlc %d\n", dlc);
> + print_dlc_err = 1;
> + }
You should use something like "WARN_ONCE" instead of open-coding it.
> + dlc = 8;
> + }
>
> if (fi & FI_FF) {
> /* extended frame format (EFF) */
The general question is should a driver print this message or not. The
at91 silently limits the dlc to 8. I'm not sure what the other mainline
drivers do.
cheers, Marc
- --
Pengutronix e.K. | Marc Kleine-Budde |
Linux Solutions for Science and Industry | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAksXcacACgkQjTAFq1RaXHPdIwCeP+f519/84AfSQJJLYesOIwbP
ArYAn3KtGXTGykyuQf2wqiDTQOQRvy2B
=ABHF
-----END PGP SIGNATURE-----
_______________________________________________
Socketcan-core mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/socketcan-core