All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brett Creeley <bcreeley@amd.com>
To: Alok Tiwari <alok.a.tiwari@oracle.com>,
	sln@onemain.com, brett.creeley@amd.com, andrew+netdev@lunn.ch,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, horms@kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH v2 net] ionic: use int type for err in ionic_get_module_eeprom_by_page
Date: Fri, 12 Sep 2025 10:02:13 -0700	[thread overview]
Message-ID: <f654f6fe-defb-4bdd-b4a3-7228ff5b5f8e@amd.com> (raw)
In-Reply-To: <20250912141426.3922545-1-alok.a.tiwari@oracle.com>



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
> 

  reply	other threads:[~2025-09-12 17:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2025-09-14 20:30 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f654f6fe-defb-4bdd-b4a3-7228ff5b5f8e@amd.com \
    --to=bcreeley@amd.com \
    --cc=alok.a.tiwari@oracle.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=brett.creeley@amd.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sln@onemain.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.