x86/asm: Remove unused __constant_c_x_memset() macro and inlines

Nothing refers to the __constant_c_x_memset() macro anymore. Remove
it and the two referenced static inline functions.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: x86-ml <x86@kernel.org>
Link: https://lkml.kernel.org/r/20190111084931.24601-2-linux@rasmusvillemoes.dk

authored by Rasmus Villemoes and committed by Borislav Petkov 2e905c7a 88ca66d8

Changed files
-84
arch
x86
include
-84
arch/x86/include/asm/string_32.h
··· 209 209 /* we might want to write optimized versions of these later */ 210 210 #define __constant_count_memset(s, c, count) __memset_generic((s), (c), (count)) 211 211 212 - /* 213 - * memset(x, 0, y) is a reasonably common thing to do, so we want to fill 214 - * things 32 bits at a time even when we don't know the size of the 215 - * area at compile-time.. 216 - */ 217 - static __always_inline 218 - void *__constant_c_memset(void *s, unsigned long c, size_t count) 219 - { 220 - int d0, d1; 221 - asm volatile("rep ; stosl\n\t" 222 - "testb $2,%b3\n\t" 223 - "je 1f\n\t" 224 - "stosw\n" 225 - "1:\ttestb $1,%b3\n\t" 226 - "je 2f\n\t" 227 - "stosb\n" 228 - "2:" 229 - : "=&c" (d0), "=&D" (d1) 230 - : "a" (c), "q" (count), "0" (count/4), "1" ((long)s) 231 - : "memory"); 232 - return s; 233 - } 234 - 235 212 /* Added by Gertjan van Wingerde to make minix and sysv module work */ 236 213 #define __HAVE_ARCH_STRNLEN 237 214 extern size_t strnlen(const char *s, size_t count); ··· 216 239 217 240 #define __HAVE_ARCH_STRSTR 218 241 extern char *strstr(const char *cs, const char *ct); 219 - 220 - /* 221 - * This looks horribly ugly, but the compiler can optimize it totally, 222 - * as we by now know that both pattern and count is constant.. 223 - */ 224 - static __always_inline 225 - void *__constant_c_and_count_memset(void *s, unsigned long pattern, 226 - size_t count) 227 - { 228 - switch (count) { 229 - case 0: 230 - return s; 231 - case 1: 232 - *(unsigned char *)s = pattern & 0xff; 233 - return s; 234 - case 2: 235 - *(unsigned short *)s = pattern & 0xffff; 236 - return s; 237 - case 3: 238 - *(unsigned short *)s = pattern & 0xffff; 239 - *((unsigned char *)s + 2) = pattern & 0xff; 240 - return s; 241 - case 4: 242 - *(unsigned long *)s = pattern; 243 - return s; 244 - } 245 - 246 - #define COMMON(x) \ 247 - asm volatile("rep ; stosl" \ 248 - x \ 249 - : "=&c" (d0), "=&D" (d1) \ 250 - : "a" (eax), "0" (count/4), "1" ((long)s) \ 251 - : "memory") 252 - 253 - { 254 - int d0, d1; 255 - unsigned long eax = pattern; 256 - 257 - switch (count % 4) { 258 - case 0: 259 - COMMON(""); 260 - return s; 261 - case 1: 262 - COMMON("\n\tstosb"); 263 - return s; 264 - case 2: 265 - COMMON("\n\tstosw"); 266 - return s; 267 - default: 268 - COMMON("\n\tstosw\n\tstosb"); 269 - return s; 270 - } 271 - } 272 - 273 - #undef COMMON 274 - } 275 - 276 - #define __constant_c_x_memset(s, c, count) \ 277 - (__builtin_constant_p(count) \ 278 - ? __constant_c_and_count_memset((s), (c), (count)) \ 279 - : __constant_c_memset((s), (c), (count))) 280 242 281 243 #define __memset(s, c, count) \ 282 244 (__builtin_constant_p(count) \