All of lore.kernel.org
 help / color / mirror / Atom feed
From: Devin Heitmueller <dheitmueller@kernellabs.com>
To: Peter Huewe <PeterHuewe@gmx.de>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>,
	Julia Lawall <julia@diku.dk>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org,
	Steven Toth <stoth@kernellabs.com>, Tejun Heo <tj@kernel.org>,
	Dan Carpenter <error27@gmail.com>
Subject: Re: [PATCH v2] video/saa7164: Fix sparse warning: Using plain integer as NULL pointer
Date: Sun, 30 Jan 2011 15:02:23 -0500	[thread overview]
Message-ID: <AANLkTin7HaZ5GNnPmM066K+OJwEzCUpw4-oGtAhXSgRt@mail.gmail.com> (raw)
In-Reply-To: <201101302033.01964.PeterHuewe@gmx.de>

On Sun, Jan 30, 2011 at 2:33 PM, Peter Huewe <PeterHuewe@gmx.de> wrote:
> From: Peter Huewe <peterhuewe@gmx.de>
>
> This patch fixes the warning "Using plain integer as NULL pointer",
> generated by sparse, by replacing
>        if(var == 0)
> with
>        if (!var)
> after an allocation
> and all other offending 0s with NULL.
>
> KernelVersion: linus' tree-1f0324c
>
> Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
> ---
> v2: I changed the patch according to Julia's hints.
> i.e. using if(!buf) instead of if(buf==NULL) after the kmalloc family,
> and other allocations.

Ok, so now we've gone from "eliminating a couple of sparse warnings"
to "going through the rest of the code and jamming in some alternate
coding style when there was nothing wrong with it in the first place."

Don't get me wrong, I appreciate the role of the kernel janitors in
general, but this patch is crap.  It's changes like this that just
lower the signal/noise ratio on *real* work going on, and increasing
the likelihood that some well intentioned janitor screwed up one of
the conversions.

After all, it's not like the author of this patch actually tried the
resulting code.  He only has to mess up one of those two line changes
and we go from "driver that works perfectly well" to "driver that is
100% broken".

There are much better uses of the maintainer's time than going through
patches like this to make sure the submitter didn't screw up the a
conversion that provides no real value.

A change like this:

-       if (buf == NULL) {
+       if (!buf) {

is a worthless change, and there is is a higher chance that one of
them gets screwed up in the patch than what we had to start with.

Devin

-- 
Devin J. Heitmueller - Kernel Labs
http://www.kernellabs.com

WARNING: multiple messages have this Message-ID (diff)
From: Devin Heitmueller <dheitmueller@kernellabs.com>
To: Peter Huewe <PeterHuewe@gmx.de>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>,
	Julia Lawall <julia@diku.dk>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org,
	Steven Toth <stoth@kernellabs.com>, Tejun Heo <tj@kernel.org>,
	Dan Carpenter <error27@gmail.com>
Subject: Re: [PATCH v2] video/saa7164: Fix sparse warning: Using plain integer
Date: Sun, 30 Jan 2011 20:02:23 +0000	[thread overview]
Message-ID: <AANLkTin7HaZ5GNnPmM066K+OJwEzCUpw4-oGtAhXSgRt@mail.gmail.com> (raw)
In-Reply-To: <201101302033.01964.PeterHuewe@gmx.de>

On Sun, Jan 30, 2011 at 2:33 PM, Peter Huewe <PeterHuewe@gmx.de> wrote:
> From: Peter Huewe <peterhuewe@gmx.de>
>
> This patch fixes the warning "Using plain integer as NULL pointer",
> generated by sparse, by replacing
>        if(var = 0)
> with
>        if (!var)
> after an allocation
> and all other offending 0s with NULL.
>
> KernelVersion: linus' tree-1f0324c
>
> Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
> ---
> v2: I changed the patch according to Julia's hints.
> i.e. using if(!buf) instead of if(buf=NULL) after the kmalloc family,
> and other allocations.

Ok, so now we've gone from "eliminating a couple of sparse warnings"
to "going through the rest of the code and jamming in some alternate
coding style when there was nothing wrong with it in the first place."

Don't get me wrong, I appreciate the role of the kernel janitors in
general, but this patch is crap.  It's changes like this that just
lower the signal/noise ratio on *real* work going on, and increasing
the likelihood that some well intentioned janitor screwed up one of
the conversions.

After all, it's not like the author of this patch actually tried the
resulting code.  He only has to mess up one of those two line changes
and we go from "driver that works perfectly well" to "driver that is
100% broken".

There are much better uses of the maintainer's time than going through
patches like this to make sure the submitter didn't screw up the a
conversion that provides no real value.

A change like this:

-       if (buf = NULL) {
+       if (!buf) {

is a worthless change, and there is is a higher chance that one of
them gets screwed up in the patch than what we had to start with.

Devin

-- 
Devin J. Heitmueller - Kernel Labs
http://www.kernellabs.com
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2011-01-30 20:02 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-25 20:54 [PATCH] video/saa7164: Fix sparse warning: Using plain integer as NULL pointer Peter Huewe
2011-01-25 20:54 ` Peter Huewe
2011-01-25 22:20 ` Julia Lawall
2011-01-25 22:20   ` [PATCH] video/saa7164: Fix sparse warning: Using plain integer Julia Lawall
2011-01-25 22:54   ` [PATCH] video/saa7164: Fix sparse warning: Using plain integer as NULL pointer Peter Hüwe
2011-01-25 22:54     ` Peter Hüwe
2011-01-25 23:05     ` Devin Heitmueller
2011-01-25 23:05       ` [PATCH] video/saa7164: Fix sparse warning: Using plain integer as Devin Heitmueller
2011-01-26  0:30       ` [PATCH] video/saa7164: Fix sparse warning: Using plain integer as NULL pointer Andy Walls
2011-01-26  0:30         ` [PATCH] video/saa7164: Fix sparse warning: Using plain integer Andy Walls
2011-01-26  5:59     ` [PATCH] video/saa7164: Fix sparse warning: Using plain integer as NULL pointer Julia Lawall
2011-01-26  5:59       ` [PATCH] video/saa7164: Fix sparse warning: Using plain integer Julia Lawall
2011-01-26  9:29     ` [PATCH] video/saa7164: Fix sparse warning: Using plain integer as NULL pointer Mauro Carvalho Chehab
2011-01-26  9:29       ` [PATCH] video/saa7164: Fix sparse warning: Using plain integer Mauro Carvalho Chehab
2011-01-30 19:33       ` [PATCH v2] video/saa7164: Fix sparse warning: Using plain integer as NULL pointer Peter Huewe
2011-01-30 19:33         ` Peter Huewe
2011-01-30 20:02         ` Devin Heitmueller [this message]
2011-01-30 20:02           ` [PATCH v2] video/saa7164: Fix sparse warning: Using plain integer Devin Heitmueller
2011-01-26  4:25   ` [PATCH] video/saa7164: Fix sparse warning: Using plain integer as NULL pointer Dan Carpenter
2011-01-26  4:25     ` [PATCH] video/saa7164: Fix sparse warning: Using plain integer Dan Carpenter

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=AANLkTin7HaZ5GNnPmM066K+OJwEzCUpw4-oGtAhXSgRt@mail.gmail.com \
    --to=dheitmueller@kernellabs.com \
    --cc=PeterHuewe@gmx.de \
    --cc=error27@gmail.com \
    --cc=julia@diku.dk \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@infradead.org \
    --cc=stoth@kernellabs.com \
    --cc=tj@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.