On Wed, May 26, 2021 at 06:34:47PM +0300, Vladimir Oltean wrote:
Hi Russell,
On Wed, May 26, 2021 at 04:24:54PM +0100, Russell King (Oracle) wrote:
quoted
On Wed, May 26, 2021 at 04:55:24PM +0300, Vladimir Oltean wrote:
quoted
- const struct sja1105_regs *regs = priv->info->regs;
+ u64 addr = (mmd << 16) | pcs_reg;
What is the reason for using "u64" here. pcs_reg is 16-bits, and mmd is
five bits, which is well below 32 bits. So, why not u32?
The "addr" variable holds a SPI address, and in the sja1105 driver, the
SPI addresses are universally held in u64 variables, mainly because of
the packing() API (Documentation/core-api/packing.rst).
As you are passing it into a function, the argument of which is a u64,
the compiler will promote the u32 to a u64 by itself. I guess it
doesn't actually matter, but the current code just looks really weird.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!