From: Dan Carpenter <dan.carpenter@oracle.com>
To: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: s.grosjean@peak-system.com, linux-can@vger.kernel.org
Subject: Re: can: usb: PEAK-System Technik PCAN-USB specific part
Date: Wed, 7 Mar 2012 16:17:42 +0300 [thread overview]
Message-ID: <20120307131741.GD674@mwanda> (raw)
In-Reply-To: <4F57549F.3050309@pengutronix.de>
[-- Attachment #1: Type: text/plain, Size: 1366 bytes --]
On Wed, Mar 07, 2012 at 01:29:19PM +0100, Marc Kleine-Budde wrote:
> On 03/07/2012 01:21 PM, Dan Carpenter wrote:
> > On Tue, Mar 06, 2012 at 02:21:08PM +0300, Dan Carpenter wrote:
> >> Hello Stephane Grosjean,
> >>
> >> The patch 46be265d3388: "can: usb: PEAK-System Technik PCAN-USB
> >> specific part" from Mar 2, 2012, leads to the following warning:
> >>
> >> drivers/net/can/usb/peak_usb/pcan_usb.c:751 pcan_usb_encode_msg()
> >> error: wrong number of bits for 'cpu_to_le32' (16 vs 32)
> >>
> >> drivers/net/can/usb/peak_usb/pcan_usb.c
> >> 742 /* can id */
> >> 743 if (cf->can_id & CAN_EFF_FLAG) {
> >> 744 __le32 tmp32 = cpu_to_le32(cf->can_id & CAN_ERR_MASK);
> >> 745
> >> 746 tmp32 <<= 3;
> >
> > Also we can't be doing this shift on little endian data.
>
> This should be first shift, then convert to little endian, isn't it?
>
That's my guess too.
__le32 tmp32 = cpu_to_le32((cf->can_id & CAN_ERR_MASK) << 3);
Btw, it's slightly odd to me that CAN_EFF_MASK and CAN_ERR_MASK are
the same. I wouldn't comment on it except that I was wondering if
it might be a copy and paste bug.
#define CAN_EFF_MASK 0x1FFFFFFFU /* extended frame format (EFF) */
#define CAN_ERR_MASK 0x1FFFFFFFU /* omit EFF, RTR, ERR flags */
regards,
dan carpenter
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2012-03-07 13:15 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-06 11:21 can: usb: PEAK-System Technik PCAN-USB specific part Dan Carpenter
2012-03-07 8:56 ` Stephane Grosjean
2012-03-07 9:24 ` Marc Kleine-Budde
2012-03-07 11:16 ` Stephane Grosjean
2012-03-07 9:05 ` Stephane Grosjean
2012-03-07 12:21 ` Dan Carpenter
2012-03-07 12:29 ` Marc Kleine-Budde
2012-03-07 13:17 ` Dan Carpenter [this message]
2012-03-07 13:26 ` Marc Kleine-Budde
2012-03-07 13:36 ` Dan Carpenter
2012-03-07 13:43 ` Marc Kleine-Budde
2012-03-07 14:05 ` Stephane Grosjean
2012-03-07 14:07 ` Marc Kleine-Budde
2012-03-07 14:13 ` Stephane Grosjean
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=20120307131741.GD674@mwanda \
--to=dan.carpenter@oracle.com \
--cc=linux-can@vger.kernel.org \
--cc=mkl@pengutronix.de \
--cc=s.grosjean@peak-system.com \
/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