* [patch] ath9k: fix some debugfs output
@ 2014-10-29 15:48 Dan Carpenter
2014-10-29 16:08 ` Joe Perches
0 siblings, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2014-10-29 15:48 UTC (permalink / raw)
To: QCA ath9k Development
Cc: John W. Linville, linux-wireless, ath9k-devel, kernel-janitors
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.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c
index 2a2a17d..c9afc15 100644
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
@@ -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);
}
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [patch] ath9k: fix some debugfs output
2014-10-29 15:48 [patch] ath9k: fix some debugfs output Dan Carpenter
@ 2014-10-29 16:08 ` Joe Perches
2014-10-29 16:10 ` Dan Carpenter
0 siblings, 1 reply; 5+ messages in thread
From: Joe Perches @ 2014-10-29 16:08 UTC (permalink / raw)
To: Dan Carpenter
Cc: QCA ath9k Development, John W. Linville, linux-wireless,
ath9k-devel, kernel-janitors
On Wed, 2014-10-29 at 18:48 +0300, Dan Carpenter wrote:
> 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?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch] ath9k: fix some debugfs output
2014-10-29 16:08 ` Joe Perches
@ 2014-10-29 16:10 ` Dan Carpenter
2014-10-29 16:13 ` Joe Perches
0 siblings, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2014-10-29 16:10 UTC (permalink / raw)
To: Joe Perches
Cc: QCA ath9k Development, John W. Linville, linux-wireless,
ath9k-devel, kernel-janitors
On Wed, Oct 29, 2014 at 09:08:39AM -0700, Joe Perches wrote:
> On Wed, 2014-10-29 at 18:48 +0300, Dan Carpenter wrote:
> > 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch] ath9k: fix some debugfs output
2014-10-29 16:10 ` Dan Carpenter
@ 2014-10-29 16:13 ` Joe Perches
2014-10-29 18:53 ` Dan Carpenter
0 siblings, 1 reply; 5+ messages in thread
From: Joe Perches @ 2014-10-29 16:13 UTC (permalink / raw)
To: Dan Carpenter
Cc: QCA ath9k Development, John W. Linville, linux-wireless,
ath9k-devel, kernel-janitors
On Wed, 2014-10-29 at 19:10 +0300, Dan Carpenter wrote:
> On Wed, Oct 29, 2014 at 09:08:39AM -0700, Joe Perches wrote:
> > On Wed, 2014-10-29 at 18:48 +0300, Dan Carpenter wrote:
> > > 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.
[]
> > 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.
Nice. fyi: I sent a bunch of these already.
https://lkml.org/lkml/2014/10/27/38
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch] ath9k: fix some debugfs output
2014-10-29 16:13 ` Joe Perches
@ 2014-10-29 18:53 ` Dan Carpenter
0 siblings, 0 replies; 5+ messages in thread
From: Dan Carpenter @ 2014-10-29 18:53 UTC (permalink / raw)
To: Joe Perches
Cc: QCA ath9k Development, John W. Linville, linux-wireless,
ath9k-devel, kernel-janitors
On Wed, Oct 29, 2014 at 09:13:24AM -0700, Joe Perches wrote:
> On Wed, 2014-10-29 at 19:10 +0300, Dan Carpenter wrote:
> > On Wed, Oct 29, 2014 at 09:08:39AM -0700, Joe Perches wrote:
> > > On Wed, 2014-10-29 at 18:48 +0300, Dan Carpenter wrote:
> > > > 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.
> []
> > > 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.
>
> Nice. fyi: I sent a bunch of these already.
>
> https://lkml.org/lkml/2014/10/27/38
>
Ah... Your grep found a bunch of stuff that I missed because it wasn't
in my allmodconfig.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-10-29 18:53 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-29 15:48 [patch] ath9k: fix some debugfs output Dan Carpenter
2014-10-29 16:08 ` Joe Perches
2014-10-29 16:10 ` Dan Carpenter
2014-10-29 16:13 ` Joe Perches
2014-10-29 18:53 ` Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).