Skip to content

Commit 88ca66d

Browse files
Villemoessuryasaimadhu
authored andcommitted
x86/asm: Remove dead __GNUC__ conditionals
The minimum supported gcc version is >= 4.6, so these can be removed. Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Signed-off-by: Borislav Petkov <bp@suse.de> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Dan Williams <dan.j.williams@intel.com> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Matthew Wilcox <willy@infradead.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: x86-ml <x86@kernel.org> Link: https://lkml.kernel.org/r/20190111084931.24601-1-linux@rasmusvillemoes.dk
1 parent bfeffd1 commit 88ca66d

File tree

3 files changed

+0
-41
lines changed

3 files changed

+0
-41
lines changed

arch/x86/include/asm/bitops.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,7 @@
3636
* bit 0 is the LSB of addr; bit 32 is the LSB of (addr+1).
3737
*/
3838

39-
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 1)
40-
/* Technically wrong, but this avoids compilation errors on some gcc
41-
versions. */
42-
#define BITOP_ADDR(x) "=m" (*(volatile long *) (x))
43-
#else
4439
#define BITOP_ADDR(x) "+m" (*(volatile long *) (x))
45-
#endif
4640

4741
#define ADDR BITOP_ADDR(addr)
4842

arch/x86/include/asm/string_32.h

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -179,14 +179,7 @@ static inline void *__memcpy3d(void *to, const void *from, size_t len)
179179
* No 3D Now!
180180
*/
181181

182-
#if (__GNUC__ >= 4)
183182
#define memcpy(t, f, n) __builtin_memcpy(t, f, n)
184-
#else
185-
#define memcpy(t, f, n) \
186-
(__builtin_constant_p((n)) \
187-
? __constant_memcpy((t), (f), (n)) \
188-
: __memcpy((t), (f), (n)))
189-
#endif
190183

191184
#endif
192185
#endif /* !CONFIG_FORTIFY_SOURCE */
@@ -282,12 +275,7 @@ void *__constant_c_and_count_memset(void *s, unsigned long pattern,
282275

283276
{
284277
int d0, d1;
285-
#if __GNUC__ == 4 && __GNUC_MINOR__ == 0
286-
/* Workaround for broken gcc 4.0 */
287-
register unsigned long eax asm("%eax") = pattern;
288-
#else
289278
unsigned long eax = pattern;
290-
#endif
291279

292280
switch (count % 4) {
293281
case 0:
@@ -321,15 +309,7 @@ void *__constant_c_and_count_memset(void *s, unsigned long pattern,
321309
#define __HAVE_ARCH_MEMSET
322310
extern void *memset(void *, int, size_t);
323311
#ifndef CONFIG_FORTIFY_SOURCE
324-
#if (__GNUC__ >= 4)
325312
#define memset(s, c, count) __builtin_memset(s, c, count)
326-
#else
327-
#define memset(s, c, count) \
328-
(__builtin_constant_p(c) \
329-
? __constant_c_x_memset((s), (0x01010101UL * (unsigned char)(c)), \
330-
(count)) \
331-
: __memset((s), (c), (count)))
332-
#endif
333313
#endif /* !CONFIG_FORTIFY_SOURCE */
334314

335315
#define __HAVE_ARCH_MEMSET16

arch/x86/include/asm/string_64.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,6 @@
1414
extern void *memcpy(void *to, const void *from, size_t len);
1515
extern void *__memcpy(void *to, const void *from, size_t len);
1616

17-
#ifndef CONFIG_FORTIFY_SOURCE
18-
#if (__GNUC__ == 4 && __GNUC_MINOR__ < 3) || __GNUC__ < 4
19-
#define memcpy(dst, src, len) \
20-
({ \
21-
size_t __len = (len); \
22-
void *__ret; \
23-
if (__builtin_constant_p(len) && __len >= 64) \
24-
__ret = __memcpy((dst), (src), __len); \
25-
else \
26-
__ret = __builtin_memcpy((dst), (src), __len); \
27-
__ret; \
28-
})
29-
#endif
30-
#endif /* !CONFIG_FORTIFY_SOURCE */
31-
3217
#define __HAVE_ARCH_MEMSET
3318
void *memset(void *s, int c, size_t n);
3419
void *__memset(void *s, int c, size_t n);

0 commit comments

Comments
 (0)