]>
Commit | Line | Data |
---|---|---|
d33cec38 GKH |
1 | From 88ca66d8540ca26119b1428cddb96b37925bdf01 Mon Sep 17 00:00:00 2001 |
2 | From: Rasmus Villemoes <linux@rasmusvillemoes.dk> | |
3 | Date: Fri, 11 Jan 2019 09:49:30 +0100 | |
4 | Subject: x86/asm: Remove dead __GNUC__ conditionals | |
5 | ||
6 | From: Rasmus Villemoes <linux@rasmusvillemoes.dk> | |
7 | ||
8 | commit 88ca66d8540ca26119b1428cddb96b37925bdf01 upstream. | |
9 | ||
10 | The minimum supported gcc version is >= 4.6, so these can be removed. | |
11 | ||
12 | Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> | |
13 | Signed-off-by: Borislav Petkov <bp@suse.de> | |
14 | Cc: "H. Peter Anvin" <hpa@zytor.com> | |
15 | Cc: Dan Williams <dan.j.williams@intel.com> | |
16 | Cc: Geert Uytterhoeven <geert@linux-m68k.org> | |
17 | Cc: Ingo Molnar <mingo@redhat.com> | |
18 | Cc: Matthew Wilcox <willy@infradead.org> | |
19 | Cc: Peter Zijlstra <peterz@infradead.org> | |
20 | Cc: Thomas Gleixner <tglx@linutronix.de> | |
21 | Cc: x86-ml <x86@kernel.org> | |
22 | Link: https://lkml.kernel.org/r/20190111084931.24601-1-linux@rasmusvillemoes.dk | |
23 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
24 | ||
25 | --- | |
26 | arch/x86/include/asm/bitops.h | 6 ------ | |
27 | arch/x86/include/asm/string_32.h | 20 -------------------- | |
28 | arch/x86/include/asm/string_64.h | 15 --------------- | |
29 | 3 files changed, 41 deletions(-) | |
30 | ||
31 | --- a/arch/x86/include/asm/bitops.h | |
32 | +++ b/arch/x86/include/asm/bitops.h | |
33 | @@ -36,13 +36,7 @@ | |
34 | * bit 0 is the LSB of addr; bit 32 is the LSB of (addr+1). | |
35 | */ | |
36 | ||
37 | -#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 1) | |
38 | -/* Technically wrong, but this avoids compilation errors on some gcc | |
39 | - versions. */ | |
40 | -#define BITOP_ADDR(x) "=m" (*(volatile long *) (x)) | |
41 | -#else | |
42 | #define BITOP_ADDR(x) "+m" (*(volatile long *) (x)) | |
43 | -#endif | |
44 | ||
45 | #define ADDR BITOP_ADDR(addr) | |
46 | ||
47 | --- a/arch/x86/include/asm/string_32.h | |
48 | +++ b/arch/x86/include/asm/string_32.h | |
49 | @@ -179,14 +179,7 @@ static inline void *__memcpy3d(void *to, | |
50 | * No 3D Now! | |
51 | */ | |
52 | ||
53 | -#if (__GNUC__ >= 4) | |
54 | #define memcpy(t, f, n) __builtin_memcpy(t, f, n) | |
55 | -#else | |
56 | -#define memcpy(t, f, n) \ | |
57 | - (__builtin_constant_p((n)) \ | |
58 | - ? __constant_memcpy((t), (f), (n)) \ | |
59 | - : __memcpy((t), (f), (n))) | |
60 | -#endif | |
61 | ||
62 | #endif | |
63 | #endif /* !CONFIG_FORTIFY_SOURCE */ | |
64 | @@ -282,12 +275,7 @@ void *__constant_c_and_count_memset(void | |
65 | ||
66 | { | |
67 | int d0, d1; | |
68 | -#if __GNUC__ == 4 && __GNUC_MINOR__ == 0 | |
69 | - /* Workaround for broken gcc 4.0 */ | |
70 | - register unsigned long eax asm("%eax") = pattern; | |
71 | -#else | |
72 | unsigned long eax = pattern; | |
73 | -#endif | |
74 | ||
75 | switch (count % 4) { | |
76 | case 0: | |
77 | @@ -321,15 +309,7 @@ void *__constant_c_and_count_memset(void | |
78 | #define __HAVE_ARCH_MEMSET | |
79 | extern void *memset(void *, int, size_t); | |
80 | #ifndef CONFIG_FORTIFY_SOURCE | |
81 | -#if (__GNUC__ >= 4) | |
82 | #define memset(s, c, count) __builtin_memset(s, c, count) | |
83 | -#else | |
84 | -#define memset(s, c, count) \ | |
85 | - (__builtin_constant_p(c) \ | |
86 | - ? __constant_c_x_memset((s), (0x01010101UL * (unsigned char)(c)), \ | |
87 | - (count)) \ | |
88 | - : __memset((s), (c), (count))) | |
89 | -#endif | |
90 | #endif /* !CONFIG_FORTIFY_SOURCE */ | |
91 | ||
92 | #define __HAVE_ARCH_MEMSET16 | |
93 | --- a/arch/x86/include/asm/string_64.h | |
94 | +++ b/arch/x86/include/asm/string_64.h | |
95 | @@ -32,21 +32,6 @@ static __always_inline void *__inline_me | |
96 | extern void *memcpy(void *to, const void *from, size_t len); | |
97 | extern void *__memcpy(void *to, const void *from, size_t len); | |
98 | ||
99 | -#ifndef CONFIG_FORTIFY_SOURCE | |
100 | -#if (__GNUC__ == 4 && __GNUC_MINOR__ < 3) || __GNUC__ < 4 | |
101 | -#define memcpy(dst, src, len) \ | |
102 | -({ \ | |
103 | - size_t __len = (len); \ | |
104 | - void *__ret; \ | |
105 | - if (__builtin_constant_p(len) && __len >= 64) \ | |
106 | - __ret = __memcpy((dst), (src), __len); \ | |
107 | - else \ | |
108 | - __ret = __builtin_memcpy((dst), (src), __len); \ | |
109 | - __ret; \ | |
110 | -}) | |
111 | -#endif | |
112 | -#endif /* !CONFIG_FORTIFY_SOURCE */ | |
113 | - | |
114 | #define __HAVE_ARCH_MEMSET | |
115 | void *memset(void *s, int c, size_t n); | |
116 | void *__memset(void *s, int c, size_t n); |