From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9AFE2C433E0 for ; Thu, 14 Jan 2021 13:23:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 673E123A59 for ; Thu, 14 Jan 2021 13:23:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728613AbhANNXj (ORCPT ); Thu, 14 Jan 2021 08:23:39 -0500 Received: from bmailout3.hostsharing.net ([176.9.242.62]:56461 "EHLO bmailout3.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725991AbhANNXi (ORCPT ); Thu, 14 Jan 2021 08:23:38 -0500 X-Greylist: delayed 548 seconds by postgrey-1.27 at vger.kernel.org; Thu, 14 Jan 2021 08:23:37 EST Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.hostsharing.net", Issuer "RapidSSL TLS DV RSA Mixed SHA256 2020 CA-1" (verified OK)) by bmailout3.hostsharing.net (Postfix) with ESMTPS id 41E2910195B69; Thu, 14 Jan 2021 14:13:48 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 1078331C7F; Thu, 14 Jan 2021 14:13:48 +0100 (CET) Date: Thu, 14 Jan 2021 14:13:48 +0100 From: Lukas Wunner To: Linus Torvalds Cc: Will Deacon , Peter Zijlstra , Arnd Bergmann , Russell King - ARM Linux admin , linux-toolchains@vger.kernel.org, Mark Rutland , Theodore Ts'o , "linux-kernel@vger.kernel.org" , Andreas Dilger , Ext4 Developers List , Linux ARM Subject: Re: Aarch64 EXT4FS inode checksum failures - seems to be weak memory ordering issues Message-ID: <20210114131348.GA1343@wunner.de> References: <20210107111841.GN1551@shell.armlinux.org.uk> <20210107124506.GO1551@shell.armlinux.org.uk> <20210107133747.GP1551@shell.armlinux.org.uk> <20210108092655.GA4031@willie-the-truck> <20210112132049.GA26096@wunner.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 12, 2021 at 09:28:32AM -0800, Linus Torvalds wrote: > On Tue, Jan 12, 2021 at 5:20 AM Lukas Wunner wrote: > > > Variable declarations in for-loops is the only one I can think of. I > > > think that would clean up some code (and some macros), but might not > > > be compelling on its own. > > > > Anonymous structs/unions. I used to have a use case for that in > > struct efi_dev_path in include/linux/efi.h, but Ard Biesheuvel > > refactored it in a gnu89-compatible way for v5.7 with db8952e7094f. > > We use anonymous structs/unions extensively and all over the place already. Yes, my apologies, I mixed things up. Back in 2016 when I authored 46cd4b75cd0e, what I wanted to do was include an unnamed "struct efi_generic_dev_path;" in struct efi_dev_path: struct efi_dev_path { struct efi_generic_dev_path; union { struct { u32 hid; u32 uid; } acpi; struct { u8 fn; u8 dev; } pci; }; } __attribute ((packed)); The alternative is to copy-paste the elements of struct efi_dev_path or to give it a name such as "header" (which is what db8952e7094f subsequently did). Both options seemed inelegant to me. However it turns out this feature requires -fms-extensions. It's not part of -std=gnu11. So coming back to topic, yes there doesn't seem to be too much to be gained from moving to -std=gnu11 aside from variable declarations in for-loops. (And it really has to be -std=gnu11 because -std=c11 fails to compile.) Thanks, Lukas