[PATCH 3/4] Staging: rtl8712: ieee80211: fixed camelcase coding style

Joe Perches joe at perches.com
Mon May 8 21:45:51 UTC 2017


On Tue, 2017-05-09 at 01:03 +0530, Jaya Durga wrote:
> Fixed coding style issue

Do please strive to do more than shut up checkpatch
messages.  It's _far_ more important to use sensible
coding mechanisms and reuse existing code utilities.

> diff --git 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;
>  	}

For instance: this could be rewritten in a single line.

In a different patch, assuming you add a temporary for
&pnetwork->network.configuration, these 7 lines could be:

	cfg->ds_config = clamp(cfg->ds_config, 1, 14);


More information about the devel mailing list