Skip to contentSkip to conversation

net: wwan: iosm: use int type to store negative error codes

PATCH Applied Qianfeng Rong 4 participants 4 messages Aug 26, 2025 – Aug 29, 2025

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: wwan: iosm: use int type to store negative error codes

The 'ret' variable in ipc_pcie_resources_request() either stores '-EBUSY' directly or holds returns from pci_request_regions() and ipc_acquire_irq(). Storing negative error codes in u32 causes no runtime issues but is stylistically inconsistent and very ugly. Change 'ret' from u32 to int type - this has no runtime impact.

---
 drivers/net/wwan/iosm/iosm_ipc_pcie.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wwan/iosm/iosm_ipc_pcie.c +1 -1
index a066977af0be..08ff0d6ccfab 100644
@@ -69,7 +69,7 @@ static int ipc_pcie_resources_request(struct iosm_pcie *ipc_pcie)
 {
 	struct pci_dev *pci = ipc_pcie->pci;
 	u32 cap = 0;
-	u32 ret;
+	int ret;
 
 	/* Reserved PCI I/O and memory resources.
 	 * Mark all PCI regions associated with PCI device pci as
Signature · 1 line
2.34.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Qianfeng Rong

The 'ret' variable in ipc_pcie_resources_request() either stores '-EBUSY' directly or holds returns from pci_request_regions() and ipc_acquire_irq(). Storing negative error codes in u32 causes no runtime issues but is stylistically inconsistent and very ugly. Change 'ret' from u32 to int type - this has no runtime impact.

Quoted 19 lines
 drivers/net/wwan/iosm/iosm_ipc_pcie.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wwan/iosm/iosm_ipc_pcie.c +1 -2
index a066977af0be..08ff0d6ccfab 100644
@@ -69,7 +69,7 @@ static int ipc_pcie_resources_request(struct iosm_pcie *ipc_pcie)
 {
        struct pci_dev *pci = ipc_pcie->pci;
        u32 cap = 0;
-       u32 ret;
+       int ret;
 
        /* Reserved PCI I/O and memory resources.
         * Mark all PCI regions associated with PCI device pci as
--

2.34.1

#2 lore raw
In reply to Qianfeng Rong
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 9 lines · On Tue, 26 Aug 2025 21:50:19 +0800 you wrote:

The 'ret' variable in ipc_pcie_resources_request() either stores '-EBUSY' directly or holds returns from pci_request_regions() and ipc_acquire_irq(). Storing negative error codes in u32 causes no runtime issues but is stylistically inconsistent and very ugly. Change 'ret' from u32 to int type - this has no runtime impact.

[...]

Here is the summary with links:
- net: wwan: iosm: use int type to store negative error codes

    https://git.kernel.org/netdev/net-next/c/f0c88a0d83b2

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
Reviewed-by on v1 1/1
#3 lore raw
In reply to Qianfeng Rong
Quoted 16 lines · Qianfeng Rong

The 'ret' variable in ipc_pcie_resources_request() either stores '-EBUSY' directly or holds returns from pci_request_regions() and ipc_acquire_irq(). Storing negative error codes in u32 causes no runtime issues but is stylistically inconsistent and very ugly. Change 'ret' from u32 to int type - this has no runtime impact.

---
  drivers/net/wwan/iosm/iosm_ipc_pcie.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wwan/iosm/iosm_ipc_pcie.c +0 -0
index a066977af0be..08ff0d6ccfab 100644

drivers/net/wwan/iosm/iosm_ipc_pcie.c static int ipc_pcie_resources_request(struct iosm_pcie *ipc_pcie) · line 75

Quoted 8 lines
drivers/net/wwan/iosm/iosm_ipc_pcie.c +1 -1
@@ -69,7 +69,7 @@ static int ipc_pcie_resources_request(struct iosm_pcie *ipc_pcie)
  {
  	struct pci_dev *pci = ipc_pcie->pci;
  	u32 cap = 0;
-	u32 ret;
+	int ret;
 
  	/* Reserved PCI I/O and memory resources.
  	 * Mark all PCI regions associated with PCI device pci as

Thanks,
Maciej