mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Joe Perches <joe@perches.com>
Cc: Andy Whitcroft <apw@canonical.com>, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH] checkpatch: check for function calls with struct or union on stack
Date: Thu, 26 Jul 2018 12:25:33 -0700	[thread overview]
Message-ID: <20180726122533.104f6eea950853ef50ebc680@linux-foundation.org> (raw)
In-Reply-To: <1236369d28b2f1f5389ff652c4eb89e699e6481e.camel@perches.com>

On Thu, 26 Jul 2018 11:27:50 -0700 Joe Perches <joe@perches.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.

  reply	other threads:[~2018-07-26 19:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-26 18:27 Joe Perches
2018-07-26 19:25 ` Andrew Morton [this message]
2018-07-26 19:28   ` Andrew Morton
2018-07-26 20:05     ` Joe Perches
2018-07-26 20:38       ` Andrew Morton
2018-07-27 10:04     ` David Laight
2018-07-27 10:08       ` Joe Perches
2018-07-27 10:21         ` David Laight
2018-07-27 10:36           ` Joe Perches
2018-07-28  6:25             ` Julia Lawall
2018-07-28 17:14               ` Joe Perches
2018-07-28 17:24                 ` Julia Lawall
2018-07-28 17:20               ` Joe Perches

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=20180726122533.104f6eea950853ef50ebc680@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=apw@canonical.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    /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