scsi: Convert a strncmp() call into a strcmp() call
authorBart Van Assche <bart.vanassche@wdc.com>
Fri, 25 Aug 2017 20:46:30 +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 warning:

drivers/scsi/scsi_sysfs.c:117: check_set() error: strncmp() '"-"' too small (2 vs 20)

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>
drivers/scsi/scsi_sysfs.c

index 41891db2010887b9a263be57befff65abe682839..5ed473a87589c4fae6649f604d53609cd1d0926a 100644 (file)
@@ -114,7 +114,7 @@ static int check_set(unsigned long long *val, char *src)
 {
        char *last;
 
-       if (strncmp(src, "-", 20) == 0) {
+       if (strcmp(src, "-") == 0) {
                *val = SCAN_WILD_CARD;
        } else {
                /*