[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1415215852.6634.21.camel@perches.com>
Date: Wed, 05 Nov 2014 11:30:52 -0800
From: Joe Perches <joe@...ches.com>
To: Peter Hurley <peter@...leysoftware.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] checkpatch: Add --strict test for function pointer
calling style
On Wed, 2014-11-05 at 14:12 -0500, Peter Hurley wrote:
> On 11/05/2014 01:41 PM, Joe Perches wrote:
> > Peter Hurley wrote:
> >
> > The use of older function ptr calling style, (*fn)(), makes static
> > analysis more error-prone; replace with modern fn() style.
> >
> > So make checkpatch emit a --strict test for that condition.
> >
> > Update the unnecessary parentheses test for dereferencing
> > objects at the same time and create a $fix mechanism too.
>
> Cool.
>
> perl's not my thing; how does it know not to trip up on
>
> initcall_t *call;
>
> (*call)();
>
> [which I verified it properly does not flag in drivers/tty/tty_io.c]
because the regex only matches "(foo->bar)("
It doesn't match (*foo->bar)("
and foo->bar could be any number of -> or . uses like
"(foo->bar.baz)("
or
"( foo -> bar . baz ) ("
--
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