[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20141215140843.GA918@newt.localdomain>
Date: Mon, 15 Dec 2014 06:08:43 -0800
From: Jeremiah Mahler <jmmahler@...il.com>
To: Dan Carpenter <dan.carpenter@...cle.com>
Cc: One Thousand Gnomes <gnomes@...rguk.ukuu.org.uk>,
Loic Pefferkorn <loic@...cp.eu>, gregkh@...uxfoundation.org,
alan@...ux.intel.com, jun.j.tian@...el.com,
octavian.purdila@...el.com, nnk@...gle.com,
devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
apw@...onical.com, joe@...ches.com
Subject: Re: [PATCH] checkpatch giving bogus advice (was staging: goldfish:
Fix minor coding style)
Dan,
On Mon, Dec 15, 2014 at 04:43:34PM +0300, Dan Carpenter wrote:
> On Mon, Dec 15, 2014 at 05:03:46AM -0800, Jeremiah Mahler wrote:
> >
> > Or another way mentioned in K&R that produces a compile error
> >
> > if (NULL = x)
> >
>
> Yes. People used to write Yoda code back in the day. Don't ever do
> this in the kernel.
>
> 1) It looks stupid.
Agreed :-)
> 2) GCC will catch most == vs = bugs as Alan pointed out.
> 3) There are still some that sneak through because people put double
> parenthesis around everything like "if ((foo = NULL) || (...)) {",
> but checkpatch.pl and Smatch will catch those.
>
> regards,
> dan carpenter
>
--
- Jeremiah Mahler
--
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