From: Harvey Harrison Date: Mon, 4 Feb 2008 15:48:01 +0000 (+0100) Subject: x86: sparse errors from string_32.h X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9b4239346136f1432e52d14ea88f4b2662876f4a;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git x86: sparse errors from string_32.h include/asm/string_32.h:216:26: warning: cast truncates bits from constant value (cccccccc becomes cc) include/asm/string_32.h:219:27: warning: cast truncates bits from constant value (cccccccc becomes cccc) include/asm/string_32.h:222:27: warning: cast truncates bits from constant value (cccccccc becomes cccc) include/asm/string_32.h:223:30: warning: cast truncates bits from constant value (cccccccc becomes cc) Signed-off-by: Harvey Harrison Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- diff --git a/include/asm-x86/string_32.h b/include/asm-x86/string_32.h index 55bfa308f900..c5d13a86dea7 100644 --- a/include/asm-x86/string_32.h +++ b/include/asm-x86/string_32.h @@ -213,14 +213,14 @@ static __always_inline void * __constant_c_and_count_memset(void * s, unsigned l case 0: return s; case 1: - *(unsigned char *)s = pattern; + *(unsigned char *)s = pattern & 0xff; return s; case 2: - *(unsigned short *)s = pattern; + *(unsigned short *)s = pattern & 0xffff; return s; case 3: - *(unsigned short *)s = pattern; - *(2+(unsigned char *)s) = pattern; + *(unsigned short *)s = pattern & 0xffff; + *(2+(unsigned char *)s) = pattern & 0xff; return s; case 4: *(unsigned long *)s = pattern;