Re: [RFC PATCH] checkpatch: check for function calls with struct or union on stack

2018-07-28 Thread Julia Lawall
On Sat, 28 Jul 2018, Joe Perches wrote: > On Sat, 2018-07-28 at 08:25 +0200, Julia Lawall wrote: > > On Fri, 27 Jul 2018, Joe Perches wrote: > [] > > > It might make sense for this sort of check to be > > > added to coccinelle or maybe as a compiler warning > > > when the struct is larger than

Re: [RFC PATCH] checkpatch: check for function calls with struct or union on stack

2018-07-28 Thread Julia Lawall
On Sat, 28 Jul 2018, Joe Perches wrote: > On Sat, 2018-07-28 at 08:25 +0200, Julia Lawall wrote: > > On Fri, 27 Jul 2018, Joe Perches wrote: > [] > > > It might make sense for this sort of check to be > > > added to coccinelle or maybe as a compiler warning > > > when the struct is larger than

Re: [RFC PATCH] checkpatch: check for function calls with struct or union on stack

2018-07-28 Thread Joe Perches
(unintentionally sent partial reply, better now) On Sat, 2018-07-28 at 08:25 +0200, Julia Lawall wrote: > On Fri, 27 Jul 2018, Joe Perches wrote: [] > > It might make sense for this sort of check to be > > added to coccinelle or maybe as a compiler warning > > when the struct is larger than some

Re: [RFC PATCH] checkpatch: check for function calls with struct or union on stack

2018-07-28 Thread Joe Perches
(unintentionally sent partial reply, better now) On Sat, 2018-07-28 at 08:25 +0200, Julia Lawall wrote: > On Fri, 27 Jul 2018, Joe Perches wrote: [] > > It might make sense for this sort of check to be > > added to coccinelle or maybe as a compiler warning > > when the struct is larger than some

Re: [RFC PATCH] checkpatch: check for function calls with struct or union on stack

2018-07-28 Thread Joe Perches
On Sat, 2018-07-28 at 08:25 +0200, Julia Lawall wrote: > On Fri, 27 Jul 2018, Joe Perches wrote: [] > > It might make sense for this sort of check to be > > added to coccinelle or maybe as a compiler warning > > when the struct is larger than some size. > > > > Original thread for Julia: > >

Re: [RFC PATCH] checkpatch: check for function calls with struct or union on stack

2018-07-28 Thread Joe Perches
On Sat, 2018-07-28 at 08:25 +0200, Julia Lawall wrote: > On Fri, 27 Jul 2018, Joe Perches wrote: [] > > It might make sense for this sort of check to be > > added to coccinelle or maybe as a compiler warning > > when the struct is larger than some size. > > > > Original thread for Julia: > >

Re: [RFC PATCH] checkpatch: check for function calls with struct or union on stack

2018-07-28 Thread Julia Lawall
On Fri, 27 Jul 2018, Joe Perches wrote: > On Fri, 2018-07-27 at 10:21 +, David Laight wrote: > > From: Joe Perches Sent: 27 July 2018 11:09 > > > On Fri, 2018-07-27 at 10:04 +, David Laight wrote: > > > > From: Andrew Morton Sent: 26 July 2018 20:28 > > > > > On Thu, 26 Jul 2018

Re: [RFC PATCH] checkpatch: check for function calls with struct or union on stack

2018-07-28 Thread Julia Lawall
On Fri, 27 Jul 2018, Joe Perches wrote: > On Fri, 2018-07-27 at 10:21 +, David Laight wrote: > > From: Joe Perches Sent: 27 July 2018 11:09 > > > On Fri, 2018-07-27 at 10:04 +, David Laight wrote: > > > > From: Andrew Morton Sent: 26 July 2018 20:28 > > > > > On Thu, 26 Jul 2018

Re: [RFC PATCH] checkpatch: check for function calls with struct or union on stack

2018-07-27 Thread Joe Perches
On Fri, 2018-07-27 at 10:21 +, David Laight wrote: > From: Joe Perches Sent: 27 July 2018 11:09 > > On Fri, 2018-07-27 at 10:04 +, David Laight wrote: > > > From: Andrew Morton Sent: 26 July 2018 20:28 > > > > On Thu, 26 Jul 2018 12:25:33 -0700 Andrew Morton > > > > wrote: > > > > > > >

Re: [RFC PATCH] checkpatch: check for function calls with struct or union on stack

2018-07-27 Thread Joe Perches
On Fri, 2018-07-27 at 10:21 +, David Laight wrote: > From: Joe Perches Sent: 27 July 2018 11:09 > > On Fri, 2018-07-27 at 10:04 +, David Laight wrote: > > > From: Andrew Morton Sent: 26 July 2018 20:28 > > > > On Thu, 26 Jul 2018 12:25:33 -0700 Andrew Morton > > > > wrote: > > > > > > >

RE: [RFC PATCH] checkpatch: check for function calls with struct or union on stack

2018-07-27 Thread David Laight
From: Joe Perches > Sent: 27 July 2018 11:09 > On Fri, 2018-07-27 at 10:04 +, David Laight wrote: > > From: Andrew Morton > > > Sent: 26 July 2018 20:28 > > > On Thu, 26 Jul 2018 12:25:33 -0700 Andrew Morton > > > wrote: > > > > > > > I'll give it a spin, see how noisy it is. > > > > > >

RE: [RFC PATCH] checkpatch: check for function calls with struct or union on stack

2018-07-27 Thread David Laight
From: Joe Perches > Sent: 27 July 2018 11:09 > On Fri, 2018-07-27 at 10:04 +, David Laight wrote: > > From: Andrew Morton > > > Sent: 26 July 2018 20:28 > > > On Thu, 26 Jul 2018 12:25:33 -0700 Andrew Morton > > > wrote: > > > > > > > I'll give it a spin, see how noisy it is. > > > > > >

Re: [RFC PATCH] checkpatch: check for function calls with struct or union on stack

2018-07-27 Thread Joe Perches
On Fri, 2018-07-27 at 10:04 +, David Laight wrote: > From: Andrew Morton > > Sent: 26 July 2018 20:28 > > On Thu, 26 Jul 2018 12:25:33 -0700 Andrew Morton > > wrote: > > > > > I'll give it a spin, see how noisy it is. > > > > Actually, I would prefer if the message, changelog and title > >

Re: [RFC PATCH] checkpatch: check for function calls with struct or union on stack

2018-07-27 Thread Joe Perches
On Fri, 2018-07-27 at 10:04 +, David Laight wrote: > From: Andrew Morton > > Sent: 26 July 2018 20:28 > > On Thu, 26 Jul 2018 12:25:33 -0700 Andrew Morton > > wrote: > > > > > I'll give it a spin, see how noisy it is. > > > > Actually, I would prefer if the message, changelog and title > >

RE: [RFC PATCH] checkpatch: check for function calls with struct or union on stack

2018-07-27 Thread David Laight
From: Andrew Morton > Sent: 26 July 2018 20:28 > On Thu, 26 Jul 2018 12:25:33 -0700 Andrew Morton > 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

RE: [RFC PATCH] checkpatch: check for function calls with struct or union on stack

2018-07-27 Thread David Laight
From: Andrew Morton > Sent: 26 July 2018 20:28 > On Thu, 26 Jul 2018 12:25:33 -0700 Andrew Morton > 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

Re: [RFC PATCH] checkpatch: check for function calls with struct or union on stack

2018-07-26 Thread Andrew Morton
On Thu, 26 Jul 2018 13:05:29 -0700 Joe Perches wrote: > On Thu, 2018-07-26 at 12:28 -0700, Andrew Morton wrote: > > On Thu, 26 Jul 2018 12:25:33 -0700 Andrew Morton > > wrote: > > > > > I'll give it a spin, see how noisy it is. > > > > Actually, I would prefer if the message, changelog and

Re: [RFC PATCH] checkpatch: check for function calls with struct or union on stack

2018-07-26 Thread Andrew Morton
On Thu, 26 Jul 2018 13:05:29 -0700 Joe Perches wrote: > On Thu, 2018-07-26 at 12:28 -0700, Andrew Morton wrote: > > On Thu, 26 Jul 2018 12:25:33 -0700 Andrew Morton > > wrote: > > > > > I'll give it a spin, see how noisy it is. > > > > Actually, I would prefer if the message, changelog and

Re: [RFC PATCH] checkpatch: check for function calls with struct or union on stack

2018-07-26 Thread Joe Perches
On Thu, 2018-07-26 at 12:28 -0700, Andrew Morton wrote: > On Thu, 26 Jul 2018 12:25:33 -0700 Andrew Morton > 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 >

Re: [RFC PATCH] checkpatch: check for function calls with struct or union on stack

2018-07-26 Thread Joe Perches
On Thu, 2018-07-26 at 12:28 -0700, Andrew Morton wrote: > On Thu, 26 Jul 2018 12:25:33 -0700 Andrew Morton > 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 >

Re: [RFC PATCH] checkpatch: check for function calls with struct or union on stack

2018-07-26 Thread Andrew Morton
On Thu, 26 Jul 2018 12:25:33 -0700 Andrew Morton 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

Re: [RFC PATCH] checkpatch: check for function calls with struct or union on stack

2018-07-26 Thread Andrew Morton
On Thu, 26 Jul 2018 12:25:33 -0700 Andrew Morton 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

Re: [RFC PATCH] checkpatch: check for function calls with struct or union on stack

2018-07-26 Thread Andrew Morton
On Thu, 26 Jul 2018 11:27:50 -0700 Joe Perches 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

Re: [RFC PATCH] checkpatch: check for function calls with struct or union on stack

2018-07-26 Thread Andrew Morton
On Thu, 26 Jul 2018 11:27:50 -0700 Joe Perches 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

[RFC PATCH] checkpatch: check for function calls with struct or union on stack

2018-07-26 Thread Joe Perches
I was cc'd on a patch where structs were used on stack instead of using pointers to the structs. This can cause defects when the calling function modifies the stack struct instead of the calling function's struct. Possible patch below, but it may be overkill for the number of instances where

[RFC PATCH] checkpatch: check for function calls with struct or union on stack

2018-07-26 Thread Joe Perches
I was cc'd on a patch where structs were used on stack instead of using pointers to the structs. This can cause defects when the calling function modifies the stack struct instead of the calling function's struct. Possible patch below, but it may be overkill for the number of instances where