Search Linux Wireless

Re: [PATCH 2/3] ath9k_hw: fix smatch warnings in spur_mitigate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jun 22, 2012 at 10:23:44AM +0300, Kalle Valo wrote:
> Rajkumar Manoharan <rmanohar@xxxxxxxxxxxxxxxx> writes:
> 
> > This patch fixes below smatch warnings
> >
> > drivers/net/wireless/ath/ath9k/ar9003_calib.c:272
> > ar9003_hw_iqcalibrate() Error invalid range 65 to 63
> >
> > Signed-off-by: Rajkumar Manoharan <rmanohar@xxxxxxxxxxxxxxxx>
> 
> [...]
> 
> > -			qCoff = qCoff & 0x7f;
> > +			qCoff &= 0x7f;
> 
> I'm curious, how does a change like this fix anything? To me it just
> looks same functionality, just a different operator is used. Am I
> missing something?

Though it doesn't make a difference, somehow it fixes smatch warning.
I agree it is not the right fix.

I just found the actual issue here that the min and max limitation
are checked before masking out the value.

   if (qCoff >= 63)
           qCoff = 63;
   else if (qCoff <= -63)
           qCoff = -63;

Later it is masked out with 0x7f.

-63 & 0x7f = 65 which is greater than the max limit 63.

Thats why smatch is throwing warning "Error invalid range 65 to 63".

-Rajkumar 
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux