From: Vasily Gorbik Date: Sun, 17 Jun 2018 10:18:56 +0000 (+0200) Subject: s390/dasd: fix gcc 8 stringop-truncation warning X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=4e0f5e916f7f4623b312e4fcf9f9fe45c4bea290;p=openwrt%2Fstaging%2Fblogic.git 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: Stefan Haberland Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky --- diff --git a/drivers/s390/block/dasd_alias.c b/drivers/s390/block/dasd_alias.c index e36a114354fc..b9ce93e9df89 100644 --- a/drivers/s390/block/dasd_alias.c +++ b/drivers/s390/block/dasd_alias.c @@ -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;