]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: sja1105: Replace sja1105_spi_send_int with sja1105_xfer_{u32, u64}
authorVladimir Oltean <olteanv@gmail.com>
Tue, 1 Oct 2019 19:18:00 +0000 (22:18 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 2 Oct 2019 16:25:11 +0000 (12:25 -0400)
commitd13cb83f28ccbd84a2c83298289ba9686ff90169
tree24ac912ad1e43630f7ea06df46c0e4b3cda0f100
parentc90dd296b8fefbce64c1a4e3b873e07ec8c76254
net: dsa: sja1105: Replace sja1105_spi_send_int with sja1105_xfer_{u32, u64}

Having a function that takes a variable number of unpacked bytes which
it generically calls an "int" is confusing and makes auditing patches
next to impossible.

We only use spi_send_int with the int sizes of 32 and 64 bits. So just
make the spi_send_int function less generic and replace it with the
appropriate two explicit functions, which can now type-check the int
pointer type.

Note that there is still a small weirdness in the u32 function, which
has to convert it to a u64 temporary. This is because of how the packing
API works at the moment, but the weirdness is at least hidden from
callers of sja1105_xfer_u32 now.

Suggested-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/sja1105/sja1105.h
drivers/net/dsa/sja1105/sja1105_main.c
drivers/net/dsa/sja1105/sja1105_ptp.c
drivers/net/dsa/sja1105/sja1105_spi.c