mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Francesco Dolcini <francesco@dolcini.it>
Cc: Brian Norris <briannorris@chromium.org>,
	Kalle Valo <kvalo@kernel.org>,
	linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 11/12] wifi: mwifiex: move common settings out of switch/case
Date: Mon, 9 Sep 2024 22:21:41 +0200	[thread overview]
Message-ID: <Zt9Y1fe-Q9cHY_s5@pengutronix.de> (raw)
In-Reply-To: <Zt8rv-nOERIac4T9@gaggiata.pivistrello.it>

On Mon, Sep 09, 2024 at 07:09:19PM +0200, Francesco Dolcini wrote:
> On Mon, Aug 26, 2024 at 01:01:32PM +0200, Sascha Hauer wrote:
> > In mwifiex_add_virtual_intf() several settings done in a switch/case
> > are the same in all cases. Move them out of the switch/case to
> > deduplicate the code.
> > 
> > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> > ---
> >  drivers/net/wireless/marvell/mwifiex/cfg80211.c | 16 +++++-----------
> >  1 file changed, 5 insertions(+), 11 deletions(-)
> > 
> > diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
> > index 8746943c17788..2ce54a3fc32f8 100644
> > --- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c
> > +++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
> > @@ -3005,7 +3005,6 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy,
> >  			return ERR_PTR(-EFAULT);
> >  		}
> >  
> > -		priv->wdev.wiphy = wiphy;
> >  		priv->wdev.iftype = NL80211_IFTYPE_STATION;
> >  
> >  		if (type == NL80211_IFTYPE_UNSPECIFIED)
> > @@ -3014,8 +3013,6 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy,
> >  			priv->bss_mode = type;
> >  
> >  		priv->bss_type = MWIFIEX_BSS_TYPE_STA;
> > -		priv->frame_type = MWIFIEX_DATA_FRAME_TYPE_ETH_II;
> > -		priv->bss_priority = 0;
> >  		priv->bss_role = MWIFIEX_BSS_ROLE_STA;
> >  
> >  		break;
> > @@ -3035,14 +3032,10 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy,
> >  			return ERR_PTR(-EFAULT);
> >  		}
> >  
> > -		priv->wdev.wiphy = wiphy;
> >  		priv->wdev.iftype = NL80211_IFTYPE_AP;
> >  
> >  		priv->bss_type = MWIFIEX_BSS_TYPE_UAP;
> > -		priv->frame_type = MWIFIEX_DATA_FRAME_TYPE_ETH_II;
> > -		priv->bss_priority = 0;
> >  		priv->bss_role = MWIFIEX_BSS_ROLE_UAP;
> > -		priv->bss_started = 0;
> >  		priv->bss_mode = type;
> >  
> >  		break;
> > @@ -3062,7 +3055,6 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy,
> >  			return ERR_PTR(-EFAULT);
> >  		}
> >  
> > -		priv->wdev.wiphy = wiphy;
> >  		/* At start-up, wpa_supplicant tries to change the interface
> >  		 * to NL80211_IFTYPE_STATION if it is not managed mode.
> >  		 */
> > @@ -3075,10 +3067,7 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy,
> >  		 */
> >  		priv->bss_type = MWIFIEX_BSS_TYPE_P2P;
> >  
> > -		priv->frame_type = MWIFIEX_DATA_FRAME_TYPE_ETH_II;
> > -		priv->bss_priority = 0;
> >  		priv->bss_role = MWIFIEX_BSS_ROLE_STA;
> > -		priv->bss_started = 0;
> >  
> >  		if (mwifiex_cfg80211_init_p2p_client(priv)) {
> >  			memset(&priv->wdev, 0, sizeof(priv->wdev));
> > @@ -3092,6 +3081,11 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy,
> >  		return ERR_PTR(-EINVAL);
> >  	}
> >  
> > +	priv->wdev.wiphy = wiphy;
> > +	priv->bss_priority = 0;
> > +	priv->bss_started = 0;
> 
> This was not set before in all the 3 cases. Irrelevant? Worth checking and/or
> mentioning in the commit message?

bss_started is only used in AP mode, its value is irrelevant in station
or adhoc mode. I'll add that to the commit message.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

  reply	other threads:[~2024-09-09 20:21 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-26 11:01 [PATCH 00/12] mwifiex: two fixes and cleanup Sascha Hauer
2024-08-26 11:01 ` [PATCH 01/12] wifi: mwifiex: add missing locking Sascha Hauer
2024-08-27 11:55   ` Francesco Dolcini
2024-09-02  6:30     ` [EXT] " David Lin
2024-08-26 11:01 ` [PATCH 02/12] wifi: mwifiex: fix MAC address handling Sascha Hauer
2024-09-06 14:40   ` Francesco Dolcini
2024-09-09  8:09     ` Sascha Hauer
2024-09-09 16:42       ` Francesco Dolcini
2024-08-26 11:01 ` [PATCH 03/12] wifi: mwifiex: deduplicate code in mwifiex_cmd_tx_rate_cfg() Sascha Hauer
2024-09-06 14:54   ` Francesco Dolcini
2024-08-26 11:01 ` [PATCH 04/12] wifi: mwifiex: use adapter as context pointer for mwifiex_hs_activated_event() Sascha Hauer
2024-09-06 15:03   ` Francesco Dolcini
2024-08-26 11:01 ` [PATCH 05/12] wifi: mwifiex: drop unnecessary initialization Sascha Hauer
2024-09-06 15:07   ` Francesco Dolcini
2024-08-26 11:01 ` [PATCH 06/12] wifi: mwifiex: make region_code_mapping_t const Sascha Hauer
2024-09-06 15:08   ` Francesco Dolcini
2024-08-26 11:01 ` [PATCH 07/12] wifi: mwifiex: pass adapter to mwifiex_dnld_cmd_to_fw() Sascha Hauer
2024-09-06 15:11   ` Francesco Dolcini
2024-08-26 11:01 ` [PATCH 08/12] wifi: mwifiex: simplify mwifiex_setup_ht_caps() Sascha Hauer
2024-09-09 17:04   ` Francesco Dolcini
2024-08-26 11:01 ` [PATCH 09/12] wifi: mwifiex: fix indention Sascha Hauer
2024-09-06 15:15   ` Francesco Dolcini
2024-08-26 11:01 ` [PATCH 10/12] wifi: mwifiex: make locally used function static Sascha Hauer
2024-09-06 15:16   ` Francesco Dolcini
2024-08-26 11:01 ` [PATCH 11/12] wifi: mwifiex: move common settings out of switch/case Sascha Hauer
2024-09-09 17:09   ` Francesco Dolcini
2024-09-09 20:21     ` Sascha Hauer [this message]
2024-09-09 20:55       ` Francesco Dolcini
2024-08-26 11:01 ` [PATCH 12/12] wifi: mwifiex: drop asynchronous init waiting code Sascha Hauer
2024-09-09 17:14   ` Francesco Dolcini
2024-09-09 20:14     ` Sascha Hauer
2024-09-10  8:30       ` Francesco Dolcini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Zt9Y1fe-Q9cHY_s5@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=briannorris@chromium.org \
    --cc=francesco@dolcini.it \
    --cc=kvalo@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®