History

bnx2x: Fix undefined behavior due to shift overflowing the constant

Fix: drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c: In function ‘bnx2x_check_blocks_with_parity3’: drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c:4917:4: error: case label does not reduce to an integer constant case AEU_INPUTS_ATTN_BITS_MCP_LATCHED_SCPAD_PARITY: ^~~~ See https://lore.kernel.org/r/YkwQ6%2BtIH8GQpuct@zn.tnic for the gory details as to why it triggers with older gccs only.

Borislav Petkov committed 4 years ago

Commit 8dd7cdb1 parent 40570371 file · +1 −1Browse files

Unified · Split

drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h+1−1
@@ -6218,7 +6218,7 @@ · 6217 unmodified lines
6218#define AEU_INPUTS_ATTN_BITS_GPIO0_FUNCTION_0 (0x1<<2)6218#define AEU_INPUTS_ATTN_BITS_GPIO0_FUNCTION_0 (0x1<<2)
6219#define AEU_INPUTS_ATTN_BITS_IGU_PARITY_ERROR (0x1<<12)6219#define AEU_INPUTS_ATTN_BITS_IGU_PARITY_ERROR (0x1<<12)
6220#define AEU_INPUTS_ATTN_BITS_MCP_LATCHED_ROM_PARITY (0x1<<28)6220#define AEU_INPUTS_ATTN_BITS_MCP_LATCHED_ROM_PARITY (0x1<<28)
6221#define AEU_INPUTS_ATTN_BITS_MCP_LATCHED_SCPAD_PARITY (0x1<<31)6221#define AEU_INPUTS_ATTN_BITS_MCP_LATCHED_SCPAD_PARITY (0x1U<<31)
6222#define AEU_INPUTS_ATTN_BITS_MCP_LATCHED_UMP_RX_PARITY (0x1<<29)6222#define AEU_INPUTS_ATTN_BITS_MCP_LATCHED_UMP_RX_PARITY (0x1<<29)
6223#define AEU_INPUTS_ATTN_BITS_MCP_LATCHED_UMP_TX_PARITY (0x1<<30)6223#define AEU_INPUTS_ATTN_BITS_MCP_LATCHED_UMP_TX_PARITY (0x1<<30)
6224#define AEU_INPUTS_ATTN_BITS_MISC_HW_INTERRUPT (0x1<<15)6224#define AEU_INPUTS_ATTN_BITS_MISC_HW_INTERRUPT (0x1<<15)