public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Joe Perches <joe@perches.com>
Cc: netdev <netdev@vger.kernel.org>, David Miller <davem@davemloft.net>
Subject: Re: [RFC patch net/next] net: Hoist assigns from if?
Date: Tue, 15 Jun 2010 07:42:06 +0200	[thread overview]
Message-ID: <1276580526.30434.330.camel@edumazet-laptop> (raw)
In-Reply-To: <1276561234.4897.38.camel@Joe-Laptop.home>

Le lundi 14 juin 2010 à 17:20 -0700, Joe Perches a écrit :
> Awhile back I posted a script to reformat source code,
> similar to Lindent, but able to select in a piecemeal
> manner what source code style to convert.
> 
> http://lkml.org/lkml/2010/3/24/447
> 
> One of the options is to convert code from:
> 	if ((err = function(args)) != NULL) {
> to:
> 	err = function(args);
> 	if (err != NULL) {
> 
> I ran this script against net/ and get this result:
> 
> $ grep -rPl --include=*.[ch] "\bif\s*\(\s*\(" net/ | \
>   grep -v netfilter | \
>   xargs ./scripts/cvt_kernel_style.pl -o -convert=hoist_assigns_from_if 
> 
> and after a little cleanup, compilation verification, etc
> I get the diffstat below.  Should I post the actual patch?
> 

I'll answer for myself, but wait for David answer ;)

Quite honestly, this kind of patch sucks, because it pollutes 'git
blame' output. Its hard to point out the origin of a particular
bug/code, and we have to spend precious time playing with complex git
commands to go over cleanup patches.

Maybe its possible to mark a patch with a 'cleanups only' git qualifier
that can be ignored by 'git blame' ?

If not, that would be a nice git improvement to work on.

Alternatively, you could change real old stuff only (marked as the
original commit from Linus (1da177e4c3f4), creation of the known
universe back in 2005.




  reply	other threads:[~2010-06-15  5:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-15  0:20 [RFC patch net/next] net: Hoist assigns from if? Joe Perches
2010-06-15  5:42 ` Eric Dumazet [this message]
2010-06-15  5:59   ` David Miller
2010-06-15 16:22     ` Joe Perches
2010-06-15 17:23       ` David Miller
2010-06-15 17:42         ` Joe Perches
2010-06-15 17:46           ` David Miller
2010-06-15 17:51             ` Joe Perches
2010-06-15 18:04         ` Eric Dumazet
2010-06-15 18:28           ` 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=1276580526.30434.330.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=joe@perches.com \
    --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