Article View: linux.kernel.netdev
Article #27537Re: [PATCH net-next 3/5] ixgbe: use int instead of u32 for error code variables
From: netdev-bot+sashiko
Date: Sat, 05 Dec 2026 22:47
Date: Sat, 05 Dec 2026 22:47
63 lines
10187 bytes
10187 bytes
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
Technical Details
Message-ID:
<179651085848.3148.2212941005956083948@kernel.org>Path:
mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-mo.newsdeef.eu!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-378167-linux-kernel-netdev=dewy.ruReferences:
<20261204223807.3920143-4-anthony.l.nguyen@intel.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-mo.newsdeef.eu!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-378167-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev 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 Organization: Usenet Network Message-ID: <179651085848.3148.2212941005956083948@kernel.org> References: <20261204223807.3920143-4-anthony.l.nguyen@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="3136710"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:MhvIkq/rtXX9s6lbvSI0bnHLXg8= sha256:bc4ldoYvqkhJxy5QE9JdzBIPb4C5Z+A/gZIsBQcVj9k= sha1:+redS1iMQpFuERfttKE31J9wOPk= sha256:hS2PE9jafZavYnRdxb/7d2cLiCMOE2w6Fh2weoZqICk= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id BC94B117EE1; Sun, 6 Dec 2026 01:47:55 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.639 X-Spam-Status: No, score=-3.639 tagged_above=-9999 required=6.31 tests=[DKIMWL_WL_HIGH=-0.14, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zq6ASSNZaRel; Sun, 6 Dec 2026 01:47:52 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-378167-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mail.dewy.ru (Postfix) with ESMTPS id C1127117EDD; Sun, 6 Dec 2026 01:47:43 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sto.lore.kernel.org (Postfix) with ESMTP id D4398605EBB; Sat, 5 Dec 2026 22:47:41 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796510860; b=s18sPoG+Ijhl2kUEh9vYoTluzqN0rQqSMlBK+7IiqDW1wUT2bTYdOxK3ZEaJUDQl0Jlb w7/utIRi8LvF2EnBamy0/ctEa9WKWT76ExGHV2oc4UOxYk3I/CBQlFrS6I0e4FDoDHDWU iqDj0gUq3UpAhDTTt81t/oFT7FQiUG5fMmrMpsH5LmDFaUOg16AyN1aHok4z78VGmL4MY lkUPGo392iO9BE9iD5b1MavIQgcQwCDyLIaMYZJJ0hmtO6L7vz3MnLaYAMO2zMngJ5bPy bTPowjgrAT8B13NfhE11K1zM9V0GPMMaY2ibDNADDxYETdvslv/i08Odhxoq1VJleFw== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796510860; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=ohR517/fFdmfAWZq1nsG4snZUrulwjyu6lskroUNZ2k=; b=BjjjyaGF21AZGOEnvnKJFwLoJXnCf2CRSLwuDuaIdWOzfeAD0pAPT8XfqC16eqpRNpUq nA3ombEiM615EfJiuSwibMJAvDgWWE2yrGQcZtSw3y5PX/JDkXKtPB3pjCKYPjXeleTA6 B3H+lR++zueKWeGt35iiwrlMcET75FTZs0KIdV3kIXon6b4iswjDoC5YDhyn0sj5kwx9v 3CR4OFo+ZKjfswbi/X+HZ2d8Q8HqBeWxtr4AZ3CfPv4VyyBsW2qAVpOoMsnOFHOfUbKSy GxQ8jrgp38+8zQVRaN2dE0yEH+WIr5/yHF8YlxG4UIq1kQtjkxcj3Vl0okputJUhPYQ== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=fZURL3wC; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BA7D4606A335; Sat, 5 Dec 2026 22:47:40 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=fZURL3wC X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796510859; b=CuioDP4cR65MKKg6HrrigmyADLfltC9l7mkZqQACMwu0SXjLzq7Bo59A5pRTBktq8UmO Gjc8LWTL7NvqVAC2wRsr2qH3zWysSLRDEeCgIL0R7o89u1v22prTj+MXHJQYxMJ7Qis8M v+KGsL2Erg9PJK2RI7+kPPeLBZyoBGgyzIemik1UPcgmAvodZYePykyhLme4Owkf5ZEMt RMc8mvWVCal7Wg0pIjq0uookObd4oRjvoMVWbzL3OD000WvH29vIEwFdAWuYkf5a1zAX6 X7oii4IZv8K4Cc6RX8QCZqgx/2VCIqdyG3+Dx+4kI4NhzH4S3OO3KL8lizjmZfS0WBw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796510859; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=ohR517/fFdmfAWZq1nsG4snZUrulwjyu6lskroUNZ2k=; b=U50cA/NV3TaUAVwk8noHFtnsPmP86GdMKzlJ21XnLsTMLde7LgOwAShUTa3etl4DD5ZZ BO1+iC8wj++F+Qdz/DPI9UAwoXcOVkuGZUL+kNh244DFyrjltfooeyZ7TF8U83QeJIM3y DltNwyINxdOgPydC1Cff3zBmc27KE5eHgGmPw4tt95kbd2xF6FYW86JJnhjkFcqMUtneG i4hjc+guBlYnDx0WKZkRbVaVEk7QoTxCY3/PgcyI5lYZv5n8XKRf5sgybW6/1uD6fn0bR loPHaAHo+He13Gu2LCph1WE4TROY/MXns8hJ+ndVigNmQelECnDfCZ/+Grcm3+468Cg== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=fZURL3wC; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DC19C606A337 for <netdev@vger.kernel.org>; Sat, 5 Dec 2026 22:47:39 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC8811F0092B; Sat, 5 Dec 2026 22:47:38 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796510859; bh=ohR517/fFdmfAWZq1nsG4snZUrulwjyu6lskroUNZ2k=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=fZURL3wC2SJA0WGy54AsTS3oWxmwcEdPgH2hDV+QVvDMzUQLSLW1rNTlTQLR2fWXt Oq2HzI14UBfm0F/py91L+BAsgSyt4qJNmmn2HaZ7r+qLRR8kQcGziioPAY0zNM0znG 7zIOSqEc4SPWjEHlyZWoadAEAlNNN83EC6nIaKEqwRdS147cShJG6oO1dWTgvwhDJ+ K+eV6P3aVFY+Hz1jM8xzu//QsWKmvonnpBJ9nrNJU4HisdocVIngBFMctYX+jwzD0n hly2Rp9oh6jzV2vqYURlT56wl0etjB6s4IKRoqP90dE/r2gb79DOuxLSpBlocpci5i QJu56ozJ4AZBA== X-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 X-In-Reply-To: <20261204223807.3920143-4-anthony.l.nguyen@intel.com> X-sashiko-severity: Low X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list