linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] wireless: ath5k: Remove unnecessary label of ath5k_beacon_update
@ 2021-09-03  6:23 dingsenjie
  2021-09-03 17:48 ` Luis Chamberlain
  0 siblings, 1 reply; 2+ messages in thread
From: dingsenjie @ 2021-09-03  6:23 UTC (permalink / raw)
  To: jirislaby, mickflemm, mcgrof, kvalo, davem, kuba
  Cc: linux-wireless, netdev, linux-kernel, dingsenjie

From: dingsenjie <dingsenjie@yulong.com>

The label just used as return, so we delete it and
use the return statement instead of the goto statement.

Signed-off-by: dingsenjie <dingsenjie@yulong.com>
---
 drivers/net/wireless/ath/ath5k/base.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 4c6e57f..9739189 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -1896,23 +1896,18 @@ static int ath5k_remove_padding(struct sk_buff *skb)
 	struct ath5k_vif *avf;
 	struct sk_buff *skb;
 
-	if (WARN_ON(!vif)) {
-		ret = -EINVAL;
-		goto out;
-	}
+	if (WARN_ON(!vif))
+		return -EINVAL;
 
 	skb = ieee80211_beacon_get(hw, vif);
 
-	if (!skb) {
-		ret = -ENOMEM;
-		goto out;
-	}
+	if (!skb)
+		return -ENOMEM;
 
 	avf = (void *)vif->drv_priv;
 	ath5k_txbuf_free_skb(ah, avf->bbuf);
 	avf->bbuf->skb = skb;
 	ret = ath5k_beacon_setup(ah, avf->bbuf);
-out:
 	return ret;
 }
 
-- 
1.9.1



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

* Re: [PATCH] wireless: ath5k: Remove unnecessary label of ath5k_beacon_update
  2021-09-03  6:23 [PATCH] wireless: ath5k: Remove unnecessary label of ath5k_beacon_update dingsenjie
@ 2021-09-03 17:48 ` Luis Chamberlain
  0 siblings, 0 replies; 2+ messages in thread
From: Luis Chamberlain @ 2021-09-03 17:48 UTC (permalink / raw)
  To: dingsenjie
  Cc: jirislaby, mickflemm, kvalo, davem, kuba, linux-wireless, netdev,
	linux-kernel, dingsenjie

On Fri, Sep 03, 2021 at 02:23:16PM +0800, dingsenjie@163.com wrote:
> From: dingsenjie <dingsenjie@yulong.com>
> 
> The label just used as return, so we delete it and
> use the return statement instead of the goto statement.
> 
> Signed-off-by: dingsenjie <dingsenjie@yulong.com>
> ---
>  drivers/net/wireless/ath/ath5k/base.c | 13 ++++---------
>  1 file changed, 4 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
> index 4c6e57f..9739189 100644
> --- a/drivers/net/wireless/ath/ath5k/base.c
> +++ b/drivers/net/wireless/ath/ath5k/base.c
> @@ -1896,23 +1896,18 @@ static int ath5k_remove_padding(struct sk_buff *skb)
>  	struct ath5k_vif *avf;
>  	struct sk_buff *skb;

Just initialize ret = -EINVAL at the top, and you to get clear out a few
braces which are not needed anymore. Anyway, this code is not reflected
on linux-next, what codebase are you using? If the code change is just
a cleanup it should remove more code than add, and a commmit log should
reflect that clearly.

  Luis

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

end of thread, other threads:[~2021-09-03 17:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-03  6:23 [PATCH] wireless: ath5k: Remove unnecessary label of ath5k_beacon_update dingsenjie
2021-09-03 17:48 ` Luis Chamberlain

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