public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>,
	Jeremiah Mahler <jmmahler@gmail.com>,
	devel@driverdev.osuosl.org, gregkh@linuxfoundation.org,
	jun.j.tian@intel.com, linux-kernel@vger.kernel.org,
	octavian.purdila@intel.com, apw@canonical.com, nnk@google.com,
	alan@linux.intel.com
Subject: Re: [PATCH] checkpatch giving bogus advice (was staging: goldfish: Fix minor coding style)
Date: Mon, 15 Dec 2014 16:50:57 -0800	[thread overview]
Message-ID: <1418691057.2674.26.camel@perches.com> (raw)
In-Reply-To: <20141215115956.GD4856@mwanda>

On Mon, 2014-12-15 at 14:59 +0300, Dan Carpenter wrote:
> I prefer !foo because it is more common in the kernel and I think it's
> easier to read but I don't feel strongly about this.

Me too.  But I do prefer consistency.

fyi: for variants of:

	"if (!foo)"
vs
	"if (foo == NULL)"

a little cocci script shows a preference for "if (!foo)"
of >5:1 in drivers/net/
(actual: 11557:2145)
and a little less (>3:1) in net/
(actual: 10263:3045)

$ cat pointer_style.cocci
@@
type T;
T *a;
@@

*	a == NULL

@@
type T;
T *a;
@@

*	a != NULL

@@
type T;
T *a;
@@

*	!a



  reply	other threads:[~2014-12-16  0:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-13 16:29 [PATCH] staging: goldfish: Fix minor coding style Loic Pefferkorn
2014-12-13 17:55 ` Jeremiah Mahler
2014-12-13 18:22   ` Loic Pefferkorn
2014-12-13 19:46     ` Jeremiah Mahler
2014-12-15 11:44       ` [PATCH] checkpatch giving bogus advice (was staging: goldfish: Fix minor coding style) One Thousand Gnomes
2014-12-15 11:59         ` Dan Carpenter
2014-12-16  0:50           ` Joe Perches [this message]
2014-12-15 13:03         ` Jeremiah Mahler
2014-12-15 13:43           ` Dan Carpenter
2014-12-15 14:08             ` Jeremiah Mahler
2014-12-13 19:07 ` [PATCH] staging: goldfish: Fix minor coding style One Thousand Gnomes
2014-12-13 21:20   ` Loic Pefferkorn
2014-12-15 11:51     ` One Thousand Gnomes
2014-12-15 12:26       ` Loic Pefferkorn

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=1418691057.2674.26.camel@perches.com \
    --to=joe@perches.com \
    --cc=alan@linux.intel.com \
    --cc=apw@canonical.com \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gnomes@lxorguk.ukuu.org.uk \
    --cc=gregkh@linuxfoundation.org \
    --cc=jmmahler@gmail.com \
    --cc=jun.j.tian@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nnk@google.com \
    --cc=octavian.purdila@intel.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