]> git.baikalelectronics.ru Git - kernel.git/commit
octeontx2-af: fix array bound error
authorHariprasad Kelam <hkelam@marvell.com>
Fri, 11 Feb 2022 15:55:39 +0000 (21:25 +0530)
committerJakub Kicinski <kuba@kernel.org>
Fri, 11 Feb 2022 22:21:53 +0000 (14:21 -0800)
commit687bc5b10743a368332c349365e723d9ddc3dbdb
tree00abfd29014db507a59f3b52d823d596dadb3e13
parentf9b0aaeaaddd9d4e8276e371fb82a4a2384f9302
octeontx2-af: fix array bound error

This patch fixes below error by using proper data type.

drivers/net/ethernet/marvell/octeontx2/af/rpm.c: In function
'rpm_cfg_pfc_quanta_thresh':
include/linux/find.h:40:23: error: array subscript 'long unsigned
int[0]' is partly outside array bounds of 'u16[1]' {aka 'short unsigned
int[1]'} [-Werror=array-bounds]
   40 |                 val = *addr & GENMASK(size - 1, offset);

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Hariprasad Kelam <hkelam@marvell.com>
Link: https://lore.kernel.org/r/20220211155539.13931-1-hkelam@marvell.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/marvell/octeontx2/af/rpm.c