V4L/DVB (7969): m920x: unaligned access
authorAl Viro <viro@ftp.linux.org.uk>
Wed, 21 May 2008 03:32:41 +0000 (00:32 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Thu, 5 Jun 2008 09:35:52 +0000 (06:35 -0300)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/dvb/dvb-usb/m920x.c

index a12e6f784fdae92aade0f2b08040f93948206155..54626a0dbf68da45274c92fd3f78a18ff48b6857 100644 (file)
@@ -16,6 +16,7 @@
 #include "qt1010.h"
 #include "tda1004x.h"
 #include "tda827x.h"
+#include <asm/unaligned.h>
 
 /* debug */
 static int dvb_usb_m920x_debug;
@@ -347,13 +348,13 @@ static int m920x_firmware_download(struct usb_device *udev, const struct firmwar
 
        for (pass = 0; pass < 2; pass++) {
                for (i = 0; i + (sizeof(u16) * 3) < fw->size;) {
-                       value = le16_to_cpu(*(u16 *)(fw->data + i));
+                       value = get_unaligned_le16(fw->data + i);
                        i += sizeof(u16);
 
-                       index = le16_to_cpu(*(u16 *)(fw->data + i));
+                       index = get_unaligned_le16(fw->data + i);
                        i += sizeof(u16);
 
-                       size = le16_to_cpu(*(u16 *)(fw->data + i));
+                       size = get_unaligned_le16(fw->data + i);
                        i += sizeof(u16);
 
                        if (pass == 1) {