All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] or51132.c: unaligned
@ 2008-05-21  0:33 Al Viro
  2008-05-21  0:41 ` Harvey Harrison
  0 siblings, 1 reply; 8+ messages in thread
From: Al Viro @ 2008-05-21  0:33 UTC (permalink / raw)
  To: mchehab; +Cc: linux-kernel, torvalds


Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
 drivers/media/dvb/frontends/or51132.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/media/dvb/frontends/or51132.c b/drivers/media/dvb/frontends/or51132.c
index c7b5785..5ed3254 100644
--- a/drivers/media/dvb/frontends/or51132.c
+++ b/drivers/media/dvb/frontends/or51132.c
@@ -126,7 +126,7 @@ static int or51132_readreg(struct or51132_state *state, u8 reg)
 		       reg, err);
 		return -EREMOTEIO;
 	}
-	return le16_to_cpup((u16*)buf);
+	return buf[0] | (buf[1] << 8);
 }
 
 static int or51132_load_firmware (struct dvb_frontend* fe, const struct firmware *fw)
@@ -140,9 +140,9 @@ static int or51132_load_firmware (struct dvb_frontend* fe, const struct firmware
 	dprintk("Firmware is %Zd bytes\n",fw->size);
 
 	/* Get size of firmware A and B */
-	firmwareAsize = le32_to_cpu(*((u32*)fw->data));
+	firmwareAsize = le32_to_cpu(*((__le32*)fw->data));
 	dprintk("FirmwareA is %i bytes\n",firmwareAsize);
-	firmwareBsize = le32_to_cpu(*((u32*)(fw->data+4)));
+	firmwareBsize = le32_to_cpu(*((__le32*)(fw->data+4)));
 	dprintk("FirmwareB is %i bytes\n",firmwareBsize);
 
 	/* Upload firmware */
-- 
1.5.3.GIT


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

end of thread, other threads:[~2008-05-21  2:02 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-21  0:33 [PATCH] or51132.c: unaligned Al Viro
2008-05-21  0:41 ` Harvey Harrison
2008-05-21  0:45   ` Al Viro
2008-05-21  0:51     ` Harvey Harrison
2008-05-21  0:56       ` Al Viro
2008-05-21  0:55     ` Linus Torvalds
2008-05-21  1:18       ` Al Viro
2008-05-21  2:02         ` Linus Torvalds

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.