Skip to content

Commit

Permalink
x86, boot: Undef memcmp before providing a new definition
Browse files Browse the repository at this point in the history
With CONFIG_X86_32=y, string_32.h gets pulled in compressed/string.c by
"misch.h". string_32.h defines a macro to map memcmp to __builtin_memcmp().
And that macro in turn changes the name of memcmp() defined here and
converts it to __builtin_memcmp().

I thought that's not the intention though. We probably want to provide
our own optimized definition of memcmp(). If yes, then undef the memcmp
before we define a new memcmp.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Link: http://lkml.kernel.org/r/1395170800-11059-2-git-send-email-vgoyal@redhat.com
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
  • Loading branch information
Vivek Goyal authored and H. Peter Anvin committed Mar 19, 2014
1 parent dcb99fd commit aad8309
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/x86/boot/compressed/string.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "misc.h"

/* Avoid intereference from any defines in string_32.h */
#undef memcmp
int memcmp(const void *s1, const void *s2, size_t len)
{
u8 diff;
Expand Down

0 comments on commit aad8309

Please sign in to comment.