Commit 98c7b388 authored by Heiko Carstens's avatar Heiko Carstens Committed by Martin Schwidefsky

[S390] Get rid of memcpy gcc warning workaround.

Compile smp.o with -Wno-nonnull so gcc stops warning about memcpy
being used with a null parameter. Also remove the workaround code
and use a char * cast instead of a void * cast to do computations.

Cc: Bastian Blank <bastian@waldi.eu.org>
Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 5ccd0e43
...@@ -4,6 +4,11 @@ ...@@ -4,6 +4,11 @@
EXTRA_AFLAGS := -traditional EXTRA_AFLAGS := -traditional
#
# Passing null pointers is ok for smp code, since we access the lowcore here.
#
CFLAGS_smp.o := -Wno-nonnull
obj-y := bitmap.o traps.o time.o process.o base.o early.o \ obj-y := bitmap.o traps.o time.o process.o base.o early.o \
setup.o sys_s390.o ptrace.o signal.o cpcmd.o ebcdic.o \ setup.o sys_s390.o ptrace.o signal.o cpcmd.o ebcdic.o \
semaphore.o s390_ext.o debug.o irq.o ipl.o dis.o diag.o semaphore.o s390_ext.o debug.o irq.o ipl.o dis.o diag.o
......
...@@ -629,14 +629,8 @@ static int __cpuinit smp_alloc_lowcore(int cpu) ...@@ -629,14 +629,8 @@ static int __cpuinit smp_alloc_lowcore(int cpu)
panic_stack = __get_free_page(GFP_KERNEL); panic_stack = __get_free_page(GFP_KERNEL);
if (!panic_stack || !async_stack) if (!panic_stack || !async_stack)
goto out; goto out;
/* memcpy(lowcore, &S390_lowcore, 512);
* Only need to copy the first 512 bytes from address 0. But since memset((char *)lowcore + 512, 0, sizeof(*lowcore) - 512);
* the compiler emits a warning if src == NULL for memcpy use copy_page
* instead. Copies more than needed but this code is not performance
* critical.
*/
copy_page(lowcore, &S390_lowcore);
memset((void *)lowcore + 512, 0, sizeof(*lowcore) - 512);
lowcore->async_stack = async_stack + ASYNC_SIZE; lowcore->async_stack = async_stack + ASYNC_SIZE;
lowcore->panic_stack = panic_stack + PAGE_SIZE; lowcore->panic_stack = panic_stack + PAGE_SIZE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment