linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jes Sorensen <Jes.Sorensen@redhat.com>
To: Joe Perches <joe@perches.com>
Cc: Paul McQuade <paulmcquad@gmail.com>,
	linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org,
	linux-wireless@vger.kernel.org, gregkh@linuxfoundation.org,
	Larry.Finger@lwfinger.net
Subject: Re: [PATCH 2/2] staging: rtl8723au:core
Date: Mon, 27 Oct 2014 07:16:37 +0100	[thread overview]
Message-ID: <wrfj1tpuca0q.fsf@redhat.com> (raw)
In-Reply-To: <1414389096.15751.34.camel@perches.com> (Joe Perches's message of "Sun, 26 Oct 2014 22:51:36 -0700")

Joe Perches <joe@perches.com> writes:
> On Mon, 2014-10-27 at 06:45 +0100, Jes Sorensen wrote:
>> Joe Perches <joe@perches.com> writes:
>> > On Sun, 2014-10-26 at 16:18 +0000, Paul McQuade wrote:
>> >> ERROR: spaces required around that ':' (ctx:VxE)
> []
>> >> diff --git a/drivers/staging/rtl8723au/core/rtw_ieee80211.c
>> >> b/drivers/staging/rtl8723au/core/rtw_ieee80211.c
> []
>> >> @@ -794,28 +794,28 @@ u16 rtw_mcs_rate23a(u8 rf_type, u8 bw_40MHz, u8 short_GI_20, u8 short_GI_40,
>> >>  
>> >>  	if (rf_type == RF_1T1R) {
>> >>  		if (mcs->rx_mask[0] & BIT(7))
>> >> -			max_rate = (bw_40MHz) ? ((short_GI_40)?1500:1350):
>> >> +			max_rate = (bw_40MHz) ? ((short_GI_40)?1500:1350) :
> []
>> >
>> > A macro could help intelligibility here - maybe something like:
>> >
>> > #define get_max_rate(r1, r2, r3, r4)					\
>> > 	(bw_40MHz ? (short_GI_40 ? r1 : r2) : (short_GI_20 ? r3 : r4))
>> > and:
>> >  		if (mcs->rx_mask[0] & BIT(7))
>> > 			max_rate = get_max_rate(1500, 1350, 722, 650);
>> 
>> Hiding a parameter to a macro like that is bad coding practice, so don't
>> do that please!
>
> Yes and no.
>
> Adding the other 3 arguments to the macro doesn't help legibility.
>
> Keeping the macro definition local to the place that it's used
> can help avoid typos.

It's wrong, so just don't do it here!

Thank you,
Jes

  reply	other threads:[~2014-10-27  6:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-26 16:18 [PATCH 2/2] staging: rtl8723au:core Paul McQuade
2014-10-26 19:04 ` Joe Perches
2014-10-27  5:45   ` Jes Sorensen
2014-10-27  5:51     ` Joe Perches
2014-10-27  6:16       ` Jes Sorensen [this message]
2014-10-27  6:23         ` Joe Perches
2014-10-27  6:44           ` Jes Sorensen
2014-10-29  9:35 ` Greg KH

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=wrfj1tpuca0q.fsf@redhat.com \
    --to=jes.sorensen@redhat.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=paulmcquad@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;
as well as URLs for NNTP newsgroup(s).