Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

qed (gcc13): use u16 for fid to be big enough

gcc 13 correctly reports overflow in qed_grc_dump_addr_range():
In file included from drivers/net/ethernet/qlogic/qed/qed.h:23,
from drivers/net/ethernet/qlogic/qed/qed_debug.c:10:
drivers/net/ethernet/qlogic/qed/qed_debug.c: In function 'qed_grc_dump_addr_range':
include/linux/qed/qed_if.h:1217:9: error: overflow in conversion from 'int' to 'u8' {aka 'unsigned char'} changes value from '(int)vf_id << 8 | 128' to '128' [-Werror=overflow]

We do:
u8 fid;
...
fid = vf_id << 8 | 128;

Since fid is 16bit (and the stored value above too), fid should be u16,
not u8. Fix that.

Cc: Martin Liska <mliska@suse.cz>
Cc: Ariel Elior <aelior@marvell.com>
Cc: Manish Chopra <manishc@marvell.com>
Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20221031114354.10398-1-jirislaby@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Jiri Slaby (SUSE) and committed by
Jakub Kicinski
7d841182 471ef777

+2 -1
+2 -1
drivers/net/ethernet/qlogic/qed/qed_debug.c
··· 1972 1972 u8 split_id) 1973 1973 { 1974 1974 struct dbg_tools_data *dev_data = &p_hwfn->dbg_info; 1975 - u8 port_id = 0, pf_id = 0, vf_id = 0, fid = 0; 1975 + u8 port_id = 0, pf_id = 0, vf_id = 0; 1976 1976 bool read_using_dmae = false; 1977 1977 u32 thresh; 1978 + u16 fid; 1978 1979 1979 1980 if (!dump) 1980 1981 return len;