netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pkshih <pkshih@realtek.com>
To: "joe@perches.com" <joe@perches.com>,
	"Larry.Finger@lwfinger.net" <Larry.Finger@lwfinger.net>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	"kvalo@codeaurora.org" <kvalo@codeaurora.org>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"kuba@kernel.org" <kuba@kernel.org>
Subject: Re: [PATCH 2/6] rtlwifi: Remove unnecessary parenthese in rtl_dbg uses
Date: Mon, 27 Jul 2020 09:04:31 +0000	[thread overview]
Message-ID: <1595840670.17671.4.camel@realtek.com> (raw)
In-Reply-To: <ae9d562ec9ef765dddd1491d4cfb5f6d18f7025f.camel@perches.com>

On Mon, 2020-07-27 at 01:27 -0700, Joe Perches wrote:
> On Mon, 2020-07-27 at 06:07 +0000, Pkshih wrote:
> > On Sat, 2020-07-25 at 12:55 -0700, Joe Perches wrote:
> > > Make these statements a little simpler.
> []
> > > diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
> []
> > > @@ -874,11 +874,10 @@ static void halbtc_display_wifi_status(struct
> > > btc_coexist *btcoexist,
> > >  	seq_printf(m, "\n %-35s = %s / %s/ %s/ AP=%d ",
> > >  		   "Wifi freq/ bw/ traffic",
> > >  		   gl_btc_wifi_freq_string[wifi_freq],
> > > -		   ((wifi_under_b_mode) ? "11b" :
> > > -		    gl_btc_wifi_bw_string[wifi_bw]),
> > > -		   ((!wifi_busy) ? "idle" : ((BTC_WIFI_TRAFFIC_TX ==
> > > -					      wifi_traffic_dir) ?
> "uplink" :
> > > -					     "downlink")),
> > > +		   wifi_under_b_mode ? "11b" :
> gl_btc_wifi_bw_string[wifi_bw],
> > > +		   (!wifi_busy ? "idle" :
> > > +		    wifi_traffic_dir == BTC_WIFI_TRAFFIC_TX ? "uplink" :
> > > +		    "downlink"),
> > 
> > I think this would be better
> > 
> > +		   !wifi_busy ? "idle" :
> > +		   (wifi_traffic_dir == BTC_WIFI_TRAFFIC_TX ? "uplink" :
> > +		    "downlink"),
> 
> It seems most repeated test1 ? : test2 ? : test3 ?:
> uses do not have the style you suggest in the kernel.
> 

Your change is 
(test1 ? : test2 ? :)

So, I think you would like to have parenthesis intentionally.
If so, 
test1 ? : (test2 ? :)
would be better.


If not,
test1 ? : test2 ? :
may be what you want (without any parenthesis).


  reply	other threads:[~2020-07-27  9:05 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-25 19:55 [PATCH 0/6] rtlwifi: Convert RT_TRACE to rtl_dbg and neatening Joe Perches
2020-07-25 19:55 ` [PATCH 1/6] rtlwifi: Convert RT_TRACE to rtl_dbg Joe Perches
2020-07-25 19:55 ` [PATCH 2/6] rtlwifi: Remove unnecessary parenthese in rtl_dbg uses Joe Perches
2020-07-27  6:07   ` Pkshih
2020-07-27  8:27     ` Joe Perches
2020-07-27  9:04       ` Pkshih [this message]
2020-07-27 14:52         ` Joe Perches
2020-07-27 16:25           ` Larry Finger
2020-07-27 16:33             ` Joe Perches
2020-08-27  9:27             ` Kalle Valo
2020-08-27 10:52               ` Joe Perches
2020-07-25 19:55 ` [PATCH 3/6] rtlwifi: Better spacing around " Joe Perches
2020-07-25 19:55 ` [PATCH 4/6] rtlwifi: Convert rtl_dbg embedded function names to %s: ..., __func__ Joe Perches
2020-07-25 19:55 ` [PATCH 5/6] rtlwifi: Avoid multiline dereferences in rtl_dbg uses Joe Perches
2020-07-25 19:55 ` [PATCH 6/6] rtlwifi: Convert sleeped to slept " Joe Perches
2020-07-25 21:03 ` [PATCH 0/6] rtlwifi: Convert RT_TRACE to rtl_dbg and neatening Joe Perches

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=1595840670.17671.4.camel@realtek.com \
    --to=pkshih@realtek.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=davem@davemloft.net \
    --cc=joe@perches.com \
    --cc=kuba@kernel.org \
    --cc=kvalo@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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).