scsi: Avoid sign extension of scsi_device.type
authorBart Van Assche <bart.vanassche@wdc.com>
Fri, 25 Aug 2017 20:46:28 +0000 (13:46 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 25 Aug 2017 21:08:07 +0000 (17:08 -0400)
This patch avoids that smatch reports the following:

drivers/scsi/scsi_sysfs.c:506 scsi_bus_uevent() warn: argument 3 to %02x specifier has type 'char'
drivers/scsi/scsi_sysfs.c:872 sdev_show_modalias() warn: argument 4 to %02x specifier has type 'char'

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
include/scsi/scsi_device.h

index 0979a5f3b69a30ce384db82728fb28ad6a136a6d..f054f3f43c7563772aa5ae181aedfe3ea5f17281 100644 (file)
@@ -111,7 +111,7 @@ struct scsi_device {
        unsigned sector_size;   /* size in bytes */
 
        void *hostdata;         /* available to low-level driver */
-       char type;
+       unsigned char type;
        char scsi_level;
        char inq_periph_qual;   /* PQ from INQUIRY data */      
        struct mutex inquiry_mutex;