[PATCH] hack, workaround for warning drivers/acpi/tables/tbfadt.c

From: Ingo Molnar
Date: Wed Aug 27 2008 - 06:44:00 EST


ugly workaround for this warning:

drivers/acpi/tables/tbfadt.c: In function âacpi_tb_create_local_fadtâ:
include/asm/string_32.h:75: warning: array subscript is above array bounds

gcc 4.3.1 20080801 (Red Hat 4.3.1-6)

its array checks are borked. Switch the string_32.h code to short instead.

NOT-Signed-off-by: Ingo Molnar <mingo@xxxxxxx>
---
include/asm-x86/string_32.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/asm-x86/string_32.h b/include/asm-x86/string_32.h
index 487843e..419ab10 100644
--- a/include/asm-x86/string_32.h
+++ b/include/asm-x86/string_32.h
@@ -72,7 +72,7 @@ static __always_inline void *__constant_memcpy(void *to, const void *from,
return to;
case 5:
*(int *)to = *(int *)from;
- *((char *)to + 4) = *((char *)from + 4);
+ *((short *)to + 3) = *((short *)from + 3);
return to;
case 6:
*(int *)to = *(int *)from;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/