staging: wfx: change variable name to be consistent
PATCH 1/1 staging: wfx: change variable name to be consistent
Change variable name to be consistent with the naming conventions. ssidlen was changed to ssid_len and ssidie was changed to ssid_ie to be consistent. This makes the variables more readable. The other ssid names in the code are separated by an underscore. For example, bssid_filter and num_of_ssids have the ssid separated from the rest of the words with an underscore.
--- drivers/staging/wfx/hif_tx.c | 10 +++++----- drivers/staging/wfx/sta.c | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-)
drivers/staging/wfx/hif_tx.c +5 -5
@@ -280,7 +280,7 @@ int wfx_hif_stop_scan(struct wfx_vif *wvif) }int wfx_hif_join (struct wfx_vif *wvif,const struct ieee80211_bss_conf *conf, -struct ieee80211_channel *channel,const u8 *ssid,int ssidlen) +struct ieee80211_channel *channel,const u8 *ssid,int ssid_len) {int ret;struct wfx_hif_msg *hif;
@@ -288,8 +288,8 @@ int wfx_hif_join(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf,WARN_ON (!conf->beacon_int);WARN_ON (!conf->basic_rates); -WARN_ON (sizeof (body->ssid) < ssidlen); -WARN (!conf->ibss_joined && !ssidlen,"joining an unknown BSS" ); +WARN_ON (sizeof (body->ssid) < ssid_len); +WARN (!conf->ibss_joined && !ssid_len,"joining an unknown BSS" );if (!hif)return -ENOMEM ; body->infrastructure_bss_mode = !conf->ibss_joined;
@@ -300,8 +300,8 @@ int wfx_hif_join(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf, body->basic_rate_set =cpu_to_le32 (wfx_rate_mask_to_hw (wvif->wdev, conf->basic_rates));memcpy (body->bssid, conf->bssid,sizeof (body->bssid));if (ssid) { - body->ssid_length =cpu_to_le32 (ssidlen); -memcpy (body->ssid, ssid, ssidlen); + body->ssid_length =cpu_to_le32 (ssid_len); +memcpy (body->ssid, ssid, ssid_len); }wfx_fill_header (hif, wvif->id,HIF_REQ_ID_JOIN ,sizeof (*body)); ret =wfx_cmd_send (wvif->wdev, hif,NULL ,0 , false);
drivers/staging/wfx/sta.c +10 -10
@@ -392,8 +392,8 @@ static void wfx_join(struct wfx_vif *wvif)struct ieee80211_bss_conf *conf = &wvif->vif->bss_conf;struct cfg80211_bss *bss =NULL ;u8 ssid[IEEE80211_MAX_SSID_LEN ]; -const u8 *ssidie =NULL ; -int ssidlen =0 ; +const u8 *ssid_ie =NULL ; +int ssid_len =0 ;wfx_tx_lock_flush (wvif->wdev);
@@ -404,21 +404,21 @@ static void wfx_join(struct wfx_vif *wvif)return ; } -rcu_read_lock ();/* protect ssidie */ +rcu_read_lock ();/* protect ssid_ie */ if (bss) - ssidie =ieee80211_bss_get_ie (bss,WLAN_EID_SSID ); -if (ssidie) { - ssidlen = ssidie[1 ]; -if (ssidlen >IEEE80211_MAX_SSID_LEN ) - ssidlen =IEEE80211_MAX_SSID_LEN ; -memcpy (ssid, &ssidie[2 ], ssidlen); + ssid_ie =ieee80211_bss_get_ie (bss,WLAN_EID_SSID ); +if (ssid_ie) { + ssid_len = ssid_ie[1 ]; +if (ssid_len >IEEE80211_MAX_SSID_LEN ) + ssid_len =IEEE80211_MAX_SSID_LEN ; +memcpy (ssid, &ssid_ie[2 ], ssid_len); }rcu_read_unlock ();cfg80211_put_bss (wvif->wdev->hw->wiphy, bss); wvif->join_in_progress = true; - ret =wfx_hif_join (wvif, conf, wvif->channel, ssid, ssidlen); + ret =wfx_hif_join (wvif, conf, wvif->channel, ssid, ssid_len);if (ret) {ieee80211_connection_loss (wvif->vif);wfx_reset (wvif);
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerQuoted 18 lines · Jaehee Park
Change variable name to be consistent with the naming conventions. ssidlen was changed to
ssid_lenand ssidie was changed tossid_ieto be consistent. This makes the variables more readable. The other ssid names in the code are separated by an underscore. For example,bssid_filterandnum_of_ssidshave the ssid separated from the rest of the words with an underscore.Signed-off-by Jaehee Park <[email protected]>--- drivers/staging/wfx/hif_tx.c | 10 +++++----- drivers/staging/wfx/sta.c | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-)drivers/staging/wfx/hif_tx.c +0
-0
drivers/staging/wfx/hif_tx.c int wfx_hif_stop_scan(struct wfx_vif *wvif) · line 283
Quoted 5 lines
drivers/staging/wfx/hif_tx.c +1
-1@@ -280,7 +280,7 @@ int wfx_hif_stop_scan(struct wfx_vif *wvif) }int wfx_hif_join (struct wfx_vif *wvif,const struct ieee80211_bss_conf *conf, -struct ieee80211_channel *channel,const u8 *ssid,int ssidlen) +struct ieee80211_channel *channel,const u8 *ssid,int ssid_len)
This is not really a "coding style" cleanup, it is up to the driver author how they wish to name these variables. It is not a requirement to change them as the orginal names are just fine.
thanks,
greg k-h
Quoted 21 lines · On Sunday 3 April 2022 13:01:50 CEST Greg Kroah-Hartman wrote:
Quoted 20 lines · Jaehee Park
Change variable name to be consistent with the naming conventions. ssidlen was changed to
ssid_lenand ssidie was changed tossid_ieto be consistent. This makes the variables more readable. The other ssid names in the code are separated by an underscore. For example,bssid_filterandnum_of_ssidshave the ssid separated from the rest of the words with an underscore.Signed-off-by Jaehee Park <[email protected]>--- drivers/staging/wfx/hif_tx.c | 10 +++++----- drivers/staging/wfx/sta.c | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-)drivers/staging/wfx/hif_tx.c +0
-0@@ -280,7 +280,7 @@ int wfx_hif_stop_scan(struct wfx_vif *wvif) }
Quoted 7 lines
drivers/staging/wfx/hif_tx.c int wfx_hif_stop_scan(struct wfx_vif *wvif) · line 283
Quoted 3 lines
drivers/staging/wfx/hif_tx.c +1
-1int wfx_hif_join (struct wfx_vif *wvif,const struct ieee80211_bss_conf *conf, -struct ieee80211_channel *channel,const u8 *ssid,int ssidlen) +struct ieee80211_channel *channel,const u8 *ssid,int ssid_len)This is not really a "coding style" cleanup, it is up to the driver author how they wish to name these variables. It is not a requirement to change them as the orginal names are just fine.
I have no real opinion. Let's say you can apply it:
Signature · 1 line
Jérôme Pouiller