2013-02-24 13:20:09

by Rafał Miłecki

[permalink] [raw]
Subject: Dead code in brcms_c_compute_rspec

Hey,

I was looking for adding support for more devices in b43 and wanted to
check how did you handled reading PHY type/id from rxchan/chanstat
(it's a part of hardware-specific part of RX header).

In rate.c you have brcms_c_compute_rspec which does:
phy_type = ((rxh->RxChan & RXS_CHAN_PHYTYPE_MASK) >> RXS_CHAN_PHYTYPE_SHIFT);
(you duplicate BRCMS_CHAN_PHYTYPE by the way).

The problem is that:
#define RXS_CHAN_PHYTYPE_MASK 0x0007
and you're comparing the result to the
#define PHY_TYPE_LCN 8
which looks like a minor dead code for me.

You may want to fix that.

--
Rafał


2013-02-25 10:23:08

by Arend van Spriel

[permalink] [raw]
Subject: Re: Dead code in brcms_c_compute_rspec

On 02/24/13 14:20, Rafał Miłecki wrote:
> Hey,
>
> I was looking for adding support for more devices in b43 and wanted to
> check how did you handled reading PHY type/id from rxchan/chanstat
> (it's a part of hardware-specific part of RX header).
>
> In rate.c you have brcms_c_compute_rspec which does:
> phy_type = ((rxh->RxChan& RXS_CHAN_PHYTYPE_MASK)>> RXS_CHAN_PHYTYPE_SHIFT);
> (you duplicate BRCMS_CHAN_PHYTYPE by the way).
>
> The problem is that:
> #define RXS_CHAN_PHYTYPE_MASK 0x0007
> and you're comparing the result to the
> #define PHY_TYPE_LCN 8
> which looks like a minor dead code for me.
>
> You may want to fix that.
>

Thanks, Rafał

That does not seem right. I will look into this.

Gr. AvS