All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 net] ionic: use int type for err in ionic_get_module_eeprom_by_page
@ 2025-09-12 14:14 Alok Tiwari
  2025-09-12 17:02 ` Brett Creeley
  2025-09-14 20:30 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Alok Tiwari @ 2025-09-12 14:14 UTC (permalink / raw)
  To: sln, brett.creeley, andrew+netdev, davem, edumazet, kuba, pabeni,
	horms, netdev
  Cc: alok.a.tiwari

The variable 'err' is declared as u32, but it is used to store
negative error codes such as -EINVAL.

Changing the type of 'err' to int ensures proper representation of
negative error codes and aligns with standard kernel error handling
conventions.

Also, there is no need to initialize 'err' since it is always set
before being used.

Fixes: c51ab838f532 ("ionic: extend the QSFP module sprom for more pages")
Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
Reviewed-by: Shannon Nelson <sln@onemain.com>
---
v1 -> v2
Made 'err' uninitialized as suggested by Brett
added Reviewed-by: Shannon
---
 drivers/net/ethernet/pensando/ionic/ionic_ethtool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
index 92f30ff2d631..2d9efadb5d2a 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
+++ b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
@@ -978,7 +978,7 @@ static int ionic_get_module_eeprom_by_page(struct net_device *netdev,
 {
 	struct ionic_lif *lif = netdev_priv(netdev);
 	struct ionic_dev *idev = &lif->ionic->idev;
-	u32 err = -EINVAL;
+	int err;
 	u8 *src;
 
 	if (!page_data->length)
-- 
2.50.1


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

* Re: [PATCH v2 net] ionic: use int type for err in ionic_get_module_eeprom_by_page
  2025-09-12 14:14 [PATCH v2 net] ionic: use int type for err in ionic_get_module_eeprom_by_page Alok Tiwari
@ 2025-09-12 17:02 ` Brett Creeley
  2025-09-14 20:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Brett Creeley @ 2025-09-12 17:02 UTC (permalink / raw)
  To: Alok Tiwari, sln, brett.creeley, andrew+netdev, davem, edumazet,
	kuba, pabeni, horms, netdev



On 9/12/2025 7:14 AM, Alok Tiwari wrote:
> Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
> 
> 
> The variable 'err' is declared as u32, but it is used to store
> negative error codes such as -EINVAL.
> 
> Changing the type of 'err' to int ensures proper representation of
> negative error codes and aligns with standard kernel error handling
> conventions.
> 
> Also, there is no need to initialize 'err' since it is always set
> before being used.
> 
> Fixes: c51ab838f532 ("ionic: extend the QSFP module sprom for more pages")
> Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
> Reviewed-by: Shannon Nelson <sln@onemain.com>
> ---
> v1 -> v2
> Made 'err' uninitialized as suggested by Brett
> added Reviewed-by: Shannon
> ---
>   drivers/net/ethernet/pensando/ionic/ionic_ethtool.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
> index 92f30ff2d631..2d9efadb5d2a 100644
> --- a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
> +++ b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
> @@ -978,7 +978,7 @@ static int ionic_get_module_eeprom_by_page(struct net_device *netdev,
>   {
>          struct ionic_lif *lif = netdev_priv(netdev);
>          struct ionic_dev *idev = &lif->ionic->idev;
> -       u32 err = -EINVAL;
> +       int err;

Thanks again.

Reviewed-by: Brett Creeley <brett.creeley@amd.com>
>          u8 *src;
> 
>          if (!page_data->length)
> --
> 2.50.1
> 

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

* Re: [PATCH v2 net] ionic: use int type for err in ionic_get_module_eeprom_by_page
  2025-09-12 14:14 [PATCH v2 net] ionic: use int type for err in ionic_get_module_eeprom_by_page Alok Tiwari
  2025-09-12 17:02 ` Brett Creeley
@ 2025-09-14 20:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-09-14 20:30 UTC (permalink / raw)
  To: Alok Tiwari
  Cc: sln, brett.creeley, andrew+netdev, davem, edumazet, kuba, pabeni,
	horms, netdev

Hello:

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

On Fri, 12 Sep 2025 07:14:24 -0700 you wrote:
> The variable 'err' is declared as u32, but it is used to store
> negative error codes such as -EINVAL.
> 
> Changing the type of 'err' to int ensures proper representation of
> negative error codes and aligns with standard kernel error handling
> conventions.
> 
> [...]

Here is the summary with links:
  - [v2,net] ionic: use int type for err in ionic_get_module_eeprom_by_page
    https://git.kernel.org/netdev/net-next/c/d586676a2714

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] 3+ messages in thread

end of thread, other threads:[~2025-09-14 20:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-12 14:14 [PATCH v2 net] ionic: use int type for err in ionic_get_module_eeprom_by_page Alok Tiwari
2025-09-12 17:02 ` Brett Creeley
2025-09-14 20:30 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.