(bug report) b43: precendence error

Michael Büsch <[email protected]>
Newsgroups org.infradead.lists.b43-dev,org.kernel.vger.linux-wireless
Message-ID <20151126134030.63bd44aa@wiggum>
On Thu, 26 Nov 2015 14:58:43 +0300
Dan Carpenter <[email protected]> wrote:

> [ All the old wireless Smatch warnings are showing up as new ones
>   because of the path reshuffle in linux-next.  I'm going through and
>   reporting the extra suspicious ones.  -dan ]
> 
> Hello Rafa? Mi?ecki,
> 
> The patch 6f98e62a9f1b: "b43: update cordic code to match current
> specs" from Jan 25, 2010, leads to the following static checker
> warning:
> 
> 	drivers/net/wireless/broadcom/b43/phy_lp.c:1803 lpphy_start_tx_tone()
> 	warn: mask and shift to zero
> 
> drivers/net/wireless/broadcom/b43/phy_lp.c
>   1800          for (i = 0; i < samples; i++) {
>   1801                  sample = b43_cordic(angle);
>   1802                  angle += rotation;
>   1803                  buf[i] = CORDIC_CONVERT((sample.i * max) & 0xFF) << 8;
>   1804                  buf[i] |= CORDIC_CONVERT((sample.q * max) & 0xFF);
> 
> Maybe the intention was:
> 
> 			buf[i] = (CORDIC_CONVERT(sample.i * max) & 0xFF) << 8;
> 			buf[i] |= CORDIC_CONVERT((sample.q * max) & 0xFF;
> 
>   1805          }
>   1806  


This looks like a bug indeed.
Rafa?, do you have hw to check this?

 			buf[i] = (CORDIC_CONVERT(sample.i * max) & 0xFF) << 8;
 			buf[i] |= CORDIC_CONVERT(sample.q * max) & 0xFF;

-- 
Michael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/b43-dev/attachments/20151126/03c6a363/attachment.sig>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.