[lkml]   [2011]   [Jan]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [PATCH v2] video/saa7164: Fix sparse warning: Using plain integer as NULL pointer
    On Sun, Jan 30, 2011 at 2:33 PM, Peter Huewe <> wrote:
    > From: Peter Huewe <>
    > 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 <>
    > ---
    > 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 J. Heitmueller - Kernel Labs
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2011-01-30 21:05    [W:0.022 / U:36.132 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site