public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: David Laight <david.laight.linux@gmail.com>
To: Simon Horman <horms@kernel.org>
Cc: Jacek Kowalski <jacek@jacekk.info>,
	Tony Nguyen <anthony.l.nguyen@intel.com>,
	Przemek Kitszel <przemyslaw.kitszel@intel.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/4] igc: drop checksum constant cast to u16 in comparisons
Date: Wed, 25 Jun 2025 17:12:14 +0100	[thread overview]
Message-ID: <20250625171214.5d752668@pumpkin> (raw)
In-Reply-To: <20250625122239.GE1562@horms.kernel.org>

On Wed, 25 Jun 2025 13:22:39 +0100
Simon Horman <horms@kernel.org> wrote:

> On Tue, Jun 24, 2025 at 09:31:08PM +0200, Jacek Kowalski wrote:
> > Signed-off-by: Jacek Kowalski <Jacek@jacekk.info>
> > Suggested-by: Simon Horman <horms@kernel.org>
> > ---
> >  drivers/net/ethernet/intel/igc/igc_nvm.c | 2 +-  
> 
> I think we should add this:
> 
> diff --git a/drivers/net/ethernet/intel/igc/igc_nvm.c b/drivers/net/ethernet/intel/igc/igc_nvm.c
> index c4fb35071636..a47b8d39238c 100644
> --- a/drivers/net/ethernet/intel/igc/igc_nvm.c
> +++ b/drivers/net/ethernet/intel/igc/igc_nvm.c
> @@ -155,7 +155,7 @@ s32 igc_update_nvm_checksum(struct igc_hw *hw)
>  		}
>  		checksum += nvm_data;
>  	}
> -	checksum = (u16)NVM_SUM - checksum;
> +	checksum = NVM_SUM - checksum;

Indeed - especially as the '-' code is really:
	checksum = (int)(u16)NVM_SUM - checksum;

  David


>  	ret_val = hw->nvm.ops.write(hw, NVM_CHECKSUM_REG, 1, &checksum);
>  	if (ret_val)
>  		hw_dbg("NVM Write Error while updating checksum.\n");
> 


  reply	other threads:[~2025-06-25 16:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-24 19:29 [PATCH 1/4] e1000: drop checksum constant cast to u16 in comparisons Jacek Kowalski
2025-06-24 19:30 ` [PATCH 2/4] e1000e: " Jacek Kowalski
2025-06-24 19:30 ` [PATCH 3/4] igb: " Jacek Kowalski
2025-06-25 12:21   ` Simon Horman
2025-06-24 19:31 ` [PATCH 4/4] igc: " Jacek Kowalski
2025-06-25 12:22   ` Simon Horman
2025-06-25 16:12     ` David Laight [this message]
2025-06-25 12:18 ` [PATCH 1/4] e1000: " Simon Horman
2025-06-25 12:19   ` Simon Horman
2025-06-25 13:03   ` Jacek Kowalski

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=20250625171214.5d752668@pumpkin \
    --to=david.laight.linux@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=anthony.l.nguyen@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jacek@jacekk.info \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=przemyslaw.kitszel@intel.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