b43-dev.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: wireless/broadcom: fix possible condition with no effect
@ 2022-06-25 19:29 Praghadeesh T K S
  2022-06-26 11:03 ` Sebastian Gottschall
  0 siblings, 1 reply; 4+ messages in thread
From: Praghadeesh T K S @ 2022-06-25 19:29 UTC (permalink / raw)
  To: Kalle Valo, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Praghadeesh T K S, linux-wireless, b43-dev, netdev,
	linux-kernel
  Cc: praghadeeshtks, skhan

Fix a coccinelle warning by removing condition with no possible effect

Signed-off-by: Praghadeesh T K S <praghadeeshthevendria@gmail.com>
---
 drivers/net/wireless/broadcom/b43/xmit.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/net/wireless/broadcom/b43/xmit.c b/drivers/net/wireless/broadcom/b43/xmit.c
index 7651b1b..667a74b 100644
--- a/drivers/net/wireless/broadcom/b43/xmit.c
+++ b/drivers/net/wireless/broadcom/b43/xmit.c
@@ -169,12 +169,7 @@ static u16 b43_generate_tx_phy_ctl1(struct b43_wldev *dev, u8 bitrate)
 	const struct b43_phy *phy = &dev->phy;
 	const struct b43_tx_legacy_rate_phy_ctl_entry *e;
 	u16 control = 0;
-	u16 bw;
-
-	if (phy->type == B43_PHYTYPE_LP)
-		bw = B43_TXH_PHY1_BW_20;
-	else /* FIXME */
-		bw = B43_TXH_PHY1_BW_20;
+	u16 bw = B43_TXH_PHY1_BW_20;
 
 	if (0) { /* FIXME: MIMO */
 	} else if (b43_is_cck_rate(bitrate) && phy->type != B43_PHYTYPE_LP) {
-- 
2.34.1


_______________________________________________
b43-dev mailing list
b43-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/b43-dev

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] net: wireless/broadcom: fix possible condition with no effect
  2022-06-25 19:29 [PATCH] net: wireless/broadcom: fix possible condition with no effect Praghadeesh T K S
@ 2022-06-26 11:03 ` Sebastian Gottschall
  2022-06-26 11:12   ` Andrew Lunn
  2022-06-26 11:18   ` Michael Büsch
  0 siblings, 2 replies; 4+ messages in thread
From: Sebastian Gottschall @ 2022-06-26 11:03 UTC (permalink / raw)
  To: Praghadeesh T K S, Kalle Valo, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, linux-wireless, b43-dev, netdev,
	linux-kernel
  Cc: praghadeeshtks, skhan

Am 25.06.2022 um 21:29 schrieb Praghadeesh T K S:
> Fix a coccinelle warning by removing condition with no possible effect
>
> Signed-off-by: Praghadeesh T K S <praghadeeshthevendria@gmail.com>
> ---
>   drivers/net/wireless/broadcom/b43/xmit.c | 7 +------
>   1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/drivers/net/wireless/broadcom/b43/xmit.c b/drivers/net/wireless/broadcom/b43/xmit.c
> index 7651b1b..667a74b 100644
> --- a/drivers/net/wireless/broadcom/b43/xmit.c
> +++ b/drivers/net/wireless/broadcom/b43/xmit.c
> @@ -169,12 +169,7 @@ static u16 b43_generate_tx_phy_ctl1(struct b43_wldev *dev, u8 bitrate)
>   	const struct b43_phy *phy = &dev->phy;
>   	const struct b43_tx_legacy_rate_phy_ctl_entry *e;
>   	u16 control = 0;
> -	u16 bw;
> -
> -	if (phy->type == B43_PHYTYPE_LP)
> -		bw = B43_TXH_PHY1_BW_20;
> -	else /* FIXME */
> -		bw = B43_TXH_PHY1_BW_20;
> +	u16 bw = B43_TXH_PHY1_BW_20;
Can you check if this is a possible register typo?
>   
>   	if (0) { /* FIXME: MIMO */
>   	} else if (b43_is_cck_rate(bitrate) && phy->type != B43_PHYTYPE_LP) {

_______________________________________________
b43-dev mailing list
b43-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/b43-dev

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] net: wireless/broadcom: fix possible condition with no effect
  2022-06-26 11:03 ` Sebastian Gottschall
@ 2022-06-26 11:12   ` Andrew Lunn
  2022-06-26 11:18   ` Michael Büsch
  1 sibling, 0 replies; 4+ messages in thread
From: Andrew Lunn @ 2022-06-26 11:12 UTC (permalink / raw)
  To: Sebastian Gottschall
  Cc: Praghadeesh T K S, Kalle Valo, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, linux-wireless, b43-dev, netdev,
	linux-kernel, praghadeeshtks, skhan

On Sun, Jun 26, 2022 at 01:03:57PM +0200, Sebastian Gottschall wrote:
> Am 25.06.2022 um 21:29 schrieb Praghadeesh T K S:
> > Fix a coccinelle warning by removing condition with no possible effect
> > 
> > Signed-off-by: Praghadeesh T K S <praghadeeshthevendria@gmail.com>
> > ---
> >   drivers/net/wireless/broadcom/b43/xmit.c | 7 +------
> >   1 file changed, 1 insertion(+), 6 deletions(-)
> > 
> > diff --git a/drivers/net/wireless/broadcom/b43/xmit.c b/drivers/net/wireless/broadcom/b43/xmit.c
> > index 7651b1b..667a74b 100644
> > --- a/drivers/net/wireless/broadcom/b43/xmit.c
> > +++ b/drivers/net/wireless/broadcom/b43/xmit.c
> > @@ -169,12 +169,7 @@ static u16 b43_generate_tx_phy_ctl1(struct b43_wldev *dev, u8 bitrate)
> >   	const struct b43_phy *phy = &dev->phy;
> >   	const struct b43_tx_legacy_rate_phy_ctl_entry *e;
> >   	u16 control = 0;
> > -	u16 bw;
> > -
> > -	if (phy->type == B43_PHYTYPE_LP)
> > -		bw = B43_TXH_PHY1_BW_20;
> > -	else /* FIXME */
> > -		bw = B43_TXH_PHY1_BW_20;
> > +	u16 bw = B43_TXH_PHY1_BW_20;

Hi Praghadeesh

I assume you took a deep look at the FIXME, understand why it is
there, looked at the datasheet etc, and decided it is not in fact
broken. Hence it is safe to remove the FIXME. Please could you
summarise your findings in the commit messages.

	  Andrew

_______________________________________________
b43-dev mailing list
b43-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/b43-dev

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] net: wireless/broadcom: fix possible condition with no effect
  2022-06-26 11:03 ` Sebastian Gottschall
  2022-06-26 11:12   ` Andrew Lunn
@ 2022-06-26 11:18   ` Michael Büsch
  1 sibling, 0 replies; 4+ messages in thread
From: Michael Büsch @ 2022-06-26 11:18 UTC (permalink / raw)
  To: Sebastian Gottschall
  Cc: Praghadeesh T K S, Kalle Valo, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, linux-wireless, b43-dev, netdev,
	linux-kernel, praghadeeshtks, skhan


[-- Attachment #1.1: Type: text/plain, Size: 1472 bytes --]

On Sun, 26 Jun 2022 13:03:57 +0200
Sebastian Gottschall <s.gottschall@newmedia-net.de> wrote:

> Am 25.06.2022 um 21:29 schrieb Praghadeesh T K S:
> > Fix a coccinelle warning by removing condition with no possible
> > effect
> >
> > Signed-off-by: Praghadeesh T K S <praghadeeshthevendria@gmail.com>
> > ---
> >   drivers/net/wireless/broadcom/b43/xmit.c | 7 +------
> >   1 file changed, 1 insertion(+), 6 deletions(-)
> >
> > diff --git a/drivers/net/wireless/broadcom/b43/xmit.c
> > b/drivers/net/wireless/broadcom/b43/xmit.c index 7651b1b..667a74b
> > 100644 --- a/drivers/net/wireless/broadcom/b43/xmit.c
> > +++ b/drivers/net/wireless/broadcom/b43/xmit.c
> > @@ -169,12 +169,7 @@ static u16 b43_generate_tx_phy_ctl1(struct
> > b43_wldev *dev, u8 bitrate) const struct b43_phy *phy = &dev->phy;
> >   	const struct b43_tx_legacy_rate_phy_ctl_entry *e;
> >   	u16 control = 0;
> > -	u16 bw;
> > -
> > -	if (phy->type == B43_PHYTYPE_LP)
> > -		bw = B43_TXH_PHY1_BW_20;
> > -	else /* FIXME */
> > -		bw = B43_TXH_PHY1_BW_20;
> > +	u16 bw = B43_TXH_PHY1_BW_20;  
> Can you check if this is a possible register typo?


I think use of this name was intentional.
The code is marked as being incomplete with /* FIXME */

This change removes the FIXME. Which is bad. It doesn't improve the
code. It reduces code quality by removing the
incompleteness documentation.

Please leave the code as-is.

-- 
Michael Büsch
https://bues.ch/

[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

_______________________________________________
b43-dev mailing list
b43-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/b43-dev

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-06-26 11:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-25 19:29 [PATCH] net: wireless/broadcom: fix possible condition with no effect Praghadeesh T K S
2022-06-26 11:03 ` Sebastian Gottschall
2022-06-26 11:12   ` Andrew Lunn
2022-06-26 11:18   ` Michael Büsch

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).