diff options
author | Vivek Goyal <vgoyal@redhat.com> | 2014-03-18 15:26:40 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2014-03-19 15:44:09 -0700 |
commit | 04999550f93234bf05597a9b7d26e2bfe27ba883 (patch) | |
tree | 633f18a3225e8e898a65f4f1d95f2577e6ccf924 /arch/x86/boot/compressed/string.c | |
parent | fb4cac573ef6dce8d7543b68306566561c2e5725 (diff) | |
download | linux-stable-04999550f93234bf05597a9b7d26e2bfe27ba883.tar.gz linux-stable-04999550f93234bf05597a9b7d26e2bfe27ba883.tar.bz2 linux-stable-04999550f93234bf05597a9b7d26e2bfe27ba883.zip |
x86, boot: Move memset() definition in compressed/string.c
Currently compressed/misc.c needs to link against memset(). I think one of
the reasons of this need is inclusion of various header files which define
static inline functions and use memset() inside these. For example,
include/linux/bitmap.h
I think trying to include "../string.h" and using builtin version of memset
does not work because by the time "#define memset" shows up, it is too
late. Some other header file has already used memset() and expects to
find a definition during link phase.
Currently we have a C definitoin of memset() in misc.c. Move it to
compressed/string.c so that others can use it if need be.
Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Link: http://lkml.kernel.org/r/1395170800-11059-6-git-send-email-vgoyal@redhat.com
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/x86/boot/compressed/string.c')
-rw-r--r-- | arch/x86/boot/compressed/string.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/x86/boot/compressed/string.c b/arch/x86/boot/compressed/string.c index 920b55e3e241..f3c57e341402 100644 --- a/arch/x86/boot/compressed/string.c +++ b/arch/x86/boot/compressed/string.c @@ -33,3 +33,13 @@ void *memcpy(void *dest, const void *src, size_t n) return dest; } #endif + +void *memset(void *s, int c, size_t n) +{ + int i; + char *ss = s; + + for (i = 0; i < n; i++) + ss[i] = c; + return s; +} |