Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: anthony.l.nguyen@intel.com
Cc: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
	edumazet@kernel.org, andrew+netdev@lunn.ch, willemb@google.com,
	netdev@vger.kernel.org, adiyenga@cisco.com,
	jedrzej.jagielski@intel.com, jacob.e.keller@intel.com,
	aleksandr.loktionov@intel.com, rafal.romanowski@intel.com
Subject: Re: [PATCH net-next 3/5] ixgbe: use int instead of u32 for error code variables
Date: Sat, 05 Dec 2026 22:47:38 +0000	[thread overview]
Message-ID: <179651085848.3148.2212941005956083948@kernel.org> (raw)
In-Reply-To: <20261204223807.3920143-4-anthony.l.nguyen@intel.com>

Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] The rationale in the commit message for "ixgbe: use int instead
  of u32 for error code variables" is factually wrong, and it reads as…

--

ixgbe: use int instead of u32 for error code variables

This commit changes ten local variables in ixgbe_main.c, ixgbe_phy.c and
ixgbe_x550.c from u32 to int, because they hold negative errno return
values. The commit message says there is no functional change.

> Storing them in an unsigned
> u32 silently wraps the value: -EIO (0xFFFFFFF7) stored in u32 becomes a
> large positive number, so any "if (status)" truthiness check still works
> by accident, but comparisons against specific negative error codes or
> propagation up the call stack produce wrong results.

[Severity: Low]
Is the hex value here correct? EIO is 5, so -EIO as a 32-bit value is
0xFFFFFFFB. 0xFFFFFFF7 is -9, which is -EBADF.

Does the rest of this paragraph match the code being changed?

Each changed variable is returned from a function declared to return int.
Converting from u32 back to int gives the original negative errno.

Equality checks such as status == -EIO also still work, because -EIO is
converted to unsigned for the comparison. Only a relational check such as
status < 0 would give a wrong result.

None of the ten functions touched here does a relational comparison on
these variables. For example, ixgbe_resume() only tests err for truth and
returns it:

	err = pci_enable_device_mem(pdev);
	if (err) {
		e_dev_err("Cannot enable PCI device from suspend\n");
		return err;
	}
	...
	if (!err)
		netif_device_attach(netdev);
	rtnl_unlock();

	return err;

The other functions follow the same if (status) / return status pattern.
That appears to contradict the later statement:

> No functional change.

Could the rationale be limited to type correctness and readability, so
that it doesn't read as though an existing runtime bug is being fixed?

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261204223807.3920143-1-anthony.l.nguyen%40intel.com

  reply	other threads:[~2026-12-05 22:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04 22:38 [PATCH net-next 0/5][pull request] Intel Wired LAN Driver Updates 2026-12-04 (ixgbe, ixgbevf) Tony Nguyen
2026-12-04 22:38 ` [PATCH net-next 1/5] ixgbe: E610: force phy link to get down when interface is down Tony Nguyen
2026-12-05 22:47   ` netdev-bot+sashiko
2026-12-04 22:38 ` [PATCH net-next 2/5] ixgbe: use ktime_get_real_ns() in ixgbe_ptp_reset() Tony Nguyen
2026-12-04 22:38 ` [PATCH net-next 3/5] ixgbe: use int instead of u32 for error code variables Tony Nguyen
2026-12-05 22:47   ` netdev-bot+sashiko [this message]
2026-12-04 22:38 ` [PATCH net-next 4/5] ixgbe: LinkSec deprecated macros cleanup Tony Nguyen
2026-12-04 22:38 ` [PATCH net-next 5/5] ixgbevf: Warn when mailbox API negotiation fails Tony Nguyen
2026-12-05 22:47   ` netdev-bot+sashiko

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=179651085848.3148.2212941005956083948@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=adiyenga@cisco.com \
    --cc=aleksandr.loktionov@intel.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=anthony.l.nguyen@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=jacob.e.keller@intel.com \
    --cc=jedrzej.jagielski@intel.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rafal.romanowski@intel.com \
    --cc=willemb@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox