Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1718426
| From | Boqun Feng <boqun.feng@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v8 09/14] lockdep: Apply crossrelease to completions |
| Date | 2017-08-23 16:50 +0200 |
| Message-ID | <uhF8K-1Mw-17@gated-at.bofh.it> (permalink) |
| References | (1 earlier) <ubKuv-59V-37@gated-at.bofh.it> <uejo5-1Xt-11@gated-at.bofh.it> <ufZbz-25E-1@gated-at.bofh.it> <ugbw6-1pj-9@gated-at.bofh.it> <ugc8O-1SQ-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
[Multipart message — attachments visible in raw view] - view raw
On Sat, Aug 19, 2017 at 03:34:01PM +0200, Arnd Bergmann wrote:
> On Sat, Aug 19, 2017 at 2:51 PM, Arnd Bergmann <arnd@arndb.de> wrote:
>
> >> --- a/include/linux/completion.h
> >> +++ b/include/linux/completion.h
> >> @@ -74,7 +74,7 @@ static inline void complete_release_commit(struct completion *x) {}
> >> #endif
> >>
> >> #define COMPLETION_INITIALIZER_ONSTACK(work) \
> >> - ({ init_completion(&work); work; })
> >> + (*({ init_completion(&work); &work; }))
> >>
> >> /**
> >> * DECLARE_COMPLETION - declare and initialize a completion structure
> >
> > Nice hack. Any idea why that's different to the compiler?
> >
So I find this link:
https://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html
it says:
"In G++, the result value of a statement expression undergoes array and
function pointer decay, and is returned by value to the enclosing
expression. "
I think this is why the temporary variable is constructed(or at least
allocated). Lemme put this in my commit log.
> > I've applied that one to my test tree now, and reverted my own patch,
> > will let you know if anything else shows up. I think we probably want
> > to merge both patches to mainline.
>
> There is apparently one user of COMPLETION_INITIALIZER_ONSTACK
> that causes a regression with the patch above:
>
> drivers/acpi/nfit/core.c: In function 'acpi_nfit_flush_probe':
> include/linux/completion.h:77:3: error: value computed is not used
> [-Werror=unused-value]
> (*({ init_completion(&work); &work; }))
>
> It would be trivial to convert to init_completion(), which seems to be
> what was intended there.
>
Thanks. Will send the conversion as a separate patch along with my
patch.
Regards,
Boqun
> Arnd
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [PATCH v8 09/14] lockdep: Apply crossrelease to completions Arnd Bergmann <arnd@arndb.de> - 2017-08-14 11:00 +0200
Re: [PATCH v8 09/14] lockdep: Apply crossrelease to completions Boqun Feng <boqun.feng@gmail.com> - 2017-08-19 01:50 +0200
Re: [PATCH v8 09/14] lockdep: Apply crossrelease to completions Arnd Bergmann <arnd@arndb.de> - 2017-08-19 15:00 +0200
Re: [PATCH v8 09/14] lockdep: Apply crossrelease to completions Arnd Bergmann <arnd@arndb.de> - 2017-08-19 15:40 +0200
Re: [PATCH v8 09/14] lockdep: Apply crossrelease to completions Boqun Feng <boqun.feng@gmail.com> - 2017-08-23 16:50 +0200
Re: [PATCH v8 09/14] lockdep: Apply crossrelease to completions Boqun Feng <boqun.feng@gmail.com> - 2017-08-20 05:20 +0200
csiph-web