• Vasily Gorbik's avatar
    s390/dasd,zfcp: fix gcc 8 stringop-truncation warnings · c6756b7d
    Vasily Gorbik authored
    ccw "busid" should always be NUL-terminated, as evident from e.g.
    get_ccwdev_by_busid doing "return (strcmp(bus_id, dev_name(dev)) == 0)".
    
    Replace all strncpy initializing busid with strlcpy. This fixes the
    following gcc 8 warnings:
    
    drivers/s390/scsi/zfcp_aux.c:104:2: warning: 'strncpy' specified bound 20
    equals destination size [-Wstringop-truncation]
      strncpy(busid, token, ZFCP_BUS_ID_SIZE);
    
    drivers/s390/block/dasd_eer.c:316:2: warning: 'strncpy' specified bound 10
    equals destination size [-Wstringop-truncation]
      strncpy(header.busid, dev_name(&device->cdev->dev), DASD_EER_BUSID_SIZE);
    
    drivers/s390/block/dasd_eer.c:359:2: warning: 'strncpy' specified bound 10
    equals destination size [-Wstringop-truncation]
      strncpy(header.busid, dev_name(&device->cdev->dev), DASD_EER_BUSID_SIZE);
    
    drivers/s390/block/dasd_devmap.c:429:3: warning: 'strncpy' specified bound
    20 equals destination size [-Wstringop-truncation]
       strncpy(new->bus_id, bus_id, DASD_BUS_ID_SIZE);
    Acked-by: default avatarStefan Haberland <sth@linux.ibm.com>
    Acked-by: default avatarSteffen Maier <maier@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>
    c6756b7d
dasd_eer.c 20.2 KB