Commit 604288bc authored by Jiri Prchal's avatar Jiri Prchal Committed by Greg Kroah-Hartman

nvmem: eeprom: at25: fix type compiler warnings

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: default avatarkernel test robot <lkp@intel.com>
Signed-off-by: default avatarJiri Prchal <jiri.prchal@aksignal.cz>
Fixes: fd307a4a ("nvmem: prepare basics for FRAM support")
Link: https://lore.kernel.org/r/20210611142706.27336-1-jiri.prchal@aksignal.czSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 63879e29
...@@ -178,7 +178,7 @@ static ssize_t sernum_show(struct device *dev, struct device_attribute *attr, ch ...@@ -178,7 +178,7 @@ static ssize_t sernum_show(struct device *dev, struct device_attribute *attr, ch
struct at25_data *at25; struct at25_data *at25;
at25 = dev_get_drvdata(dev); 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); static DEVICE_ATTR_RO(sernum);
...@@ -379,11 +379,11 @@ static int at25_probe(struct spi_device *spi) ...@@ -379,11 +379,11 @@ static int at25_probe(struct spi_device *spi)
u8 sernum[FM25_SN_LEN]; u8 sernum[FM25_SN_LEN];
int i; int i;
const struct of_device_id *match; 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); match = of_match_device(of_match_ptr(at25_of_match), &spi->dev);
if (match) if (match)
is_fram = (int)match->data; is_fram = (unsigned long)match->data;
/* Chip description */ /* Chip description */
if (!spi->dev.platform_data) { if (!spi->dev.platform_data) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment