lkml.org 
[lkml]   [2017]   [May]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 3/4] Staging: rtl8712: ieee80211: fixed camelcase coding style
From
Date
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);

\
 
 \ /
  Last update: 2017-05-10 21:18    [W:0.034 / U:1.792 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site