2010-08-22 19:47:01

by Rafał Miłecki

[permalink] [raw]
Subject: [PATCH] b43: N-PHY: add missing phyrxchain setting and fix warning in RX core function

Signed-off-by: Rafał Miłecki <[email protected]>
---
Gábor: please kindly, watch out for such a missing calls/sets. We may lose a
lot of time looking for such a missing lines later.
---
drivers/net/wireless/b43/phy_n.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index d116229..2466c0a 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -3092,6 +3092,8 @@ static void b43_nphy_set_rx_core_state(struct b43_wldev *dev, u8 mask)
struct b43_phy_n *nphy = phy->n;
u16 buf[16];

+ nphy->phyrxchain = mask;
+
if (0 /* FIXME clk */)
return;

@@ -3103,7 +3105,7 @@ static void b43_nphy_set_rx_core_state(struct b43_wldev *dev, u8 mask)
b43_phy_maskset(dev, B43_NPHY_RFSEQCA, ~B43_NPHY_RFSEQCA_RXEN,
(mask & 0x3) << B43_NPHY_RFSEQCA_RXEN_SHIFT);

- if (mask & 0x3 != 0x3) {
+ if ((mask & 0x3) != 0x3) {
b43_phy_write(dev, B43_NPHY_HPANT_SWTHRES, 1);
if (dev->phy.rev >= 3) {
/* TODO */
--
1.7.1



2010-08-22 19:50:08

by Gábor Stefanik

[permalink] [raw]
Subject: Re: [PATCH] b43: N-PHY: add missing phyrxchain setting and fix warning in RX core function

2010/8/22 Rafał Miłecki <[email protected]>:
> Signed-off-by: Rafał Miłecki <[email protected]>
> ---
> Gábor: please kindly, watch out for such a missing calls/sets. We may lose a
> lot of time looking for such a missing lines later.
> ---
>  drivers/net/wireless/b43/phy_n.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
> index d116229..2466c0a 100644
> --- a/drivers/net/wireless/b43/phy_n.c
> +++ b/drivers/net/wireless/b43/phy_n.c
> @@ -3092,6 +3092,8 @@ static void b43_nphy_set_rx_core_state(struct b43_wldev *dev, u8 mask)
>        struct b43_phy_n *nphy = phy->n;
>        u16 buf[16];
>
> +       nphy->phyrxchain = mask;
> +
>        if (0 /* FIXME clk */)
>                return;
>
> @@ -3103,7 +3105,7 @@ static void b43_nphy_set_rx_core_state(struct b43_wldev *dev, u8 mask)
>        b43_phy_maskset(dev, B43_NPHY_RFSEQCA, ~B43_NPHY_RFSEQCA_RXEN,
>                        (mask & 0x3) << B43_NPHY_RFSEQCA_RXEN_SHIFT);
>
> -       if (mask & 0x3 != 0x3) {
> +       if ((mask & 0x3) != 0x3) {

Why is this needed? An & doesn't magically transform into an && under
any circumstances...

>                b43_phy_write(dev, B43_NPHY_HPANT_SWTHRES, 1);
>                if (dev->phy.rev >= 3) {
>                        /* TODO */
> --
> 1.7.1
>
>



--
Vista: [V]iruses, [I]ntruders, [S]pyware, [T]rojans and [A]dware. :-)

2010-08-22 20:09:00

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH] b43: N-PHY: add missing phyrxchain setting and fix warning in RX core function

On Sun, 2010-08-22 at 21:49 +0200, Gábor Stefanik wrote:
> 2010/8/22 Rafał Miłecki <[email protected]>:
> > @@ -3103,7 +3105,7 @@ static void b43_nphy_set_rx_core_state(struct b43_wldev *dev, u8 mask)
> > b43_phy_maskset(dev, B43_NPHY_RFSEQCA, ~B43_NPHY_RFSEQCA_RXEN,
> > (mask & 0x3) << B43_NPHY_RFSEQCA_RXEN_SHIFT);
> >
> > - if (mask & 0x3 != 0x3) {
> > + if ((mask & 0x3) != 0x3) {
>
> Why is this needed? An & doesn't magically transform into an && under
> any circumstances...

For the same reason it's used in the b43_phy_maskset call.
Clarity.


2010-08-22 20:00:08

by Rafał Miłecki

[permalink] [raw]
Subject: Re: [PATCH] b43: N-PHY: add missing phyrxchain setting and fix warning in RX core function

W dniu 22 sierpnia 2010 21:49 użytkownik Gábor Stefanik
<[email protected]> napisał:
> 2010/8/22 Rafał Miłecki <[email protected]>:
>> Signed-off-by: Rafał Miłecki <[email protected]>
>> ---
>> Gábor: please kindly, watch out for such a missing calls/sets. We may lose a
>> lot of time looking for such a missing lines later.
>> ---
>>  drivers/net/wireless/b43/phy_n.c |    4 +++-
>>  1 files changed, 3 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
>> index d116229..2466c0a 100644
>> --- a/drivers/net/wireless/b43/phy_n.c
>> +++ b/drivers/net/wireless/b43/phy_n.c
>> @@ -3092,6 +3092,8 @@ static void b43_nphy_set_rx_core_state(struct b43_wldev *dev, u8 mask)
>>        struct b43_phy_n *nphy = phy->n;
>>        u16 buf[16];
>>
>> +       nphy->phyrxchain = mask;
>> +
>>        if (0 /* FIXME clk */)
>>                return;
>>
>> @@ -3103,7 +3105,7 @@ static void b43_nphy_set_rx_core_state(struct b43_wldev *dev, u8 mask)
>>        b43_phy_maskset(dev, B43_NPHY_RFSEQCA, ~B43_NPHY_RFSEQCA_RXEN,
>>                        (mask & 0x3) << B43_NPHY_RFSEQCA_RXEN_SHIFT);
>>
>> -       if (mask & 0x3 != 0x3) {
>> +       if ((mask & 0x3) != 0x3) {
>
> Why is this needed? An & doesn't magically transform into an && under
> any circumstances...

I agree it's quite obvious, however I believe kernel compiles with
flags raising such a warnings by default:

drivers/net/wireless/b43/phy_n.c: In function ‘b43_nphy_set_rx_core_state’:
drivers/net/wireless/b43/phy_n.c:3106:2: warning: suggest parentheses
around comparison in operand of ‘&’

--
Rafał