Skip to contentSkip to conversation

scsi: BusLogic: use %X for u32 sized integer rather than %lX

PATCH Applied Colin King 4 participants 4 messages Jul 30, 2021 – Aug 2, 2021

Subsystems (3)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 scsi: BusLogic: use %X for u32 sized integer rather than %lX

From: Colin Ian King <[email protected]>

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")
---
 drivers/scsi/BusLogic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/BusLogic.c +1 -1
index adddcd589941..bd615db5c58c 100644
@@ -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);
Signature · 1 line
2.31.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 19 lines · Colin King

From: Colin Ian King <[email protected]>

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")
---
 drivers/scsi/BusLogic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/BusLogic.c +0 -0
index adddcd589941..bd615db5c58c 100644

drivers/scsi/BusLogic.c static bool __init blogic_reportconfig(struct blogic_adapter *adapter) · line 1717

Quoted 8 lines
drivers/scsi/BusLogic.c +1 -1
@@ -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 lore raw
In reply to Colin King

Colin,

Quoted 3 lines

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!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering
#3 lore raw
In reply to Colin King

From: Colin King

Quoted 7 lines

Sent: 30 July 2021 10:51

From: Colin Ian King <[email protected]>

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)