Displaying 1 result from an estimated 1 matches for "45a2f8e".
2016 Jul 27
0
[PATCH] nouveau: bios pointers may be unaligned, use proper accessors
...gned_le16(&(x))
+#define ROM32(x) get_unaligned_le32(&(x))
#define ROMPTR(d,x) ({ \
struct nouveau_drm *drm = nouveau_drm((d)); \
ROM16(x) ? &drm->vbios.data[ROM16(x)] : NULL; \
diff --git a/drm/nouveau/nvkm/subdev/mxm/mxms.c b/drm/nouveau/nvkm/subdev/mxm/mxms.c
index 45a2f8e..9abfa5e 100644
--- a/drm/nouveau/nvkm/subdev/mxm/mxms.c
+++ b/drm/nouveau/nvkm/subdev/mxm/mxms.c
@@ -23,8 +23,8 @@
*/
#include "mxms.h"
-#define ROM16(x) le16_to_cpu(*(u16 *)&(x))
-#define ROM32(x) le32_to_cpu(*(u32 *)&(x))
+#define ROM16(x) get_unaligned_le16(&(x))
+#de...