]> git.baikalelectronics.ru Git - kernel.git/commit
fsl/fman: use 32-bit unsigned integer
authorFlorinel Iordache <florinel.iordache@nxp.com>
Mon, 3 Aug 2020 07:07:30 +0000 (10:07 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 3 Aug 2020 23:20:14 +0000 (16:20 -0700)
commit4c8bb98426bb2698e8f86708d4eacc462d555b60
tree52f655af4f1a0746232379bf690e6bda4e988563
parent83ee55d11d6a844cf9365c9366eb46c3a2e86acd
fsl/fman: use 32-bit unsigned integer

Potentially overflowing expression (ts_freq << 16 and intgr << 16)
declared as type u32 (32-bit unsigned) is evaluated using 32-bit
arithmetic and then used in a context that expects an expression of
type u64 (64-bit unsigned) which ultimately is used as 16-bit
unsigned by typecasting to u16. Fixed by using an unsigned 32-bit
integer since the value is truncated anyway in the end.

Fixes: 47772c970c20 ("fsl/fman: Add FMan support")
Signed-off-by: Florinel Iordache <florinel.iordache@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/fman/fman.c