Skip to content

Commit

Permalink
cteontx2-pf: cn10k: Prevent harmless double shift bugs
Browse files Browse the repository at this point in the history
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.

Fixes: facede8 ("octeontx2-pf: cn10k: Add mbox support for CN10K")
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Dan Carpenter authored and davem330 committed Feb 17, 2021
1 parent 20e07e2 commit c776626
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 2
unsigned long cap_flag;

#define LMT_LINE_SIZE 128
Expand Down

0 comments on commit c776626

Please sign in to comment.