Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp919552ybh; Mon, 13 Jul 2020 04:55:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9zJVOtjXBIgIq4cLMmjU9umFbGlR9RZbD0XKVKeRkdGYptCR/UlZdfGnmhmAWBC+0Zppu X-Received: by 2002:a05:6402:1c8f:: with SMTP id cy15mr91273304edb.308.1594641316049; Mon, 13 Jul 2020 04:55:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594641316; cv=none; d=google.com; s=arc-20160816; b=rJIZmgIh/MR9ppc9AyECrekjmAEXo5lzkH/m1zA4DH+sjIpsfV0P0MrLVe6FPww2MO uZSGry4uaJQuME2RDA2hq/57N2/0PIS0cd5j0jUWX6l4qWalSI2YQUOtO9Q27ykMLQyU k25P9iASayXS3zIoIbC8qb4puanPCSBiowOlNSzbF5fxNeNDxIbd7L01+hYBrqqEBFQH +X7HVaZyxw+K7B5w7/g25n3WXJuR0t5ICVNH6qf6MUXX5sOUP384Ff0bl3jzwCrZjzaP kc10iCaNaJtxvHZNuGcUTFav5ypc0vtBh3L1yqXa4Xah3IIIQfvQCGao75T5PGrWyJ6r bMsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=0VFAIjFfZ5APIxw6QxOHI9YiNxSPgGB0GYAhZQL1j5k=; b=bP93RGNUiGcK8oshcP/jYKHFPvpndPUTxaVby6+ZVDM0NRJa5B7bKESGJWxXDzJpy1 a6sLJt1xbJpOb04kNzFF98gfSIPtYdpHGkkFJtxA+J6yTGdDO+sNZcEU4ZKhvLqn+TkE BrVx8p/gg2rmGXcFagzjI+dTReyCLkq06/8zTKdyaLDkJwx6gx/StPUDUtZInehkd9AB nh/1HYeO1//oUNYAaEqYGDLKmFyXUdU3ktXh//Pc6mRZlFP2IbFmQ9mh/D6aiDF89qeO OUf06jocU5mUtH4r2epwTdMnkXO+od8eqO5Cputit/98tgCpWmc6gOVE9YQToA7EeCK2 /YtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=N9DsKSXp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id pw26si8897498ejb.240.2020.07.13.04.54.52; Mon, 13 Jul 2020 04:55:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=N9DsKSXp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729597AbgGMLvt (ORCPT + 99 others); Mon, 13 Jul 2020 07:51:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728714AbgGMLvt (ORCPT ); Mon, 13 Jul 2020 07:51:49 -0400 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9C83C061755 for ; Mon, 13 Jul 2020 04:51:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=0VFAIjFfZ5APIxw6QxOHI9YiNxSPgGB0GYAhZQL1j5k=; b=N9DsKSXpTDqJ2UUz2PcJCTYiJF YRH+hSnew3uLhFh/wNWlKlbhhOjArTkPbf/7P+YLfvYmSUAZL/q/ZP+zzXZxDpj7ALoj6MZIF0oUt pK0+QiAVwSaORk1C8SZrjQTdIw8Zwa/6n6lL6NzIYdoAmLgz6+Py+WE4PsPODeePpxCqMIdqHCZeD YYxUY8ZqBcwtjWgU6awPwM5gQPJVpiMcyDpoZKsBhTkdFp4vWuCCReRPhxjwsHL/6g5q1qlzyptzP gKVDzr3VAbfhySnRoL3ZLpA0C4b7plgMDzK8BDS1U+NHse2ypa6isNi4vpvNJAFJn32zZz4B3Iy7s sHpdouwg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1juwzp-0004V6-1m; Mon, 13 Jul 2020 11:51:45 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 5373E300F7A; Mon, 13 Jul 2020 13:51:41 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 3A50E20C03C56; Mon, 13 Jul 2020 13:51:41 +0200 (CEST) Date: Mon, 13 Jul 2020 13:51:41 +0200 From: Peter Zijlstra To: Alexey Dobriyan Cc: mingo@redhat.com, will@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] rwsem: fix commas in initialisation Message-ID: <20200713115141.GH10769@hirez.programming.kicks-ass.net> References: <20200711145954.GA1178171@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200711145954.GA1178171@localhost.localdomain> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jul 11, 2020 at 05:59:54PM +0300, Alexey Dobriyan wrote: > Leading comma prevents arbitrary reordering of initialisation clauses. > The whole point of C99 initialisation is to allow any such reordering. I'm conflicted on this argument, the only reason I'd be inclined to take this patch is that it allows fixing the initialization order to not be random. That is, I'd fold in the below. --- a/include/linux/rwsem.h +++ b/include/linux/rwsem.h @@ -89,9 +89,9 @@ static inline int rwsem_is_locked(struct #define __RWSEM_INITIALIZER(name) \ { __RWSEM_INIT_COUNT(name), \ .owner = ATOMIC_LONG_INIT(0), \ - .wait_list = LIST_HEAD_INIT((name).wait_list), \ - .wait_lock = __RAW_SPIN_LOCK_UNLOCKED(name.wait_lock),\ __RWSEM_OPT_INIT(name) \ + .wait_lock = __RAW_SPIN_LOCK_UNLOCKED(name.wait_lock),\ + .wait_list = LIST_HEAD_INIT((name).wait_list), \ __DEBUG_RWSEM_INITIALIZER(name) \ __RWSEM_DEP_MAP_INIT(name) }