cteontx2-pf: cn10k: Prevent harmless double shift bugs
PATCH 1/1 cteontx2-pf: cn10k: Prevent harmless double shift bugs
These defines are used with set_bit() and test_bit() which take a bit number. In other words, the code is doing:
if (BIT(BIT(1)) & pf->hw.cap_flag) {This was done consistently so it did not cause a problem at runtime but it's still worth fixing.
--- drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h +3 -3
@@ -210,9 +210,9 @@ struct otx2_hw {u64 cgx_fec_uncorr_blks;u8 cgx_links;/* No. of CGX links present in HW */ u8 lbk_links;/* No. of LBK links present in HW */ -#define HW_TSO BIT_ULL(0) -#define CN10K_MBOX BIT_ULL(1) -#define CN10K_LMTST BIT_ULL(2) +#define HW_TSO 0 +#define CN10K_MBOX 1 +#define CN10K_LMTST 2unsigned long cap_flag;#define LMT_LINE_SIZE 128
Signature · 1 line
2.30.0
This patch was applied to netdev/net-next.git (refs/heads/master):
Hello:
This patch was applied to netdev/net-next.git (refs/heads/master):
Quoted 9 lines · On Wed, 17 Feb 2021 09:16:20 +0300 you wrote:
These defines are used with
set_bit()andtest_bit()which take a bit number. In other words, the code is doing:if (BIT(BIT(1)) & pf->hw.cap_flag) {This was done consistently so it did not cause a problem at runtime but it's still worth fixing.
[...]
Here is the summary with links:
- [net-next] cteontx2-pf: cn10k: Prevent harmless double shift bugs
https://git.kernel.org/netdev/net-next/c/c77662605d8d
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html