ath9k: fix some debugfs output
Subsystems (2)
PATCH 1/1 ath9k: fix some debugfs output
The right shift operation has higher precedence than the mask so we left shift by "(i * 3)" and then immediately right shift by "(i * 3)" then we mask. It should be left shift, mask, and then right shift.
drivers/net/wireless/ath/ath9k/debug.c +1 -1
@@ -455,7 +455,7 @@ static ssize_t read_file_dma(struct file *file, char __user *user_buf,"%2d %2x %1x %2x %2x\n" , i, (*qcuBase & (0x7 << qcuOffset)) >> qcuOffset, (*qcuBase & (0x8 << qcuOffset)) >> (qcuOffset +3 ), - val[2 ] & (0x7 << (i *3 )) >> (i *3 ), + (val[2 ] & (0x7 << (i *3 ))) >> (i *3 ), (*dcuBase & (0x1f << dcuOffset)) >> dcuOffset); }
PATCH 1/1 ath9k: fix some debugfs output
Quoted 4 lines · Dan Carpenter
The right shift operation has higher precedence than the mask so we left shift by "(i * 3)" and then immediately right shift by "(i * 3)" then we mask. It should be left shift, mask, and then right shift.
Hey Dan.
My grep pattern doesn't like operations on the thing masked.
Did you find this by some tool or visual inspection via grep?
PATCH 1/1 ath9k: fix some debugfs output
Quoted 11 lines · Joe Perches
Quoted 4 lines · Dan Carpenter
The right shift operation has higher precedence than the mask so we left shift by "(i * 3)" and then immediately right shift by "(i * 3)" then we mask. It should be left shift, mask, and then right shift.
Hey Dan.
My grep pattern doesn't like operations on the thing masked.
Did you find this by some tool or visual inspection via grep?
I wrote a Smatch check inspired by the i40e bug you found earlier.
regards,
dan carpenter
PATCH 1/1 ath9k: fix some debugfs output
Quoted 5 lines · Dan Carpenter
Quoted 4 lines · Joe Perches
Quoted 3 lines · Dan Carpenter
The right shift operation has higher precedence than the mask so we left shift by "(i * 3)" and then immediately right shift by "(i * 3)" then we mask. It should be left shift, mask, and then right shift.
[]
Quoted 2 lines
Quoted 2 lines
My grep pattern doesn't like operations on the thing masked. Did you find this by some tool or visual inspection via grep?
[]
Quoted 1 line
I wrote a Smatch check inspired by the i40e bug you found earlier.
Nice. fyi: I sent a bunch of these already.
PATCH 1/1 ath9k: fix some debugfs output
Quoted 7 lines · Joe Perches
Quoted 5 lines · Dan Carpenter
Quoted 4 lines · Joe Perches
Quoted 3 lines · Dan Carpenter
The right shift operation has higher precedence than the mask so we left shift by "(i * 3)" and then immediately right shift by "(i * 3)" then we mask. It should be left shift, mask, and then right shift.
[]
Quoted 9 lines
Quoted 2 lines
Quoted 2 lines
My grep pattern doesn't like operations on the thing masked. Did you find this by some tool or visual inspection via grep?
[]
Quoted 1 line
I wrote a Smatch check inspired by the i40e bug you found earlier.
Nice. fyi: I sent a bunch of these already.
Ah... Your grep found a bunch of stuff that I missed because it wasn't in my allmodconfig.
regards,
dan carpenter