Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1008554ybh; Mon, 13 Jul 2020 07:09:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwxgW6ZRY0WOotHC5FDBZU7m+8okTC41lRF/oQR5+CB86Uj04hwqlL59rUKhsQuZEWZk23G X-Received: by 2002:a17:906:71d4:: with SMTP id i20mr78172735ejk.533.1594649356533; Mon, 13 Jul 2020 07:09:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594649356; cv=none; d=google.com; s=arc-20160816; b=o9JMH3TzB4R3sM5jhZNpB4EXC1aJzkv0WcfFiEGEfRf2nIkO9TnFp0d6cqJoc17k+d 2zUCwFCnGMVFeaQuyS6RiLIBx/RwBmJbam/1Vfj3lPJsTSKyQ0k+nabPJVrbIy55Pb6B sXSJyXmeJx88YpDkoPCmcnU4GSg97RbWJMbTuu0Ix3tzUr353qEzjHyXo+IPJdZceOD6 0yoKge5eNjpViU0gzJSxOdeW/tmEtS0UNMwsSgo4dAOX56uk0ul7Hg2S6ZYkoAoZauon u2eMz2AVkhvLBry59qK5M2UvQnV+bHeVEXodGiXvlxNlpmKTh/KwfBgdGcaISsCnM4TU JwAg== 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=AYBT93/x6rrYq9RPd2K35aqbqlGYbFacLRXNWsdWgbc=; b=utM0R9h9zV8a5ataCTobQvJGG9L5Olo8MpXjFfWi4pzlLNZXRA/bcWAv5EfU9ZSL8y GUMfrdWUNNsYjQKWZcVn5KQ39Jpw3UlVnKitav4xQUPgdoG7BLCOvOv6eoMgubyPKSBE 9rhLb49eNGHtWqYsfPzcv5P4DhLB+wqZejc8NUVWVhRYKpHzuXsMcu54GRvbHRkkEtdu dnWQuPkT0RlFzSQC0hjMAfWACu+ShUvBAGbMQMqiD7+ECWHh6P4LYNE40RMP+N/2ngB+ NYH9Q8Mg2lv6wVln1pFClGT53AgLvHpbQ56jZQdP2SX78UbFgK/r/uw+TIrVUirmPqT8 juEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dU+8SVFw; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lw6si8676852ejb.506.2020.07.13.07.08.51; Mon, 13 Jul 2020 07:09: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=pass header.i=@gmail.com header.s=20161025 header.b=dU+8SVFw; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729823AbgGMOG2 (ORCPT + 99 others); Mon, 13 Jul 2020 10:06:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729659AbgGMOG2 (ORCPT ); Mon, 13 Jul 2020 10:06:28 -0400 Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40937C061755 for ; Mon, 13 Jul 2020 07:06:28 -0700 (PDT) Received: by mail-wm1-x344.google.com with SMTP id g75so13426842wme.5 for ; Mon, 13 Jul 2020 07:06:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=AYBT93/x6rrYq9RPd2K35aqbqlGYbFacLRXNWsdWgbc=; b=dU+8SVFwmJ267v2437oNfANVH0w+KtdmF9nlS2MFnrlicHxPWJba+nGK3mBC1/TMue lfjmeyk2ndOV4n+34k+r2FM1693H8W0za4PmgmOmiWm+EdpE+ewUND7/X4bUSYs0ourB sqAPho5W/cEVWxjkjy1ueK9vvnSrtfhsSw9XN8adimyJbzDhXoeREA+KQUXb4NAeSnCn Nuhn4lgVc9NCG2mO9w/SJu8mWyOHAM+C6WZce27gosSNTyOf16LEN+e/ST1rlpK3C69D F4x+M67cw1w8E3e+JyVfa3WjN8acPOkjrWhuqpJ2O0XXkiVWNhPBjWmN0RztZYtp34Vc WnfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=AYBT93/x6rrYq9RPd2K35aqbqlGYbFacLRXNWsdWgbc=; b=iKolf61+WU1g8lfhxaTfbvuIKGpoGvHO4lMgnuTu1yA6WLZnCVho1OAANB9HcY9eFJ kMBorLD70qZrsrZpMb0Ij5AtRrTMKlWC0PzmYEuUETEMBzmGRtSNvcwgYjHcN4zjtWN2 tRDyKKKU3R29v+Mvh6ZFbMGZVudYtvvkXwYfkSnqhgVT8+NllFZmW5Jj2F+Jfg/pUyg3 yGYn/roC1KXaY7NSfogt2fSo+WRUKVaT8LcL6lRsNAaTarVaLaLEdKTT+BARbMWEtVaU ffgDEVF/eHBFcyzCKzGntvQjMPCQm2CCqQHVV8njG6wZxHZk+VZBCTnwADrNueDB1TCr 9jYg== X-Gm-Message-State: AOAM531K7OLs04VnBZ2KHdHUII5CqqDUT9HcZqwWwOY6g+sLSfpSBmyN dKxZsm1O/XF+plUmIfZ8/A== X-Received: by 2002:a1c:80d3:: with SMTP id b202mr120710wmd.111.1594649186814; Mon, 13 Jul 2020 07:06:26 -0700 (PDT) Received: from localhost.localdomain ([46.53.252.34]) by smtp.gmail.com with ESMTPSA id 51sm25807572wrc.44.2020.07.13.07.06.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 07:06:25 -0700 (PDT) Date: Mon, 13 Jul 2020 17:06:24 +0300 From: Alexey Dobriyan To: Peter Zijlstra Cc: mingo@redhat.com, will@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] rwsem: fix commas in initialisation Message-ID: <20200713140624.GA17904@localhost.localdomain> References: <20200711145954.GA1178171@localhost.localdomain> <20200713115141.GH10769@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200713115141.GH10769@hirez.programming.kicks-ass.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 13, 2020 at 01:51:41PM +0200, Peter Zijlstra wrote: > 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. Yes, this is how the issue was noticed. > 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), \ One less chunk to compile with g++, a billion to go :^)