[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAH6sp9Ow9fuLNuuzqCSvntfFEnnQ95OEsds2ME5Xra-eTKz=yQ@mail.gmail.com>
Date: Wed, 19 Aug 2015 16:51:45 +0200
From: Frans Klaver <fransklaver@...il.com>
To: Sudip Mukherjee <sudipm.mukherjee@...il.com>
Cc: Fabio Estevam <festevam@...il.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
devel@...verdev.osuosl.org,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/9] staging: most: NULL comparison style
On Wed, Aug 19, 2015 at 12:00 PM, Sudip Mukherjee
<sudipm.mukherjee@...il.com> wrote:
> On Tue, Aug 18, 2015 at 01:31:00PM -0300, Fabio Estevam wrote:
>> On Tue, Aug 18, 2015 at 12:18 PM, Sudip Mukherjee
>> <sudipm.mukherjee@...il.com> wrote:
>> > According to the kernel coding style the NULL check should not be
>> > written as [variable] == NULL or [variable] != NULL.
>>
>> It seems this not documented in Documentation/CodingStyle .
> Yes, it is not in the CodingStyle file. But mostly it is the convention
> that is followed. And in CodingStyle file if you see the "The rationale
> for using gotos is:" section, you will see in the example function the
> test is done like: if (!buffer).
> Anyways, frankly speaking I know commit message is bad but I could not
> think of anything else other than the one I wrote. Any ideas please...
Maybe something like:
Although not made explicit in Documentation/CodingStyle, there seems
to be a preference for writing NULL tests as 'if (!var)' rather than
if (var == NULL). The coding style does explicitly prefer brevity, so
convert all NULL checks to follow this shorter approach.
Frans
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists