mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Peter Hurley <peter@hurleysoftware.com>
Cc: Andrew Morton <akpm@linux-foundation.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] checkpatch: Add --strict test for function pointer calling style
Date: Wed, 05 Nov 2014 11:30:52 -0800	[thread overview]
Message-ID: <1415215852.6634.21.camel@perches.com> (raw)
In-Reply-To: <545A76B7.1060801@hurleysoftware.com>

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 ) ("


  reply	other threads:[~2014-11-05 19:31 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-05 17:26 [PATCH -next 0/9] various tty cleanups Peter Hurley
2014-11-05 17:26 ` [PATCH -next 1/9] tty: Replace open-coded test with tty_hung_up_p() Peter Hurley
2014-11-05 17:26 ` [PATCH -next 2/9] tty: Call methods in modern style Peter Hurley
2014-11-05 18:41   ` [PATCH] checkpatch: Add --strict test for function pointer calling style Joe Perches
2014-11-05 19:12     ` Peter Hurley
2014-11-05 19:30       ` Joe Perches [this message]
2014-11-05 17:26 ` [PATCH -next 3/9] tty: Remove defunct pcxe_open() declaration Peter Hurley
2014-11-05 17:26 ` [PATCH -next 4/9] tty: Remove defunct serial_console_init() declaration Peter Hurley
2014-11-05 17:26 ` [PATCH -next 5/9] serial: hp300: Remove obsolete comments Peter Hurley
2014-11-05 18:36   ` Geert Uytterhoeven
2014-11-05 17:26 ` [PATCH -next 6/9] cris: Remove obsolete ASYNC_SPLIT_TERMIOS behavior Peter Hurley
2014-11-06  8:23   ` Jesper Nilsson
2014-11-05 17:26 ` [PATCH -next 7/9] tty: Document defunct ASYNC_SPLIT_TERMIOS flag in uapi header Peter Hurley
2014-11-05 17:26 ` [PATCH -next 8/9] vt: Remove vt_get_kmsg_redirect() from " Peter Hurley
2014-11-05 17:26 ` [PATCH -next 9/9] serial: 8250_em: Remove out-of-memory message Peter Hurley

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=1415215852.6634.21.camel@perches.com \
    --to=joe@perches.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peter@hurleysoftware.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome