Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932241AbdHWOnO (ORCPT ); Wed, 23 Aug 2017 10:43:14 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:36608 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932179AbdHWOnM (ORCPT ); Wed, 23 Aug 2017 10:43:12 -0400 Date: Wed, 23 Aug 2017 22:43:37 +0800 From: Boqun Feng To: Arnd Bergmann Cc: Byungchul Park , Peter Zijlstra , Ingo Molnar , Thomas Gleixner , Michel Lespinasse , kirill@shutemov.name, Linux Kernel Mailing List , Linux-MM , Andrew Morton , willy@infradead.org, Nicholas Piggin , kernel-team@lge.com Subject: Re: [PATCH v8 09/14] lockdep: Apply crossrelease to completions Message-ID: <20170823144140.GK11771@tardis> References: <1502089981-21272-1-git-send-email-byungchul.park@lge.com> <1502089981-21272-10-git-send-email-byungchul.park@lge.com> <20170818234348.GE11771@tardis> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="oxV4ZoPwBLqAyY+a" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.3 (2017-05-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2465 Lines: 78 --oxV4ZoPwBLqAyY+a Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Aug 19, 2017 at 03:34:01PM +0200, Arnd Bergmann wrote: > On Sat, Aug 19, 2017 at 2:51 PM, Arnd Bergmann wrote: >=20 > >> --- a/include/linux/completion.h > >> +++ b/include/linux/completion.h > >> @@ -74,7 +74,7 @@ static inline void complete_release_commit(struct co= mpletion *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. >=20 > There is apparently one user of COMPLETION_INITIALIZER_ONSTACK > that causes a regression with the patch above: >=20 > drivers/acpi/nfit/core.c: In function 'acpi_nfit_flush_probe': > include/linux/completion.h:77:3: error: value computed is not used > [-Werror=3Dunused-value] > (*({ init_completion(&work); &work; })) >=20 > It would be trivial to convert to init_completion(), which seems to be > what was intended there. >=20 Thanks. Will send the conversion as a separate patch along with my patch. Regards, Boqun > Arnd --oxV4ZoPwBLqAyY+a Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEj5IosQTPz8XU1wRHSXnow7UH+rgFAlmdlJQACgkQSXnow7UH +rhoPwgAmloWiwRZC9y/pNE3ay7U2sD72j+EIrV0ksMlIBBZThT+FLO94T71M2qB xFip80IMlC9LTd1nE3Df5kMimkqUHFKxd6Uoq99zJvAlGJQpS1A1BkjWQ6owDF2+ lqOM3R8hGAu/o5f9zkpqyn4tk0Mmqu2IS88UqRpK5ldKDA2DwquAwvuIMRdaVmVO fuhYiLJ4VhQazW/MBDCkIsUmhWX/MY1C4utsqpQVIgTx7EPcSSdc814SdH2Gmps4 5ArqvMiiABlObLjAqJLtnDNsb497CLratEODHqofOFDAbsTtXVOwHT80dchla+OI RSPprooAmg6CEn2d+B9sMm60eIO+oQ== =j42v -----END PGP SIGNATURE----- --oxV4ZoPwBLqAyY+a--