netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] caif: fix endian conversion in cffrml_transmit()
@ 2011-11-21  6:17 Dan Carpenter
  2011-11-21  6:33 ` Al Viro
  2011-11-21 14:36 ` [patch] " Sjur BRENDELAND
  0 siblings, 2 replies; 6+ messages in thread
From: Dan Carpenter @ 2011-11-21  6:17 UTC (permalink / raw)
  To: Sjur Braendeland; +Cc: David S. Miller, netdev, kernel-janitors

The "tmp" variable here is used to store the result of cpu_to_le16()
so it should be a u16 instead of an int.  We want the high bits set
and the current code works on little endian systems but not on big
endian systems.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
This is a static checker thing.  I haven't tested it.  Please review
carefully.

diff --git a/net/caif/cffrml.c b/net/caif/cffrml.c
index f399211..2b46c48 100644
--- a/net/caif/cffrml.c
+++ b/net/caif/cffrml.c
@@ -136,10 +136,11 @@ static int cffrml_receive(struct cflayer *layr, struct cfpkt *pkt)
 
 static int cffrml_transmit(struct cflayer *layr, struct cfpkt *pkt)
 {
-	int tmp;
+	u16 tmp;
 	u16 chks;
 	u16 len;
 	struct cffrml *this = container_obj(layr);
+
 	if (this->dofcs) {
 		chks = cfpkt_iterate(pkt, cffrml_checksum, 0xffff);
 		tmp = cpu_to_le16(chks);

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

end of thread, other threads:[~2011-11-21 21:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-21  6:17 [patch] caif: fix endian conversion in cffrml_transmit() Dan Carpenter
2011-11-21  6:33 ` Al Viro
2011-11-21 19:50   ` [patch v2] " Dan Carpenter
2011-11-21 21:20     ` Sjur Brændeland
2011-11-21 21:46       ` David Miller
2011-11-21 14:36 ` [patch] " Sjur BRENDELAND

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).