From: Stephane Grosjean <s.grosjean@peak-system.com>
To: "linux-can@vger.kernel.org" <linux-can@vger.kernel.org>
Subject: Re: can: usb: PEAK-System Technik PCAN-USB specific part
Date: Wed, 07 Mar 2012 09:56:36 +0100 [thread overview]
Message-ID: <4F5722C4.7030804@peak-system.com> (raw)
In-Reply-To: <20120306112108.GA4362@elgon.mountain>
Hi everybody,
Happy to have seen some of you last Monday, at iCC, it was great. It's
always easier when we're able to attach a face to a name.
Back to work now:
Le 06/03/2012 12:21, Dan Carpenter a écrit :
> 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;
> 747 *pc |= PCAN_USB_STATUSLEN_EXT_ID;
> 748 memcpy(++pc,&tmp32, 4);
> 749 pc += 4;
> 750 } else {
> 751 __le16 tmp16 = cpu_to_le32(cf->can_id& CAN_ERR_MASK);
> ^^^^^^^^^^^^
> A little endian 32 bit can't fit here.
How may this error happen while it didn't before? Is this is due to some
(new) options of gcc, or because of a new version used? In the future,
how could I avoid that? I mean, how to synchronize with the final GCC
options/version?
FYI, the original code was:
> > + else {
> } else {
> > + u16 tmp16 = (u16 )*cpu_to_le32*(cf->can_id& CAN_ERR_MASK);
> ^^^^^^^^^^^^^^^^^
cf->can_id is a 32-bits field which I want to keep only the lo-word part...
How to do that in the correct way, please?
Anyway, what next? I suppose I have to submit a new patch, but comparing
to what?
Thanks for your help and regards,
Stéphane
--
PEAK-System Technik GmbH, Otto-Roehm-Strasse 69, D-64293 Darmstadt
Geschaeftsleitung: A.Gach/U.Wilhelm,St.Nr.:007/241/13586 FA Darmstadt
HRB-9183 Darmstadt, Ust.IdNr.:DE 202220078, WEE-Reg.-Nr.: DE39305391
Tel.+49 (0)6151-817320 / Fax:+49 (0)6151-817329, info@peak-system.com
next prev parent reply other threads:[~2012-03-07 8:56 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 [this message]
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
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=4F5722C4.7030804@peak-system.com \
--to=s.grosjean@peak-system.com \
--cc=linux-can@vger.kernel.org \
/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