public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: simran singhal <singhalsimran0@gmail.com>, gregkh@linuxfoundation.org
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 6/9] staging: rtl8192u: Fixing coding style issues
Date: Tue, 14 Feb 2017 12:23:19 -0800	[thread overview]
Message-ID: <1487103799.6214.27.camel@perches.com> (raw)
In-Reply-To: <20170214201432.GA4150@singhal-Inspiron-5558>

On Wed, 2017-02-15 at 01:44 +0530, simran singhal wrote:
[]
> diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
[]
> @@ -150,14 +150,15 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
>  		PHT_CAPABILITY_ELE ht_cap = NULL;
>  		bool is40M = false, isShortGI = false;
>  		u8 max_mcs = 0;
> +
>  		if (!memcmp(network->bssht.bdHTCapBuf, EWC11NHTCap, 4))
>  			ht_cap = (PHT_CAPABILITY_ELE)&network->bssht.bdHTCapBuf[4];
>  		else
>  			ht_cap = (PHT_CAPABILITY_ELE)&network->bssht.bdHTCapBuf[0];
> -		is40M = (ht_cap->ChlWidth)?1:0;
> -		isShortGI = (ht_cap->ChlWidth)?
> -						((ht_cap->ShortGI40Mhz)?1:0):
> -						((ht_cap->ShortGI20Mhz)?1:0);
> +		is40M = (ht_cap->ChlWidth) ? 1 : 0;
> +		isShortGI = (ht_cap->ChlWidth) ?
> +						((ht_cap->ShortGI40Mhz) ? 1 : 0) :
> +						((ht_cap->ShortGI20Mhz) ? 1 : 0);

You have a brain, checkpatch is brainless.
Please remember to do more than just shut-up checkpatch.

This could be simplified by removing parentheses and ternaries to

		isShortGI = ht_cap->Ch1Width ? ht_cap->ShortGI40Mhz
					     : ht_cap->ShortGI20Mhz;

  reply	other threads:[~2017-02-14 20:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-14 20:14 [PATCH v2 6/9] staging: rtl8192u: Fixing coding style issues simran singhal
2017-02-14 20:23 ` Joe Perches [this message]
2017-02-15  3:22   ` SIMRAN SINGHAL
2017-02-15  3:31     ` Joe Perches
2017-02-15  8:18       ` SIMRAN SINGHAL
2017-02-15  9:23         ` Joe Perches
2017-02-16 18:32         ` Greg KH
2017-02-16 19:08           ` SIMRAN SINGHAL

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1487103799.6214.27.camel@perches.com \
    --to=joe@perches.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=singhalsimran0@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox