Commit 4e0f5e91 authored by Vasily Gorbik's avatar Vasily Gorbik Committed by Martin Schwidefsky

s390/dasd: fix gcc 8 stringop-truncation warning

drivers/s390/block/dasd_alias.c:711:2: warning: 'strncpy' output truncated
before terminating nul copying 4 bytes from a string of the same length
[-Wstringop-truncation]
  strncpy((char *) &cqr->magic, "ECKD", 4);

Replace strncpy to int as a buffer with memcpy.
Acked-by: default avatarStefan Haberland <sth@linux.ibm.com>
Reviewed-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent c6756b7d
......@@ -708,7 +708,7 @@ static int reset_summary_unit_check(struct alias_lcu *lcu,
struct ccw1 *ccw;
cqr = lcu->rsu_cqr;
strncpy((char *) &cqr->magic, "ECKD", 4);
memcpy((char *) &cqr->magic, "ECKD", 4);
ASCEBC((char *) &cqr->magic, 4);
ccw = cqr->cpaddr;
ccw->cmd_code = DASD_ECKD_CCW_RSCK;
......
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