s390/monwriter: fix gcc 8 stringop-truncation warning
authorVasily Gorbik <gor@linux.ibm.com>
Thu, 28 Jun 2018 11:16:14 +0000 (13:16 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Mon, 2 Jul 2018 09:25:03 +0000 (11:25 +0200)
commit9acdb3bb070167c257252e131f56fb8daaa99766
tree14c84269301604232370a1cb167cd71727b32689
parent276d605081fbbc96be02318abb36119625b47bb3
s390/monwriter: fix gcc 8 stringop-truncation warning

The following gcc warning is issued for strncpy which is used to
deliberately avoid string NUL-termination. Reuse memcpy to avoid the
warning.

    inlined from 'monwrite_diag' at drivers/s390/char/monwriter.c:64:2:
./include/linux/string.h:246:9: warning: '__builtin_strncpy' output
truncated before terminating nul copying 7 bytes from a string of the
same length [-Wstringop-truncation]

Reviewed-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/char/monwriter.c