Re: [PATCH net 6/6] net: dsa: ksz: fix wrong read cast to u64

2021-01-13 Thread Vladimir Oltean
On Wed, Jan 13, 2021 at 01:45:22PM +0100, Gilles DOFFE wrote: > '(u64)*value' casts a u32 to a u64. So depending on endianness, > LSB or MSB is lost. > The pointer needs to be cast to read the full u64: > '*((u64 *)value)' > > Signed-off-by: Gilles DOFFE > --- Reviewed-by: Vladimir Oltean

[PATCH net 6/6] net: dsa: ksz: fix wrong read cast to u64

2021-01-13 Thread Gilles DOFFE
'(u64)*value' casts a u32 to a u64. So depending on endianness, LSB or MSB is lost. The pointer needs to be cast to read the full u64: '*((u64 *)value)' Signed-off-by: Gilles DOFFE --- drivers/net/dsa/microchip/ksz_common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git