Re: [RFC PATCH] checkpatch: check for function calls with struct or union on stack
From: Joe Perches
Date: Fri Jul 27 2018 - 06:08:58 EST
On Fri, 2018-07-27 at 10:04 +0000, David Laight wrote:
> From: Andrew Morton
> > Sent: 26 July 2018 20:28
> > On Thu, 26 Jul 2018 12:25:33 -0700 Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:
> >
> > > I'll give it a spin, see how noisy it is.
> >
> > Actually, I would prefer if the message, changelog and title
> > used the term "passed by value". It's a more familiar term
> > and it is possible for a passed-by-value aggregate to in fact
> > be passed in registers.
>
> You need to detect (and ignore) 'small' structures.
checkpatch is stupid and basically can't do that
as it has no context other than the current line.
It would need a list of specific struct types to
ignore. Care to create and send that list to me?
>From an earlier message:
On Thu, 2018-07-26 at 13:05 -0700, Joe Perches wrote:
> It doesn't seem noisy at all, but maybe there are a few
> known structs like "struct timespec64" that could be
> excluded.