* [PATCH] wifi: mac80211: clean up a needless assignment in ieee80211_sta_activate_link()
@ 2022-08-12 9:44 Lukas Bulwahn
2022-08-12 10:02 ` Dan Carpenter
0 siblings, 1 reply; 3+ messages in thread
From: Lukas Bulwahn @ 2022-08-12 9:44 UTC (permalink / raw)
To: Johannes Berg, linux-wireless
Cc: kernel-janitors, linux-kernel, Lukas Bulwahn
Commit 177577dbd223 ("wifi: mac80211: sta_info: fix link_sta insertion")
makes ieee80211_sta_activate_link() return 0 in the 'hash' label case.
Hence, setting ret in the !test_sta_flag(...) branch to zero is not needed
anymore and can be dropped.
Remove a needless assignment.
No functional change. No change in object code.
Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
---
net/mac80211/sta_info.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index cb23da9aff1e..492c7a29d797 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -2778,7 +2778,6 @@ int ieee80211_sta_activate_link(struct sta_info *sta, unsigned int link_id)
sta->sta.valid_links = new_links;
if (!test_sta_flag(sta, WLAN_STA_INSERTED)) {
- ret = 0;
goto hash;
}
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] wifi: mac80211: clean up a needless assignment in ieee80211_sta_activate_link()
2022-08-12 9:44 [PATCH] wifi: mac80211: clean up a needless assignment in ieee80211_sta_activate_link() Lukas Bulwahn
@ 2022-08-12 10:02 ` Dan Carpenter
2022-08-12 10:33 ` Lukas Bulwahn
0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2022-08-12 10:02 UTC (permalink / raw)
To: Lukas Bulwahn
Cc: Johannes Berg, linux-wireless, kernel-janitors, linux-kernel
On Fri, Aug 12, 2022 at 11:44:38AM +0200, Lukas Bulwahn wrote:
> Commit 177577dbd223 ("wifi: mac80211: sta_info: fix link_sta insertion")
> makes ieee80211_sta_activate_link() return 0 in the 'hash' label case.
> Hence, setting ret in the !test_sta_flag(...) branch to zero is not needed
> anymore and can be dropped.
>
> Remove a needless assignment.
>
> No functional change. No change in object code.
>
> Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
> ---
> net/mac80211/sta_info.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
> index cb23da9aff1e..492c7a29d797 100644
> --- a/net/mac80211/sta_info.c
> +++ b/net/mac80211/sta_info.c
> @@ -2778,7 +2778,6 @@ int ieee80211_sta_activate_link(struct sta_info *sta, unsigned int link_id)
> sta->sta.valid_links = new_links;
>
> if (!test_sta_flag(sta, WLAN_STA_INSERTED)) {
> - ret = 0;
> goto hash;
> }
Please, remove the {} as well.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] wifi: mac80211: clean up a needless assignment in ieee80211_sta_activate_link()
2022-08-12 10:02 ` Dan Carpenter
@ 2022-08-12 10:33 ` Lukas Bulwahn
0 siblings, 0 replies; 3+ messages in thread
From: Lukas Bulwahn @ 2022-08-12 10:33 UTC (permalink / raw)
To: Dan Carpenter
Cc: Johannes Berg, linux-wireless, kernel-janitors,
Linux Kernel Mailing List
On Fri, Aug 12, 2022 at 12:02 PM Dan Carpenter <dan.carpenter@oracle.com> wrote:
>
> On Fri, Aug 12, 2022 at 11:44:38AM +0200, Lukas Bulwahn wrote:
> > Commit 177577dbd223 ("wifi: mac80211: sta_info: fix link_sta insertion")
> > makes ieee80211_sta_activate_link() return 0 in the 'hash' label case.
> > Hence, setting ret in the !test_sta_flag(...) branch to zero is not needed
> > anymore and can be dropped.
> >
> > Remove a needless assignment.
> >
> > No functional change. No change in object code.
> >
> > Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
> > ---
> > net/mac80211/sta_info.c | 1 -
> > 1 file changed, 1 deletion(-)
> >
> > diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
> > index cb23da9aff1e..492c7a29d797 100644
> > --- a/net/mac80211/sta_info.c
> > +++ b/net/mac80211/sta_info.c
> > @@ -2778,7 +2778,6 @@ int ieee80211_sta_activate_link(struct sta_info *sta, unsigned int link_id)
> > sta->sta.valid_links = new_links;
> >
> > if (!test_sta_flag(sta, WLAN_STA_INSERTED)) {
> > - ret = 0;
> > goto hash;
> > }
>
> Please, remove the {} as well.
>
Thanks for the pointer, Dan! I need to remember that for the future; I
did expect checkpatch to warn me of such a stylistic pattern, but it
seems that it does not. So I just need to have an eye on that.
Patch v2 sent out:
https://lore.kernel.org/lkml/20220812103126.25308-1-lukas.bulwahn@gmail.com/
Lukas
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-08-12 10:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-12 9:44 [PATCH] wifi: mac80211: clean up a needless assignment in ieee80211_sta_activate_link() Lukas Bulwahn
2022-08-12 10:02 ` Dan Carpenter
2022-08-12 10:33 ` Lukas Bulwahn
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox