[1/4] staging: rtl8192e: Rename variable SetWirelessMode

Message ID 5a1ee0e9ef53ebe6085c14dba08c438862ec992e.1685284727.git.yogi.kernel@gmail.com
State New
Headers
Series Trivial code cleanup patches |

Commit Message

Yogesh Hegde May 28, 2023, 2:51 p.m. UTC
  Rename variable SetWirelessMode to set_wireless_mode to avoid
CamelCase which is not accepted by checkpatch.

Signed-off-by: Yogesh Hegde <yogi.kernel@gmail.com>
---
 drivers/staging/rtl8192e/rtl8192e/rtl_core.c |  2 +-
 drivers/staging/rtl8192e/rtllib.h            |  2 +-
 drivers/staging/rtl8192e/rtllib_softmac.c    | 12 ++++++------
 3 files changed, 8 insertions(+), 8 deletions(-)
  

Comments

Greg KH May 28, 2023, 4:01 p.m. UTC | #1
On Sun, May 28, 2023 at 08:21:33PM +0530, Yogesh Hegde wrote:
> Rename variable SetWirelessMode to set_wireless_mode to avoid
> CamelCase which is not accepted by checkpatch.
> 
> Signed-off-by: Yogesh Hegde <yogi.kernel@gmail.com>
> ---
>  drivers/staging/rtl8192e/rtl8192e/rtl_core.c |  2 +-
>  drivers/staging/rtl8192e/rtllib.h            |  2 +-
>  drivers/staging/rtl8192e/rtllib_softmac.c    | 12 ++++++------
>  3 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
> index 17b70dde7eeb..699c4accf2db 100644
> --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
> +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
> @@ -716,7 +716,7 @@ static void _rtl92e_init_priv_handler(struct net_device *dev)
>  	priv->rtllib->check_nic_enough_desc	= _rtl92e_check_nic_enough_desc;
>  	priv->rtllib->handle_assoc_response	= _rtl92e_handle_assoc_response;
>  	priv->rtllib->handle_beacon		= _rtl92e_handle_beacon;
> -	priv->rtllib->SetWirelessMode		= rtl92e_set_wireless_mode;
> +	priv->rtllib->set_wireless_mode		= rtl92e_set_wireless_mode;

As this is only set in one place, why is it needed at all?  Why not just
call the real function instead?

Same for the other patches in this series, why not turn this into a set
of cleanup patches removing the unnecessary indirection and removing the
CamelCase variables entirely?

thanks,

greg k-h
  
Yogesh Hegde May 31, 2023, 3:46 p.m. UTC | #2
On Sun, May 28, 2023 at 05:01:45PM +0100, Greg Kroah-Hartman wrote:
> On Sun, May 28, 2023 at 08:21:33PM +0530, Yogesh Hegde wrote:
> > Rename variable SetWirelessMode to set_wireless_mode to avoid
> > CamelCase which is not accepted by checkpatch.
> > 
> > Signed-off-by: Yogesh Hegde <yogi.kernel@gmail.com>
> > ---
> >  drivers/staging/rtl8192e/rtl8192e/rtl_core.c |  2 +-
> >  drivers/staging/rtl8192e/rtllib.h            |  2 +-
> >  drivers/staging/rtl8192e/rtllib_softmac.c    | 12 ++++++------
> >  3 files changed, 8 insertions(+), 8 deletions(-)
> > 
> > diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
> > index 17b70dde7eeb..699c4accf2db 100644
> > --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
> > +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
> > @@ -716,7 +716,7 @@ static void _rtl92e_init_priv_handler(struct net_device *dev)
> >  	priv->rtllib->check_nic_enough_desc	= _rtl92e_check_nic_enough_desc;
> >  	priv->rtllib->handle_assoc_response	= _rtl92e_handle_assoc_response;
> >  	priv->rtllib->handle_beacon		= _rtl92e_handle_beacon;
> > -	priv->rtllib->SetWirelessMode		= rtl92e_set_wireless_mode;
> > +	priv->rtllib->set_wireless_mode		= rtl92e_set_wireless_mode;
> 
> As this is only set in one place, why is it needed at all?  Why not just
> call the real function instead?
You are right. I don't understand why the code was originally written this way.

> Same for the other patches in this series, why not turn this into a set
> of cleanup patches removing the unnecessary indirection and removing the
> CamelCase variables entirely?
Yes you are right. I will work on transforming this series into a set of 
cleanup patches to eliminate the unnecessary indirection and remove the 
CamelCase variables entirely.

Thanks for your feedback. 

Regards 
Yogesh
  

Patch

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index 17b70dde7eeb..699c4accf2db 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -716,7 +716,7 @@  static void _rtl92e_init_priv_handler(struct net_device *dev)
 	priv->rtllib->check_nic_enough_desc	= _rtl92e_check_nic_enough_desc;
 	priv->rtllib->handle_assoc_response	= _rtl92e_handle_assoc_response;
 	priv->rtllib->handle_beacon		= _rtl92e_handle_beacon;
-	priv->rtllib->SetWirelessMode		= rtl92e_set_wireless_mode;
+	priv->rtllib->set_wireless_mode		= rtl92e_set_wireless_mode;
 	priv->rtllib->LeisurePSLeave		= rtl92e_leisure_ps_leave;
 	priv->rtllib->SetBWModeHandler		= rtl92e_set_bw_mode;
 	priv->rf_set_chan			= rtl92e_set_channel;
diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h
index 4aa5ce9f7792..03f8703f5def 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -1710,7 +1710,7 @@  struct rtllib_device {
 				 enum ht_channel_width bandwidth,
 				 enum ht_extchnl_offset Offset);
 	bool (*GetNmodeSupportBySecCfg)(struct net_device *dev);
-	void (*SetWirelessMode)(struct net_device *dev, u8 wireless_mode);
+	void (*set_wireless_mode)(struct net_device *dev, u8 wireless_mode);
 	bool (*GetHalfNmodeSupportByAPsHandler)(struct net_device *dev);
 	u8   (*rtllib_ap_sec_type)(struct rtllib_device *ieee);
 	void (*InitialGainHandler)(struct net_device *dev, u8 Operation);
diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c
index 7c4cba6dcf46..bbb1f2f0d35b 100644
--- a/drivers/staging/rtl8192e/rtllib_softmac.c
+++ b/drivers/staging/rtl8192e/rtllib_softmac.c
@@ -1503,7 +1503,7 @@  static void rtllib_associate_complete_wq(void *data)
 		netdev_info(ieee->dev, "Using G rates:%d\n", ieee->rate);
 	} else {
 		ieee->rate = 22;
-		ieee->SetWirelessMode(ieee->dev, IEEE_B);
+		ieee->set_wireless_mode(ieee->dev, IEEE_B);
 		netdev_info(ieee->dev, "Using B rates:%d\n", ieee->rate);
 	}
 	if (ieee->ht_info->bCurrentHTSupport && ieee->ht_info->enable_ht) {
@@ -1687,13 +1687,13 @@  inline void rtllib_softmac_new_net(struct rtllib_device *ieee,
 				    (ieee->modulation &
 				     RTLLIB_OFDM_MODULATION)) {
 					ieee->rate = 108;
-					ieee->SetWirelessMode(ieee->dev,
+					ieee->set_wireless_mode(ieee->dev,
 							      IEEE_G);
 					netdev_info(ieee->dev,
 						    "Using G rates\n");
 				} else {
 					ieee->rate = 22;
-					ieee->SetWirelessMode(ieee->dev,
+					ieee->set_wireless_mode(ieee->dev,
 							      IEEE_B);
 					netdev_info(ieee->dev,
 						    "Using B rates\n");
@@ -2276,11 +2276,11 @@  static void rtllib_rx_auth_resp(struct rtllib_device *ieee, struct sk_buff *skb)
 		}
 		/* Dummy wirless mode setting to avoid encryption issue */
 		if (bSupportNmode) {
-			ieee->SetWirelessMode(ieee->dev,
+			ieee->set_wireless_mode(ieee->dev,
 					      ieee->current_network.mode);
 		} else {
 			/*TODO*/
-			ieee->SetWirelessMode(ieee->dev, IEEE_G);
+			ieee->set_wireless_mode(ieee->dev, IEEE_G);
 		}
 
 		if ((ieee->current_network.mode == IEEE_N_24G) &&
@@ -2615,7 +2615,7 @@  static void rtllib_start_ibss_wq(void *data)
 		}
 
 		ieee->current_network.qos_data.supported = 0;
-		ieee->SetWirelessMode(ieee->dev, IEEE_G);
+		ieee->set_wireless_mode(ieee->dev, IEEE_G);
 		ieee->current_network.mode = ieee->mode;
 		ieee->current_network.atim_window = 0;
 		ieee->current_network.capability = WLAN_CAPABILITY_IBSS;