lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250624160304.GB5265@horms.kernel.org>
Date: Tue, 24 Jun 2025 17:03:04 +0100
From: Simon Horman <horms@...nel.org>
To: Jacek Kowalski <jacek@...ekk.info>
Cc: Tony Nguyen <anthony.l.nguyen@...el.com>,
	Przemek Kitszel <przemyslaw.kitszel@...el.com>,
	Andrew Lunn <andrew+netdev@...n.ch>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	intel-wired-lan@...ts.osuosl.org, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 2/2] e1000e: ignore factory-default checksum value on
 TGP platform

On Tue, Jun 24, 2025 at 02:51:09PM +0200, Jacek Kowalski wrote:
> > > +	if (hw->mac.type == e1000_pch_tgp && checksum == (u16)NVM_SUM_FACTORY_DEFAULT) {
> > 
> > I see that a similar cast is applied to NVM_SUM. But why?
> > If it's not necessary then I would advocate dropping it.
> 
> It's like that since the beginning of git history, tracing back to e1000:
> 
> $ git show 1da177e4c3f4:drivers/net/e1000/e1000_hw.c | grep -A 1 EEPROM_SUM
>     if(checksum == (uint16_t) EEPROM_SUM)
>         return E1000_SUCCESS;
> (...)
> 
> 
> I'd really prefer to keep it as-is here for a moment, since similar
> constructs are not only here, and then clean them up separately.
> 
> Examples instances from drivers/net/ethernet/intel:
> 
> e1000/e1000_ethtool.c:  if ((checksum != (u16)EEPROM_SUM) && !(*data))
> e1000/e1000_hw.c:       if (checksum == (u16)EEPROM_SUM)
> e1000e/ethtool.c:       if ((checksum != (u16)NVM_SUM) && !(*data))
> igb/e1000_82575.c:      if (checksum != (u16) NVM_SUM) {
> igb/e1000_nvm.c:        if (checksum != (u16) NVM_SUM) {
> igc/igc_nvm.c:  if (checksum != (u16)NVM_SUM) {

Ok. But can we look into cleaning this up as a follow-up?

Reviewed-by: Simon Horman <horms@...nel.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ