[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180726122533.104f6eea950853ef50ebc680@linux-foundation.org>
Date: Thu, 26 Jul 2018 12:25:33 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Joe Perches <joe@...ches.com>
Cc: Andy Whitcroft <apw@...onical.com>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH] checkpatch: check for function calls with struct or
union on stack
On Thu, 26 Jul 2018 11:27:50 -0700 Joe Perches <joe@...ches.com> wrote:
> I was cc'd on a patch where structs were used on stack instead
> of using pointers to the structs.
"passed by value" is a good term for this practice.
This can cause defects when
> the calling function modifies the stack struct instead of the
"called"
> calling function's struct.
>
> Possible patch below, but it may be overkill for the number of
> instances
> where this is actually an issue.
>
> Thoughts?
Seems worthwhile.
> There are what seems to be some false positives for a few of the
> .h files in include/linux/... where the false positives are for
> very small structs where the indirection via a pointer might be
> slower than than the stack use.
>
> For instance: (some duplicates removed)
I'll give it a spin, see how noisy it is.
Powered by blists - more mailing lists