public inbox for linux-can@vger.kernel.org
 help / color / mirror / Atom feed
* re: can: usb: PEAK-System Technik PCAN-USB specific part
@ 2012-03-06 11:21 Dan Carpenter
  2012-03-07  8:56 ` Stephane Grosjean
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Dan Carpenter @ 2012-03-06 11:21 UTC (permalink / raw)
  To: s.grosjean; +Cc: linux-can

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.

   752  
   753                  tmp16 <<= 5;
   754                  memcpy(++pc, &tmp16, 2);
   755                  pc += 2;

regards,
dan carpenter


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

end of thread, other threads:[~2012-03-07 14:13 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox