Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: 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>

authored by

Jiri Prchal and committed by
Greg Kroah-Hartman
604288bc 63879e29

+3 -3
+3 -3
drivers/misc/eeprom/at25.c
··· 178 178 struct at25_data *at25; 179 179 180 180 at25 = dev_get_drvdata(dev); 181 - return sysfs_emit(buf, "%*ph\n", sizeof(at25->sernum), at25->sernum); 181 + return sysfs_emit(buf, "%*ph\n", (int)sizeof(at25->sernum), at25->sernum); 182 182 } 183 183 static DEVICE_ATTR_RO(sernum); 184 184 ··· 379 379 u8 sernum[FM25_SN_LEN]; 380 380 int i; 381 381 const struct of_device_id *match; 382 - int is_fram = 0; 382 + unsigned long is_fram = 0; 383 383 384 384 match = of_match_device(of_match_ptr(at25_of_match), &spi->dev); 385 385 if (match) 386 - is_fram = (int)match->data; 386 + is_fram = (unsigned long)match->data; 387 387 388 388 /* Chip description */ 389 389 if (!spi->dev.platform_data) {