From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B46A9E85367 for ; Fri, 3 Apr 2026 13:41:43 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 6E15260E2E; Fri, 3 Apr 2026 13:41:42 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id uVx35PjJ_tFc; Fri, 3 Apr 2026 13:41:41 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org A3A4D60BC3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1775223701; bh=PUiPlppH9uGZasUaXEhKYQJxXuuOtwJaSaTZyIjRQs0=; h=Date:From:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=YTQxnxMe+rMvtgsNY4doUdiXlY5KsviurIIr5QEoPpG9SEgFuQMKWvkwi3Cbu2QTX 7iKQg4NyCB0OjLrgop8XEP+QCSyB7Y0aldGDgnEbsydnATCuLCVUBBvMgn4RMyO+Kk 2v78eOoQjzErkd2A8BVq2RnoyX02+PsVksasEJqa8FJCgAu3O5oWCI/4UeqhHMISQp zoeKdQL8BqC1XSv81c5b/FXn6r9WTmaWsyJaNdfs3E5T0Ae55S7BAssYdUFxd9Q+M0 ESC3GrXeeDIaP/ChrB/7dhHupP5rJjL2bECOQ7aZ+f1Vse/rj3So3OsIBaKmBGustb 92t9CIn4rhXPg== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp3.osuosl.org (Postfix) with ESMTP id A3A4D60BC3; Fri, 3 Apr 2026 13:41:41 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists1.osuosl.org (Postfix) with ESMTP id 3EB012CC for ; Fri, 3 Apr 2026 13:41:40 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 3085C813BA for ; Fri, 3 Apr 2026 13:41:40 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id P0IoX9Qp2I4I for ; Fri, 3 Apr 2026 13:41:39 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2600:3c0a:e001:78e:0:1991:8:25; helo=sea.source.kernel.org; envelope-from=horms@kernel.org; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org 3B33E81339 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 3B33E81339 Received: from sea.source.kernel.org (sea.source.kernel.org [IPv6:2600:3c0a:e001:78e:0:1991:8:25]) by smtp1.osuosl.org (Postfix) with ESMTPS id 3B33E81339 for ; Fri, 3 Apr 2026 13:41:39 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id E2C0B406E3; Fri, 3 Apr 2026 13:41:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CB98CC4CEF7; Fri, 3 Apr 2026 13:41:37 +0000 (UTC) Date: Fri, 3 Apr 2026 14:41:35 +0100 From: Simon Horman To: Aleksandr Loktionov Cc: intel-wired-lan@lists.osuosl.org, anthony.l.nguyen@intel.com, netdev@vger.kernel.org Message-ID: <20260403134135.GF113102@horms.kernel.org> References: <20260327073046.134085-1-aleksandr.loktionov@intel.com> <20260327073046.134085-9-aleksandr.loktionov@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260327073046.134085-9-aleksandr.loktionov@intel.com> X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775223698; bh=qkkNXg8SORBJx4yNPcKd2O3V2nNnyEmd9wSwLv2f9wE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mdZ+71BlBuJBkHPFuJPR6nXGwZZqPOBsU3OcYWzeTcyGOjU6ATCkjXxE/XGGMn6hS X2AYVKn/Y2nE5BTJt7w0kKLVutj/6XVKcWGB+fZkZPhljlvbpVi3hiSDu3meamTv9k cw9a3vE11fgJFYl1K6D0H33Lnvvfnv9KXimwLtvYZ58BLDdzSelkqtESNUETcLEvhW 9UiO0PYYWfZ9WwqlC7SoPxA7BDaDs4qhXo/W+ujybjqkjjrjLLCQhbv1o0Ph6CpMZA imUjval8xBSFm4HFe2pwmTxLQJktnOcYRHZlFlJT+a8sYSq3hmH54TNyE89GuKuJ0j ynGXbCfXnoIdg== X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=mdZ+71Bl Subject: Re: [Intel-wired-lan] [PATCH iwl-next] ixgbe: use int instead of u32 for error code variables X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" On Fri, Mar 27, 2026 at 08:30:43AM +0100, Aleksandr Loktionov wrote: > The variables used to store return values of kernel and driver functions > throughout the ixgbe driver are declared as u32 in several places. Such > functions return negative errno values on error (e.g. -EIO, -EFAULT), > which are sign-extended negative integers. 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 would produce wrong results. > > In the Linux kernel, u32 is reserved for fixed-width quantities used in > hardware interfaces or protocol structures. Using it for generic error > codes misleads reviewers into thinking the value is hardware-constrained. > > Change all such local variables from u32 to int driver-wide: one in > ixgbe_main.c (ixgbe_resume), three in ixgbe_phy.c > (ixgbe_identify_phy_generic, ixgbe_tn_check_overtemp, > ixgbe_set_copper_phy_power), and six in ixgbe_x550.c > (ixgbe_check_link_t_X550em, ixgbe_get_lasi_ext_t_x550em, > ixgbe_enable_lasi_ext_t_x550em, ixgbe_handle_lasi_ext_t_x550em, > ixgbe_ext_phy_t_x550em_get_link, ixgbe_setup_internal_phy_t_x550em). > > No functional change. > > Signed-off-by: Aleksandr Loktionov Nice cleanup, thanks. Reviewed-by: Simon Horman