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: <ZbKrRL9W5D1kGn0F@shell.armlinux.org.uk>
Date: Thu, 25 Jan 2024 18:41:08 +0000
From: "Russell King (Oracle)" <linux@...linux.org.uk>
To: Serge Semin <fancer.lancer@...il.com>
Cc: Yanteng Si <siyanteng@...ngson.cn>, andrew@...n.ch,
	hkallweit1@...il.com, peppe.cavallaro@...com,
	alexandre.torgue@...s.st.com, joabreu@...opsys.com,
	Jose.Abreu@...opsys.com, chenhuacai@...ngson.cn,
	guyinggang@...ngson.cn, netdev@...r.kernel.org,
	chris.chenfeiyang@...il.com
Subject: Re: [PATCH net-next v7 7/9] net: stmmac: dwmac-loongson: Add GNET
 support

On Thu, Jan 25, 2024 at 09:38:30PM +0300, Serge Semin wrote:
> On Thu, Jan 25, 2024 at 04:36:39PM +0800, Yanteng Si wrote:
> > drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c: In function
> > 'loongson_gnet_data':
> > drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c:463:41: warning:
> > conversion from
> > 
> > 'long unsigned int' to 'unsigned int' changes value from
> > '18446744073709551611' to '4294967291' [-Woverflow]
> >   463 |         plat->mdio_bus_data->phy_mask = ~BIT(2);
> >       |                                         ^
> > 
> > Unfortunately, we don't have an unsigned int macro for BIT(nr).
> 
> Then the alternative ~(1 << 2) would be still more readable then the
> open-coded literal like 0xfffffffb. What would be even better than
> that:
> 
> #define LOONGSON_GNET_PHY_ADDR		0x2
> ...
> 	plat->mdio_bus_data->phy_mask = ~(1 << LOONGSON_GNET_PHY_ADDR);

	plat->mdio_bus_data->phy_mask = ~(u32)BIT(2);

would also work.


-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ