linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: BusLogic: use %X for u32 sized integer rather than %lX
@ 2021-07-30  9:50 Colin King
  2021-07-30 21:57 ` Khalid Aziz
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Colin King @ 2021-07-30  9:50 UTC (permalink / raw)
  To: Khalid Aziz, James E . J . Bottomley, Martin K . Petersen, linux-scsi
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

An earlier fix changed the print format specifier for adapter->bios_addr
to use %lX however the integer is a u32 so the fix was wrong. Fix this
by using the correct %X format specifier.

Addresses-Coverity: ("Invalid type in argument")
Fixes: 43622697117c ("scsi: BusLogic: use %lX for unsigned long rather than %X")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/scsi/BusLogic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/BusLogic.c b/drivers/scsi/BusLogic.c
index adddcd589941..bd615db5c58c 100644
--- a/drivers/scsi/BusLogic.c
+++ b/drivers/scsi/BusLogic.c
@@ -1711,7 +1711,7 @@ static bool __init blogic_reportconfig(struct blogic_adapter *adapter)
 	if (adapter->adapter_bus_type != BLOGIC_PCI_BUS) {
 		blogic_info("  DMA Channel: None, ", adapter);
 		if (adapter->bios_addr > 0)
-			blogic_info("BIOS Address: 0x%lX, ", adapter,
+			blogic_info("BIOS Address: 0x%X, ", adapter,
 					adapter->bios_addr);
 		else
 			blogic_info("BIOS Address: None, ", adapter);
-- 
2.31.1


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

* Re: [PATCH] scsi: BusLogic: use %X for u32 sized integer rather than %lX
  2021-07-30  9:50 [PATCH] scsi: BusLogic: use %X for u32 sized integer rather than %lX Colin King
@ 2021-07-30 21:57 ` Khalid Aziz
  2021-08-01 17:28 ` Martin K. Petersen
  2021-08-02  8:11 ` David Laight
  2 siblings, 0 replies; 4+ messages in thread
From: Khalid Aziz @ 2021-07-30 21:57 UTC (permalink / raw)
  To: Colin King, James E . J . Bottomley, Martin K . Petersen, linux-scsi
  Cc: kernel-janitors, linux-kernel

On 7/30/21 3:50 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> An earlier fix changed the print format specifier for adapter->bios_addr
> to use %lX however the integer is a u32 so the fix was wrong. Fix this
> by using the correct %X format specifier.
> 
> Addresses-Coverity: ("Invalid type in argument")
> Fixes: 43622697117c ("scsi: BusLogic: use %lX for unsigned long rather than %X")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/scsi/BusLogic.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/BusLogic.c b/drivers/scsi/BusLogic.c
> index adddcd589941..bd615db5c58c 100644
> --- a/drivers/scsi/BusLogic.c
> +++ b/drivers/scsi/BusLogic.c
> @@ -1711,7 +1711,7 @@ static bool __init blogic_reportconfig(struct blogic_adapter *adapter)
>  	if (adapter->adapter_bus_type != BLOGIC_PCI_BUS) {
>  		blogic_info("  DMA Channel: None, ", adapter);
>  		if (adapter->bios_addr > 0)
> -			blogic_info("BIOS Address: 0x%lX, ", adapter,
> +			blogic_info("BIOS Address: 0x%X, ", adapter,
>  					adapter->bios_addr);
>  		else
>  			blogic_info("BIOS Address: None, ", adapter);
> 

Acked-by: Khalid Aziz <khalid@gonehiking.org>

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

* Re: [PATCH] scsi: BusLogic: use %X for u32 sized integer rather than %lX
  2021-07-30  9:50 [PATCH] scsi: BusLogic: use %X for u32 sized integer rather than %lX Colin King
  2021-07-30 21:57 ` Khalid Aziz
@ 2021-08-01 17:28 ` Martin K. Petersen
  2021-08-02  8:11 ` David Laight
  2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2021-08-01 17:28 UTC (permalink / raw)
  To: Colin King
  Cc: Khalid Aziz, James E . J . Bottomley, Martin K . Petersen,
	linux-scsi, kernel-janitors, linux-kernel


Colin,

> An earlier fix changed the print format specifier for
> adapter->bios_addr to use %lX however the integer is a u32 so the fix
> was wrong. Fix this by using the correct %X format specifier.

Applied to 5.15/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* RE: [PATCH] scsi: BusLogic: use %X for u32 sized integer rather than %lX
  2021-07-30  9:50 [PATCH] scsi: BusLogic: use %X for u32 sized integer rather than %lX Colin King
  2021-07-30 21:57 ` Khalid Aziz
  2021-08-01 17:28 ` Martin K. Petersen
@ 2021-08-02  8:11 ` David Laight
  2 siblings, 0 replies; 4+ messages in thread
From: David Laight @ 2021-08-02  8:11 UTC (permalink / raw)
  To: 'Colin King',
	Khalid Aziz, James E . J . Bottomley, Martin K . Petersen,
	linux-scsi
  Cc: kernel-janitors, linux-kernel

From: Colin King
> Sent: 30 July 2021 10:51
> 
> From: Colin Ian King <colin.king@canonical.com>
> 
> An earlier fix changed the print format specifier for adapter->bios_addr
> to use %lX however the integer is a u32 so the fix was wrong. Fix this
> by using the correct %X format specifier.

Is that right?
I bet one 32bit arch defines u32 as long.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

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

end of thread, other threads:[~2021-08-02  8:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-30  9:50 [PATCH] scsi: BusLogic: use %X for u32 sized integer rather than %lX Colin King
2021-07-30 21:57 ` Khalid Aziz
2021-08-01 17:28 ` Martin K. Petersen
2021-08-02  8:11 ` David Laight

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).