Re: [PATCH 2/6] rtlwifi: Remove unnecessary parenthese in rtl_dbg uses

From: Pkshih
Date: Mon Jul 27 2020 - 05:05:06 EST


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).