[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180407003301.GB386@tigerII.localdomain>
Date: Sat, 7 Apr 2018 09:33:01 +0900
From: Sergey Senozhatsky <sergey.senozhatsky@...il.com>
To: Joe Perches <joe@...ches.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Petr Mladek <pmladek@...e.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
"Tobin C . Harding" <me@...in.cc>,
Andrew Morton <akpm@...ux-foundation.org>,
Michal Hocko <mhocko@...e.cz>,
Steven Rostedt <rostedt@...dmis.org>,
Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 4/9] vsprintf: Consolidate handling of unknown pointer
specifiers
Hi Joe,
On (04/06/18 16:59), Joe Perches wrote:
> >
> > Can we tweak checkpatch to catch such things?
>
> Not really, no.
>
> Adding regex logic for this is tricky at best
> and probably not worth the effort because of
> the various bits of patch contexts aren't
> necessarily visible.
Agreed. I was more thinking about catching "... %p" and saying
that we'd rather prefer either "... %p," or "... %p " or "... %p\n".
Doesn't sound so complex, can probably catch something fishy one day
(or may be not), and more or less is visible to checkpatch. Well,
more or less...
> There are also concatenations like
> "foo" DEFINE "bar"
> where DEFINE may not be visible in the patch
> context and checkpatch is and likely will
> remain just a limited regex checker.
Right. One example might be XFS
alert("%s: Bad regular inode %Lu, ptr "PTR_FMT,
__func__, ip->i_ino, ip);
where PTR_FMT is
#ifdef DEBUG
# define PTR_FMT "%px"
#else
# define PTR_FMT "%p"
#endif
-ss
Powered by blists - more mailing lists