netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jes Sorensen <Jes.Sorensen@redhat.com>
To: Joe Perches <joe@perches.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>,
	Jean Delvare <jdelvare@suse.de>,
	Chaoming Li <chaoming_li@realsil.com.cn>,
	Kalle Valo <kvalo@codeaurora.org>,
	linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] realtek: Add switch variable to 'switch case not processed' messages
Date: Sat, 24 Sep 2016 16:35:24 -0400	[thread overview]
Message-ID: <wrfjzimxrq7n.fsf@redhat.com> (raw)
In-Reply-To: <1474748954.23838.21.camel@perches.com> (Joe Perches's message of "Sat, 24 Sep 2016 13:29:14 -0700")

Joe Perches <joe@perches.com> writes:
> On Sat, 2016-09-24 at 14:06 -0500, Larry Finger wrote:
>> On 09/24/2016 12:32 PM, Joe Perches wrote:
> []
>> o Reindent all the switch/case blocks to a more normal
>>   kernel style (git diff -w would show no changes here)
>> That sounds like busy work to me, but if you want to do it, go ahead.
>
> It's really just to make the comparison case block reductions
> easier to verify for later steps done
>
>> > o cast, spacing and parenthesis reductions
>> >   Lots of odd and somewhat unique styles in various
>> >   drivers, looks like too many individual authors without
>> >   a style guide / code enforcer using slightly different
>> >   personalized code.  Glancing at the code, it looks to be
>> >   similar logic, just written in different styles.
>> Same comment.
>
> Same rationale
>
>> > o Logic changes like
>> >   from:
>> >     if (foo) func(..., bar, ...); else func(..., baz, ...);
>> >   to:
>> >     func(..., foo ? bar : baz, ...);
>> >   to make the case statement code blocks more consistent
>> >   and emit somewhat smaller object code.
>> I find if .. else constructs much easier to read than the cond ? xxxx : yyyy 
>> form. I would reject any such patches.
>
> <shrug> I think object code reduction generally a good thing
> but then again, I'm not a maintainer here.

I missed this part, but I am with Larry here - 'foo ? bar : boo' are
just obfuscating the code and far less clear than if or switch
statements.

Jes

  reply	other threads:[~2016-09-24 20:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1474654333.1849.5.camel@perches.com>
2016-09-23 18:27 ` [PATCH] realtek: Add switch variable to 'switch case not processed' messages Joe Perches
2016-09-23 18:59   ` Larry Finger
2016-09-23 19:02     ` Joe Perches
2016-09-24 15:55       ` Jean Delvare
2016-09-24 16:15         ` Joe Perches
2016-09-24 16:35           ` Larry Finger
2016-09-24 17:32             ` Joe Perches
2016-09-24 19:06               ` Larry Finger
2016-09-24 20:02                 ` Jes Sorensen
2016-09-24 20:29                 ` Joe Perches
2016-09-24 20:35                   ` Jes Sorensen [this message]
2016-09-26  9:33           ` David Laight
     [not found]   ` <d091f73a6adf3bdaa09ab0399c22a9fdfe9b188c.1474654979.git.joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
2016-09-23 19:07     ` Larry Finger
2016-09-27 15:45   ` rtlwifi: " Kalle Valo

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=wrfjzimxrq7n.fsf@redhat.com \
    --to=jes.sorensen@redhat.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=chaoming_li@realsil.com.cn \
    --cc=jdelvare@suse.de \
    --cc=joe@perches.com \
    --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).