nvmem: eeprom: at25: fix type compiler warnings
authorJiri Prchal <jiri.prchal@aksignal.cz>
Fri, 11 Jun 2021 14:27:06 +0000 (16:27 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Jun 2021 14:42:41 +0000 (16:42 +0200)
Fixes:
drivers/misc/eeprom/at25.c:181:28: warning: field width should have type 'int', but argument has type 'unsigned long'
drivers/misc/eeprom/at25.c:386:13: warning: cast to smaller integer type 'int' from 'const void *'

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Jiri Prchal <jiri.prchal@aksignal.cz>
Fixes: fd307a4ad332 ("nvmem: prepare basics for FRAM support")
Link: https://lore.kernel.org/r/20210611142706.27336-1-jiri.prchal@aksignal.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/eeprom/at25.c

index 6e26de68a001d8ee4150b2d2ec8aa3d25d7bce34..744f7abb22ee0f14ec917fb467ce671d27cf1d8e 100644 (file)
@@ -178,7 +178,7 @@ static ssize_t sernum_show(struct device *dev, struct device_attribute *attr, ch
        struct at25_data *at25;
 
        at25 = dev_get_drvdata(dev);
-       return sysfs_emit(buf, "%*ph\n", sizeof(at25->sernum), at25->sernum);
+       return sysfs_emit(buf, "%*ph\n", (int)sizeof(at25->sernum), at25->sernum);
 }
 static DEVICE_ATTR_RO(sernum);
 
@@ -379,11 +379,11 @@ static int at25_probe(struct spi_device *spi)
        u8 sernum[FM25_SN_LEN];
        int i;
        const struct of_device_id *match;
-       int is_fram = 0;
+       unsigned long is_fram = 0;
 
        match = of_match_device(of_match_ptr(at25_of_match), &spi->dev);
        if (match)
-               is_fram = (int)match->data;
+               is_fram = (unsigned long)match->data;
 
        /* Chip description */
        if (!spi->dev.platform_data) {