]> git.baikalelectronics.ru Git - kernel.git/commit
s390/crypto: fix gcc 8 stringop-truncation warning
authorVasily Gorbik <gor@linux.ibm.com>
Thu, 28 Jun 2018 11:33:35 +0000 (13:33 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Mon, 16 Jul 2018 13:45:36 +0000 (15:45 +0200)
commit2e3b37697065fe5f8f73eeaa290934aad85d90c1
treec31b814df144504baca0e282717aa7436bf9ed7c
parent34b8fd8e304c1310b7ef6c77d1ebf3c3e83bfa3b
s390/crypto: fix gcc 8 stringop-truncation warning

Replace strncpy which is used to deliberately avoid string NUL-termination
with memcpy. This allows to get rid of gcc 8 stringop-truncation warning:

    inlined from 'query_crypto_facility.constprop' at
    drivers/s390/crypto/pkey_api.c:702:2:
./include/linux/string.h:246:9: warning: '__builtin_strncpy' output
truncated before terminating nul copying 8 bytes from a string of the
same length [-Wstringop-truncation]

Reviewed-by: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/crypto/pkey_api.c