linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nvmem: eeprom: at25: fix type compiler warnings
@ 2021-06-11 14:27 Jiri Prchal
  2021-06-11 14:45 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 3+ messages in thread
From: Jiri Prchal @ 2021-06-11 14:27 UTC (permalink / raw)
  To: devicetree, linux-kernel
  Cc: Rob Herring, Christian Eggers, Arnd Bergmann, Greg Kroah-Hartman,
	Jiri Prchal, kernel test robot

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 *'

Signed-off-by: Jiri Prchal <jiri.prchal@aksignal.cz>
Reported-by: kernel test robot <lkp@intel.com>
---
 drivers/misc/eeprom/at25.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/misc/eeprom/at25.c b/drivers/misc/eeprom/at25.c
index 6e26de68a001..744f7abb22ee 100644
--- a/drivers/misc/eeprom/at25.c
+++ b/drivers/misc/eeprom/at25.c
@@ -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) {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] nvmem: eeprom: at25: fix type compiler warnings
  2021-06-11 14:27 [PATCH] nvmem: eeprom: at25: fix type compiler warnings Jiri Prchal
@ 2021-06-11 14:45 ` Greg Kroah-Hartman
  2021-06-11 14:47   ` Jiří Prchal
  0 siblings, 1 reply; 3+ messages in thread
From: Greg Kroah-Hartman @ 2021-06-11 14:45 UTC (permalink / raw)
  To: Jiri Prchal
  Cc: devicetree, linux-kernel, Rob Herring, Christian Eggers,
	Arnd Bergmann, kernel test robot

On Fri, Jun 11, 2021 at 04:27:06PM +0200, Jiri Prchal wrote:
> 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 *'
> 
> Signed-off-by: Jiri Prchal <jiri.prchal@aksignal.cz>
> Reported-by: kernel test robot <lkp@intel.com>
> ---
>  drivers/misc/eeprom/at25.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/misc/eeprom/at25.c b/drivers/misc/eeprom/at25.c
> index 6e26de68a001..744f7abb22ee 100644
> --- a/drivers/misc/eeprom/at25.c
> +++ b/drivers/misc/eeprom/at25.c
> @@ -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) {
> -- 
> 2.25.1
> 

Looks good, now queued up.

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] nvmem: eeprom: at25: fix type compiler warnings
  2021-06-11 14:45 ` Greg Kroah-Hartman
@ 2021-06-11 14:47   ` Jiří Prchal
  0 siblings, 0 replies; 3+ messages in thread
From: Jiří Prchal @ 2021-06-11 14:47 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: devicetree, linux-kernel, Rob Herring, Christian Eggers,
	Arnd Bergmann, kernel test robot



On 11. 06. 21 16:45, Greg Kroah-Hartman wrote:
> On Fri, Jun 11, 2021 at 04:27:06PM +0200, Jiri Prchal wrote:
>> 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 *'
>>
>> Signed-off-by: Jiri Prchal <jiri.prchal@aksignal.cz>
>> Reported-by: kernel test robot <lkp@intel.com>
>> ---
>>   drivers/misc/eeprom/at25.c | 6 +++---
>>   1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/misc/eeprom/at25.c b/drivers/misc/eeprom/at25.c
>> index 6e26de68a001..744f7abb22ee 100644
>> --- a/drivers/misc/eeprom/at25.c
>> +++ b/drivers/misc/eeprom/at25.c
>> @@ -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) {
>> -- 
>> 2.25.1
>>
> 
> Looks good, now queued up.

Thanks Greg for patience and guiding me...
Jiri

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-06-11 14:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-11 14:27 [PATCH] nvmem: eeprom: at25: fix type compiler warnings Jiri Prchal
2021-06-11 14:45 ` Greg Kroah-Hartman
2021-06-11 14:47   ` Jiří Prchal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).