All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/3] Staging: rtl8712: ieee80211: fixed camelcase coding style issue
@ 2017-05-07 19:15 Jaya Durga
  2017-05-07 23:07 ` Joe Perches
  0 siblings, 1 reply; 3+ messages in thread
From: Jaya Durga @ 2017-05-07 19:15 UTC (permalink / raw)
  To: gregkh
  Cc: Larry.Finger, florian.c.schilhabel, driverdev-devel, devel,
	linux-kernel, Jaya Durga

Fixed coding style issue

Signed-off-by: Jaya Durga <jayad@cdac.in>
---
 drivers/staging/rtl8712/ieee80211.c           |  7 ++++---
 drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 25 +++++++++++++------------
 drivers/staging/rtl8712/rtl871x_ioctl_rtl.c   |  9 ++++-----
 drivers/staging/rtl8712/rtl871x_mlme.c        | 20 ++++++++++----------
 drivers/staging/rtl8712/wlan_bssdef.h         | 16 ++++++++--------
 5 files changed, 39 insertions(+), 38 deletions(-)

diff --git a/drivers/staging/rtl8712/ieee80211.c b/drivers/staging/rtl8712/ieee80211.c
index 66d9daf..42cb46c 100644
--- a/drivers/staging/rtl8712/ieee80211.c
+++ b/drivers/staging/rtl8712/ieee80211.c
@@ -174,7 +174,8 @@ int r8712_generate_ie(struct registry_priv *pregistrypriv)
 	sz += 8;
 	ie += sz;
 	/*beacon interval : 2bytes*/
-	*(__le16 *)ie = cpu_to_le16((u16)pdev_network->Configuration.BeaconPeriod);
+	*(__le16 *)ie = cpu_to_le16(
+				(u16)pdev_network->configuration.beacon_period);
 	sz += 2;
 	ie += 2;
 	/*capability info*/
@@ -203,10 +204,10 @@ int r8712_generate_ie(struct registry_priv *pregistrypriv)
 	}
 	/*DS parameter set*/
 	ie = r8712_set_ie(ie, _DSSET_IE_, 1,
-			  (u8 *)&pdev_network->Configuration.DSConfig, &sz);
+			  (u8 *)&pdev_network->configuration.ds_config, &sz);
 	/*IBSS Parameter Set*/
 	ie = r8712_set_ie(ie, _IBSS_PARA_IE_, 2,
-			  (u8 *)&pdev_network->Configuration.ATIMWindow, &sz);
+			  (u8 *)&pdev_network->configuration.atim_window, &sz);
 	return sz;
 }
 
diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
index f4167f1..6adb4e5 100644
--- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
+++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
@@ -150,12 +150,12 @@ static noinline_for_stack char *translate_scan(struct _adapter *padapter,
 	u16	cap, ht_cap = false, mcs_rate;
 	u8 rssi;
 
-	if ((pnetwork->network.Configuration.DSConfig < 1) ||
-	    (pnetwork->network.Configuration.DSConfig > 14)) {
-		if (pnetwork->network.Configuration.DSConfig < 1)
-			pnetwork->network.Configuration.DSConfig = 1;
+	if ((pnetwork->network.configuration.ds_config < 1) ||
+	    (pnetwork->network.configuration.ds_config > 14)) {
+		if (pnetwork->network.configuration.ds_config < 1)
+			pnetwork->network.configuration.ds_config = 1;
 		else
-			pnetwork->network.Configuration.DSConfig = 14;
+			pnetwork->network.configuration.ds_config = 14;
 	}
 	/* AP MAC address */
 	iwe.cmd = SIOCGIWAP;
@@ -212,18 +212,19 @@ static noinline_for_stack char *translate_scan(struct _adapter *padapter,
 	iwe.cmd = SIOCGIWFREQ;
 	{
 		/*  check legal index */
-		u8 dsconfig = pnetwork->network.Configuration.DSConfig;
+		u8 dsconfig = pnetwork->network.configuration.ds_config;
 
 		if (dsconfig >= 1 && dsconfig <= sizeof(
 		    ieee80211_wlan_frequencies) / sizeof(long))
-			iwe.u.freq.m = (s32)(ieee80211_wlan_frequencies[
-				       pnetwork->network.Configuration.
-				       DSConfig - 1] * 100000);
+			iwe.u.freq.m = (s32)
+				(ieee80211_wlan_frequencies
+				[pnetwork->network.configuration.ds_config
+					- 1] * 100000);
 		else
 			iwe.u.freq.m = 0;
 	}
 	iwe.u.freq.e = (s16)1;
-	iwe.u.freq.i = (u8)pnetwork->network.Configuration.DSConfig;
+	iwe.u.freq.i = (u8)pnetwork->network.configuration.ds_config;
 	start = iwe_stream_add_event(info, start, stop, &iwe,
 		IW_EV_FREQ_LEN);
 	/* Add encryption capability */
@@ -702,9 +703,9 @@ static int r8711_wx_get_freq(struct net_device *dev,
 
 	if (check_fwstate(pmlmepriv, _FW_LINKED)) {
 		wrqu->freq.m = ieee80211_wlan_frequencies[
-			       pcur_bss->Configuration.DSConfig - 1] * 100000;
+			       pcur_bss->configuration.ds_config - 1] * 100000;
 		wrqu->freq.e = 1;
-		wrqu->freq.i = pcur_bss->Configuration.DSConfig;
+		wrqu->freq.i = pcur_bss->configuration.ds_config;
 	} else {
 		return -ENOLINK;
 	}
diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_rtl.c b/drivers/staging/rtl8712/rtl871x_ioctl_rtl.c
index c7f2e51..5970bbc 100644
--- a/drivers/staging/rtl8712/rtl871x_ioctl_rtl.c
+++ b/drivers/staging/rtl8712/rtl871x_ioctl_rtl.c
@@ -316,18 +316,17 @@ uint oid_rt_get_channel_hdl(struct oid_par_priv *poid_par_priv)
 {
 	struct _adapter *padapter = poid_par_priv->adapter_context;
 	struct	mlme_priv *pmlmepriv = &padapter->mlmepriv;
-	struct NDIS_802_11_CONFIGURATION *pnic_Config;
+	struct NDIS_802_11_CONFIGURATION *pnic_config;
 	u32   channelnum;
 
 	if (poid_par_priv->type_of_oid != QUERY_OID)
 		return RNDIS_STATUS_NOT_ACCEPTED;
 	if (check_fwstate(pmlmepriv, _FW_LINKED) ||
 	    check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE))
-		pnic_Config = &pmlmepriv->cur_network.network.Configuration;
+		pnic_config = &pmlmepriv->cur_network.network.configuration;
 	else
-		pnic_Config = &padapter->registrypriv.dev_network.
-			      Configuration;
-	channelnum = pnic_Config->DSConfig;
+		pnic_config = &padapter->registrypriv.dev_network.configuration;
+	channelnum = pnic_config->ds_config;
 	*(u32 *)poid_par_priv->information_buf = channelnum;
 	*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
 	return RNDIS_STATUS_SUCCESS;
diff --git a/drivers/staging/rtl8712/rtl871x_mlme.c b/drivers/staging/rtl8712/rtl871x_mlme.c
index bf1ac22..4d7dd84 100644
--- a/drivers/staging/rtl8712/rtl871x_mlme.c
+++ b/drivers/staging/rtl8712/rtl871x_mlme.c
@@ -276,8 +276,8 @@ static int is_same_network(struct wlan_bssid_ex *src,
 	memcpy((u8 *)&s_cap, r8712_get_capability_from_ie(src->IEs), 2);
 	memcpy((u8 *)&d_cap, r8712_get_capability_from_ie(dst->IEs), 2);
 	return (src->Ssid.SsidLength == dst->Ssid.SsidLength) &&
-			(src->Configuration.DSConfig ==
-			dst->Configuration.DSConfig) &&
+			(src->configuration.ds_config ==
+			dst->configuration.ds_config) &&
 			((!memcmp(src->MacAddress, dst->MacAddress,
 			ETH_ALEN))) &&
 			((!memcmp(src->Ssid.Ssid,
@@ -1615,13 +1615,13 @@ void r8712_init_registrypriv_dev_network(struct _adapter *adapter)
 	memcpy(pdev_network->MacAddress, myhwaddr, ETH_ALEN);
 	memcpy(&pdev_network->Ssid, &pregistrypriv->ssid,
 		sizeof(struct ndis_802_11_ssid));
-	pdev_network->Configuration.Length =
+	pdev_network->configuration.Length =
 			 sizeof(struct NDIS_802_11_CONFIGURATION);
-	pdev_network->Configuration.BeaconPeriod = 100;
-	pdev_network->Configuration.FHConfig.Length = 0;
-	pdev_network->Configuration.FHConfig.HopPattern = 0;
-	pdev_network->Configuration.FHConfig.HopSet = 0;
-	pdev_network->Configuration.FHConfig.DwellTime = 0;
+	pdev_network->configuration.beacon_period = 100;
+	pdev_network->configuration.fh_config.Length = 0;
+	pdev_network->configuration.fh_config.hop_pattern = 0;
+	pdev_network->configuration.fh_config.hop_set = 0;
+	pdev_network->configuration.fh_config.dwell_time = 0;
 }
 
 void r8712_update_registrypriv_dev_network(struct _adapter *adapter)
@@ -1650,9 +1650,9 @@ void r8712_update_registrypriv_dev_network(struct _adapter *adapter)
 		/* TODO */
 		break;
 	}
-	pdev_network->Configuration.DSConfig = pregistrypriv->channel;
+	pdev_network->configuration.ds_config = pregistrypriv->channel;
 	if (cur_network->network.InfrastructureMode == Ndis802_11IBSS)
-		pdev_network->Configuration.ATIMWindow = 3;
+		pdev_network->configuration.atim_window = 3;
 	pdev_network->InfrastructureMode = cur_network->network.InfrastructureMode;
 	/* 1. Supported rates
 	 * 2. IE
diff --git a/drivers/staging/rtl8712/wlan_bssdef.h b/drivers/staging/rtl8712/wlan_bssdef.h
index c0654ae..27fd5aa6 100644
--- a/drivers/staging/rtl8712/wlan_bssdef.h
+++ b/drivers/staging/rtl8712/wlan_bssdef.h
@@ -47,9 +47,9 @@ enum NDIS_802_11_NETWORK_TYPE {
 
 struct NDIS_802_11_CONFIGURATION_FH {
 	u32 Length;             /* Length of structure */
-	u32 HopPattern;         /* As defined by 802.11, MSB set */
-	u32 HopSet;             /* to one if non-802.11 */
-	u32 DwellTime;          /* units are Kusec */
+	u32 hop_pattern;         /* As defined by 802.11, MSB set */
+	u32 hop_set;             /* to one if non-802.11 */
+	u32 dwell_time;          /* units are Kusec */
 };
 
 /*
@@ -58,10 +58,10 @@ struct NDIS_802_11_CONFIGURATION_FH {
 */
 struct NDIS_802_11_CONFIGURATION {
 	u32 Length;             /* Length of structure */
-	u32 BeaconPeriod;       /* units are Kusec */
-	u32 ATIMWindow;         /* units are Kusec */
-	u32 DSConfig;           /* Frequency, units are kHz */
-	struct NDIS_802_11_CONFIGURATION_FH FHConfig;
+	u32 beacon_period;       /* units are Kusec */
+	u32 atim_window;         /* units are Kusec */
+	u32 ds_config;           /* Frequency, units are kHz */
+	struct NDIS_802_11_CONFIGURATION_FH fh_config;
 };
 
 enum NDIS_802_11_NETWORK_INFRASTRUCTURE {
@@ -86,7 +86,7 @@ struct wlan_bssid_ex {
 	__le32 Privacy;
 	s32 Rssi;
 	enum NDIS_802_11_NETWORK_TYPE  NetworkTypeInUse;
-	struct NDIS_802_11_CONFIGURATION  Configuration;
+	struct NDIS_802_11_CONFIGURATION  configuration;
 	enum NDIS_802_11_NETWORK_INFRASTRUCTURE  InfrastructureMode;
 	u8 rates[NDIS_802_11_LENGTH_RATES_EX];
 	/* number of content bytes in EIs, which varies */
-- 
1.9.1

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

* Re: [PATCH 3/3] Staging: rtl8712: ieee80211: fixed camelcase coding style issue
  2017-05-07 19:15 [PATCH 3/3] Staging: rtl8712: ieee80211: fixed camelcase coding style issue Jaya Durga
@ 2017-05-07 23:07 ` Joe Perches
  0 siblings, 0 replies; 3+ messages in thread
From: Joe Perches @ 2017-05-07 23:07 UTC (permalink / raw)
  To: Jaya Durga, gregkh
  Cc: Larry.Finger, florian.c.schilhabel, driverdev-devel, devel, linux-kernel

On Mon, 2017-05-08 at 00:45 +0530, Jaya Durga wrote:
> Fixed coding style issue

Please list the various renames you are doing.

BeaconPeriod	-> beacon_period
DSConfig	-> ds_config
ATIMWindow	-> atim_window

etc...

And it's generally better to do these while avoiding
changing line breaks.


There are maintainers that also would want these
renames done in individual separate patches.

> diff --git a/drivers/staging/rtl8712/ieee80211.c b/drivers/staging/rtl8712/ieee80211.c
[]
> @@ -174,7 +174,8 @@ int r8712_generate_ie(struct registry_priv *pregistrypriv)
>  	sz += 8;
>  	ie += sz;
>  	/*beacon interval : 2bytes*/
> -	*(__le16 *)ie = cpu_to_le16((u16)pdev_network->Configuration.BeaconPeriod);
> +	*(__le16 *)ie = cpu_to_le16(
> +				(u16)pdev_network->configuration.beacon_period);

It's also frequently better to use a temporary pointer
and convert these relatively long indirections to
something simpler like:

	<whatever_type> *cfg = &pdev_network->configuration;

	*(__le16 *)ie = cpu_to_le16(cfg->beacon_period);

etc...

in separate patches.

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

* Re: [PATCH 3/3] Staging: rtl8712: ieee80211: fixed camelcase coding style issue
@ 2017-05-08 18:56 R Jayadurga
  0 siblings, 0 replies; 3+ messages in thread
From: R Jayadurga @ 2017-05-08 18:56 UTC (permalink / raw)
  To: Joe Perches, gregkh
  Cc: florian.c.schilhabel, Larry.Finger, linux-kernel, driverdev-devel, devel

[-- Attachment #1: Type: text/plain, Size: 3036 bytes --]

Hi,
    Thank you for your feedback will follow your suggestion ,when I try to solve
the WARNING: line over 80 characters ,
Line no:177 in the file drivers/staging/rtl8712/ieee80211.c

    *(u16 *)ie = cpu_to_le16((u16)pdev_network->Configuration.BeaconPeriod);

and created patch the patch had camel case styling issues because of
 Configuration.BeaconPeriod.

Renaming the parameter and creating patches leads to solve more camel case
issue to create the patch without styling issue ,Thats  why I was not able to
create separate patch's for each issue they were dependent.

The following are the renames  done
            Configuration   -> configuration
            BeaconPeriod -> beacon_period
            ATIMWindow    -> atim_window
            DSConfig          -> ds_config
            FHConfig           -> fh_config
            HopPattern        -> hop_pattern
            HopSet               -> hop_set
            DwellTime         -> dwell_time

Kindly let me know that i have to resubmit the patch again ..

Regards
Jaya Durga R



On May 8, 2017 at 4:37 AM Joe Perches <joe@perches.com> wrote:
> On Mon, 2017-05-08 at 00:45 +0530, Jaya Durga wrote:
> > Fixed coding style issue
>
> Please list the various renames you are doing.
>
> BeaconPeriod -> beacon_period
> DSConfig -> ds_config
> ATIMWindow -> atim_window
>
> etc...
>
> And it's generally better to do these while avoiding
> changing line breaks.
>
>
> There are maintainers that also would want these
> renames done in individual separate patches.
>
> > diff --git a/drivers/staging/rtl8712/ieee80211.c
> > b/drivers/staging/rtl8712/ieee80211.c
> []
> > @@ -174,7 +174,8 @@ int r8712_generate_ie(struct registry_priv
> > *pregistrypriv)
> > sz += 8;
> > ie += sz;
> > /*beacon interval : 2bytes*/
> > - *(__le16 *)ie =
> > cpu_to_le16((u16)pdev_network->Configuration.BeaconPeriod);
> > + *(__le16 *)ie = cpu_to_le16(
> > + (u16)pdev_network->configuration.beacon_period);
>
> It's also frequently better to use a temporary pointer
> and convert these relatively long indirections to
> something simpler like:
>
> <whatever_type> *cfg = &pdev_network->configuration;
>
> *(__le16 *)ie = cpu_to_le16(cfg->beacon_period);
>
> etc...
>
> in separate patches.
>
>
-------------------------------------------------------------------------------------------------------------------------------
[ C-DAC is on Social-Media too. Kindly follow us at:
Facebook: https://www.facebook.com/CDACINDIA & Twitter: @cdacindia ]

This e-mail is for the sole use of the intended recipient(s) and may
contain confidential and privileged information. If you are not the
intended recipient, please contact the sender by reply e-mail and destroy
all copies and the original message. Any unauthorized review, use,
disclosure, dissemination, forwarding, printing or copying of this email
is strictly prohibited and appropriate legal action will be taken.
-------------------------------------------------------------------------------------------------------------------------------


[-- Attachment #2: Type: text/html, Size: 5394 bytes --]

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

end of thread, other threads:[~2017-05-08 18:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-07 19:15 [PATCH 3/3] Staging: rtl8712: ieee80211: fixed camelcase coding style issue Jaya Durga
2017-05-07 23:07 ` Joe Perches
2017-05-08 18:56 R Jayadurga

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.