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 77AEFC7115C for ; Wed, 25 Jun 2025 12:21:45 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 2C23E61475; Wed, 25 Jun 2025 12:21:45 +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 XA9KS3Q3iJdP; Wed, 25 Jun 2025 12:21:44 +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 A197D6147E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1750854104; bh=6qZPz7zlI4ITsiBlD3QVSxcaXhHtDzUOHt/1AkdvUEo=; h=Date:From:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Ktr0swErNzf6r1iXCZiE/LO9iYLpE/rKVv5+RatGqUP7efiAVBKWODe+t1IWJ6+QK 33LxiY2zyq+uCeafBE5VJeZWD5qIdaukcxMM9WFWqFFxRhR95Kv2WxqWAoFAltyaAH 5lqYJCM6xcW1ITSeReFkWrpFGJ7IGqgCrOyApLxdHOhQbDxG0u6yjAR/YSMNQBYi7z 39cMoKMbiCt9CbaaPTQ+xrdlu9YSEPQ1jNHx/RXzhKZRC1okHZWbKlq0DEoCiUYNOh hxOne8BhyT4cByIyuUMqYKbwj3o2TNTPkBxUJYK+ccWe0iDEtFkVv/DD4mEmG3AvZp GT/M6+NvLuGZg== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp3.osuosl.org (Postfix) with ESMTP id A197D6147E; Wed, 25 Jun 2025 12:21:44 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) by lists1.osuosl.org (Postfix) with ESMTP id E1DF943F for ; Wed, 25 Jun 2025 12:21:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id CEDE983F73 for ; Wed, 25 Jun 2025 12:21:42 +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 YdSJ8xJ4sGwB for ; Wed, 25 Jun 2025 12:21:42 +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 3DBD283F6F DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 3DBD283F6F 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 3DBD283F6F for ; Wed, 25 Jun 2025 12:21:42 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id EB4B644CCA; Wed, 25 Jun 2025 12:21:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ABD96C4CEEA; Wed, 25 Jun 2025 12:21:39 +0000 (UTC) Date: Wed, 25 Jun 2025 13:21:37 +0100 From: Simon Horman To: Jacek Kowalski Cc: Tony Nguyen , Przemek Kitszel , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Message-ID: <20250625122137.GD1562@horms.kernel.org> References: <46b2b70d-bf53-4b0a-a9f3-dfd8493295b9@jacekk.info> <96d55057-28f3-4f77-b5ac-6f2b6769aeb5@jacekk.info> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <96d55057-28f3-4f77-b5ac-6f2b6769aeb5@jacekk.info> X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1750854101; bh=f8Gg0B0ETY0QdfV8ZauRjJQHPe3VqiRnhHvVy3Iu4TA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=p48+zz2nxK9ZkUx7/stu3afSzjVbDbl6PiqaTRATlK0NaXeZW5TzO5Jf3ZGj15rpB EquM4vuL3++P/8R0klSsixml46q9GKyJyQFQbLgM04aIidVkJtV6wtTJjV5gPp7gw2 VNQqsoiee3irexPZNXlWbN5YKp8brUdVuI2AS8Qozvn+2CefgvenBCykB6c6QKjKS3 w+CVZzpRE4gFANAS6GR8en73jOWm01yr91qfXln+NN41V/otJY+Uiq21aaqeHgVWsJ v4zlYnnnwVyoq2YE2MBYDEGPCbPVKDUKuC+k6dKOEK7Id7yqhSukUp6Awk+OajqmAt YVWJnlDY8x0TQ== 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, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=p48+zz2n Subject: Re: [Intel-wired-lan] [PATCH 3/4] igb: drop checksum constant cast to u16 in comparisons 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 Tue, Jun 24, 2025 at 09:30:44PM +0200, Jacek Kowalski wrote: As per my comment on patch 1/4, some text should go here. > Signed-off-by: Jacek Kowalski > Suggested-by: Simon Horman > --- > drivers/net/ethernet/intel/igb/e1000_82575.c | 2 +- > drivers/net/ethernet/intel/igb/e1000_nvm.c | 2 +- These changes look good to me, but I think we should also do: diff --git a/drivers/net/ethernet/intel/igb/e1000_82575.c b/drivers/net/ethernet/intel/igb/e1000_82575.c index 12ad1dc90169..44a85ad749a4 100644 --- a/drivers/net/ethernet/intel/igb/e1000_82575.c +++ b/drivers/net/ethernet/intel/igb/e1000_82575.c @@ -2406,7 +2406,7 @@ static s32 igb_update_nvm_checksum_with_offset(struct e1000_hw *hw, u16 offset) } checksum += nvm_data; } - checksum = (u16) NVM_SUM - checksum; + checksum = NVM_SUM - checksum; ret_val = hw->nvm.ops.write(hw, (NVM_CHECKSUM_REG + offset), 1, &checksum); if (ret_val) diff --git a/drivers/net/ethernet/intel/igb/e1000_nvm.c b/drivers/net/ethernet/intel/igb/e1000_nvm.c index e654310b1161..c8638502c2be 100644 --- a/drivers/net/ethernet/intel/igb/e1000_nvm.c +++ b/drivers/net/ethernet/intel/igb/e1000_nvm.c @@ -668,7 +668,7 @@ s32 igb_update_nvm_checksum(struct e1000_hw *hw) } checksum += nvm_data; } - checksum = (u16) NVM_SUM - checksum; + checksum = NVM_SUM - checksum; ret_val = hw->nvm.ops.write(hw, NVM_CHECKSUM_REG, 1, &checksum); if (ret_val) hw_dbg("NVM Write Error while updating checksum.\n"); From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5A63325BF19; Wed, 25 Jun 2025 12:21:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750854102; cv=none; b=pPt6bK34ek1KkISPzJKxr6RWC6UUovtQHQmk0BgOroDDxpI684vFJOaVz8qwxwx2I+xklh9j6jqUSej3qMGleB4E3tOU+43r3HPvxFCrp+hJv/goZ1Nx22XzLSYm7dFSR5+UPNk55fzmZWkOVfSxPjLt/aE4UfAabSD7GtnlxRE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750854102; c=relaxed/simple; bh=f8Gg0B0ETY0QdfV8ZauRjJQHPe3VqiRnhHvVy3Iu4TA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=c2RJDo2dCnFE3Gl5ihnBFWtdds3hjroSY3at6DsnpmnVaz6DeLb7wsnX9UPFlT5WZ9/HXi0eGAkgWDAsqTYKoci3BTnbQccWdHPLuNMoPsy0ephE65J8GiDr5B5FPeqhT6xrk6uoHZEZPKfRQxzCU3v7dLh6KzWX3IABsS0yuIs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=p48+zz2n; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="p48+zz2n" Received: by smtp.kernel.org (Postfix) with ESMTPSA id ABD96C4CEEA; Wed, 25 Jun 2025 12:21:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1750854101; bh=f8Gg0B0ETY0QdfV8ZauRjJQHPe3VqiRnhHvVy3Iu4TA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=p48+zz2nxK9ZkUx7/stu3afSzjVbDbl6PiqaTRATlK0NaXeZW5TzO5Jf3ZGj15rpB EquM4vuL3++P/8R0klSsixml46q9GKyJyQFQbLgM04aIidVkJtV6wtTJjV5gPp7gw2 VNQqsoiee3irexPZNXlWbN5YKp8brUdVuI2AS8Qozvn+2CefgvenBCykB6c6QKjKS3 w+CVZzpRE4gFANAS6GR8en73jOWm01yr91qfXln+NN41V/otJY+Uiq21aaqeHgVWsJ v4zlYnnnwVyoq2YE2MBYDEGPCbPVKDUKuC+k6dKOEK7Id7yqhSukUp6Awk+OajqmAt YVWJnlDY8x0TQ== Date: Wed, 25 Jun 2025 13:21:37 +0100 From: Simon Horman To: Jacek Kowalski Cc: Tony Nguyen , Przemek Kitszel , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/4] igb: drop checksum constant cast to u16 in comparisons Message-ID: <20250625122137.GD1562@horms.kernel.org> References: <46b2b70d-bf53-4b0a-a9f3-dfd8493295b9@jacekk.info> <96d55057-28f3-4f77-b5ac-6f2b6769aeb5@jacekk.info> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <96d55057-28f3-4f77-b5ac-6f2b6769aeb5@jacekk.info> On Tue, Jun 24, 2025 at 09:30:44PM +0200, Jacek Kowalski wrote: As per my comment on patch 1/4, some text should go here. > Signed-off-by: Jacek Kowalski > Suggested-by: Simon Horman > --- > drivers/net/ethernet/intel/igb/e1000_82575.c | 2 +- > drivers/net/ethernet/intel/igb/e1000_nvm.c | 2 +- These changes look good to me, but I think we should also do: diff --git a/drivers/net/ethernet/intel/igb/e1000_82575.c b/drivers/net/ethernet/intel/igb/e1000_82575.c index 12ad1dc90169..44a85ad749a4 100644 --- a/drivers/net/ethernet/intel/igb/e1000_82575.c +++ b/drivers/net/ethernet/intel/igb/e1000_82575.c @@ -2406,7 +2406,7 @@ static s32 igb_update_nvm_checksum_with_offset(struct e1000_hw *hw, u16 offset) } checksum += nvm_data; } - checksum = (u16) NVM_SUM - checksum; + checksum = NVM_SUM - checksum; ret_val = hw->nvm.ops.write(hw, (NVM_CHECKSUM_REG + offset), 1, &checksum); if (ret_val) diff --git a/drivers/net/ethernet/intel/igb/e1000_nvm.c b/drivers/net/ethernet/intel/igb/e1000_nvm.c index e654310b1161..c8638502c2be 100644 --- a/drivers/net/ethernet/intel/igb/e1000_nvm.c +++ b/drivers/net/ethernet/intel/igb/e1000_nvm.c @@ -668,7 +668,7 @@ s32 igb_update_nvm_checksum(struct e1000_hw *hw) } checksum += nvm_data; } - checksum = (u16) NVM_SUM - checksum; + checksum = NVM_SUM - checksum; ret_val = hw->nvm.ops.write(hw, NVM_CHECKSUM_REG, 1, &checksum); if (ret_val) hw_dbg("NVM Write Error while updating checksum.\n");