linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: wwan: iosm: use int type to store negative error codes
@ 2025-08-26 13:50 Qianfeng Rong
  2025-08-27 13:27 ` Loic Poulain
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Qianfeng Rong @ 2025-08-26 13:50 UTC (permalink / raw)
  To: Loic Poulain, Sergey Ryazanov, Johannes Berg, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Maciej S. Szmigiero, netdev, linux-kernel
  Cc: 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.

Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
---
 drivers/net/wwan/iosm/iosm_ipc_pcie.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wwan/iosm/iosm_ipc_pcie.c b/drivers/net/wwan/iosm/iosm_ipc_pcie.c
index a066977af0be..08ff0d6ccfab 100644
--- a/drivers/net/wwan/iosm/iosm_ipc_pcie.c
+++ b/drivers/net/wwan/iosm/iosm_ipc_pcie.c
@@ -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


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

* Re: [PATCH] net: wwan: iosm: use int type to store negative error codes
  2025-08-26 13:50 [PATCH] net: wwan: iosm: use int type to store negative error codes Qianfeng Rong
@ 2025-08-27 13:27 ` Loic Poulain
  2025-08-28  1:30 ` patchwork-bot+netdevbpf
  2025-08-29  9:01 ` Maciej S. Szmigiero
  2 siblings, 0 replies; 4+ messages in thread
From: Loic Poulain @ 2025-08-27 13:27 UTC (permalink / raw)
  To: Qianfeng Rong
  Cc: Sergey Ryazanov, Johannes Berg, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Maciej S. Szmigiero,
	netdev, linux-kernel

On Tue, Aug 26, 2025 at 3:50 PM Qianfeng Rong <rongqianfeng@vivo.com> 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.
>
> Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>

Reviewed-by: Loic Poulain <loic.poulain@oss.qualcomm.com>

>  drivers/net/wwan/iosm/iosm_ipc_pcie.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/wwan/iosm/iosm_ipc_pcie.c b/drivers/net/wwan/iosm/iosm_ipc_pcie.c
> index a066977af0be..08ff0d6ccfab 100644
> --- a/drivers/net/wwan/iosm/iosm_ipc_pcie.c
> +++ b/drivers/net/wwan/iosm/iosm_ipc_pcie.c
> @@ -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
>

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

* Re: [PATCH] net: wwan: iosm: use int type to store negative error codes
  2025-08-26 13:50 [PATCH] net: wwan: iosm: use int type to store negative error codes Qianfeng Rong
  2025-08-27 13:27 ` Loic Poulain
@ 2025-08-28  1:30 ` patchwork-bot+netdevbpf
  2025-08-29  9:01 ` Maciej S. Szmigiero
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-08-28  1:30 UTC (permalink / raw)
  To: Qianfeng Rong
  Cc: loic.poulain, ryazanov.s.a, johannes, andrew+netdev, davem,
	edumazet, kuba, pabeni, mail, netdev, linux-kernel

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

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.
> 
> Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
> 
> [...]

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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

* Re: [PATCH] net: wwan: iosm: use int type to store negative error codes
  2025-08-26 13:50 [PATCH] net: wwan: iosm: use int type to store negative error codes Qianfeng Rong
  2025-08-27 13:27 ` Loic Poulain
  2025-08-28  1:30 ` patchwork-bot+netdevbpf
@ 2025-08-29  9:01 ` Maciej S. Szmigiero
  2 siblings, 0 replies; 4+ messages in thread
From: Maciej S. Szmigiero @ 2025-08-29  9:01 UTC (permalink / raw)
  To: Qianfeng Rong
  Cc: Loic Poulain, Sergey Ryazanov, Johannes Berg, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	netdev, linux-kernel

On 26.08.2025 15:50, Qianfeng Rong 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.
> 
> Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
> ---
>   drivers/net/wwan/iosm/iosm_ipc_pcie.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wwan/iosm/iosm_ipc_pcie.c b/drivers/net/wwan/iosm/iosm_ipc_pcie.c
> index a066977af0be..08ff0d6ccfab 100644
> --- a/drivers/net/wwan/iosm/iosm_ipc_pcie.c
> +++ b/drivers/net/wwan/iosm/iosm_ipc_pcie.c
> @@ -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

Reviewed-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com>

Thanks,
Maciej


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

end of thread, other threads:[~2025-08-29  9:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-26 13:50 [PATCH] net: wwan: iosm: use int type to store negative error codes Qianfeng Rong
2025-08-27 13:27 ` Loic Poulain
2025-08-28  1:30 ` patchwork-bot+netdevbpf
2025-08-29  9:01 ` Maciej S. Szmigiero

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