Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1367954ybt; Sat, 11 Jul 2020 08:00:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9CG0PMG4i1qbDK8q40zilvuSFjuXiXLQafna6eLsQ8/T05lyfKEBBXuFtgtwmyZ/d6bRX X-Received: by 2002:aa7:c80f:: with SMTP id a15mr80429810edt.299.1594479640166; Sat, 11 Jul 2020 08:00:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594479640; cv=none; d=google.com; s=arc-20160816; b=tv8NgD5Xii/KiMK/4S8VXIHRuxLrrEe8hKFvzBy8oSYsLgbBaGmEGGzd2SM1/n+6K+ vSloNQ+BQIffdqJIGGHVgXVvmHvQlWvBW7OKa12Uv882Fkrv3siTVSqtyDO5HGOptP5C 8J7bRFxlkkq5lUFsNNJ2EjLn7yZM1dMCURBxaa6elr9A30hHvMJDhFlB1BDrxg6b/UkG MpyHFoZ6iTYYUomG7si7P+h9rfzJV2HFjSkCi3oUluOveuHkNRbB1To0CYeCAgWSpBKm AggV1cNSLBdMzNRK4POEcM/8qzqHjeIRemw9ljQlNqQY9MhcKeJ50cJUatwNkPparhWY z8Fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=+5YJ4BXyiVlwCev/UR7kk6fTDXZ3Zt+Tj2RKUuxL+a8=; b=m1q16mrZQXShKSfQYPa4Ban3BeROPb4AbNfSmQhbnqcVeGc8/5eDnGqUVsLVOyeuhb DK7Q5y+G4Ui0ECmJgtEk9Bmmti7szLhR2DgraYkOJibhiVsxwhM5yGbBcRbSFqIDQe89 vIRF6yG4lvODP69VwqcZ1sb92X7KfjXFi3kgZrcJF+Bk0D6mouaRbdJOA9Rl+jPFpO1S nxiQDr2zzumUMNgdH4o2gru01PD8dWozHLZUIIcWtwxifAxmPyhr1ijHyE9ZfvTjyB+K 3DRdKBYCUDR1uWDSSA/UKUAQWjExZkUcqLet3V3S+02MqrBa4eiXh6bg92gEhQEuG6ys 72jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CMRj30qE; 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 x9si5840157ejj.548.2020.07.11.08.00.15; Sat, 11 Jul 2020 08:00:40 -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=CMRj30qE; 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 S1728404AbgGKO77 (ORCPT + 99 others); Sat, 11 Jul 2020 10:59:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728330AbgGKO77 (ORCPT ); Sat, 11 Jul 2020 10:59:59 -0400 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 012A5C08C5DD for ; Sat, 11 Jul 2020 07:59:58 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id b6so8739697wrs.11 for ; Sat, 11 Jul 2020 07:59:58 -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:mime-version:content-disposition; bh=+5YJ4BXyiVlwCev/UR7kk6fTDXZ3Zt+Tj2RKUuxL+a8=; b=CMRj30qE68pT3/+9gTayn6Oxa3rw+6akAmiovWC9XLMF8VgQXxMOZFuuoGYKLYCp4A K5LlDsduDQhuHIZwqGaPynMi79PC3WUPu3gclwFmgrTl85ceQX9v+T7MUSt3E+Ni4mhR PzHs1OqIoy/MaAUiOsRe1+iljA6ikgK8cPQJTUcQrCvvfx6l0qWxgoSuOVnQo9tj/D9M Zlfg+hfCwLEH1/lAGpTXgdTughYytb6uaYSgdY6sHuQ4z5R3OOxSH+8ejyUXYLdONlGP /sfrrvDytwnnz6o+BL6G4y9T8+q4lGOjVVUvBne3WwPDs404QTJgcFUWkN+pTUtNvDEf 1HAQ== 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:mime-version :content-disposition; bh=+5YJ4BXyiVlwCev/UR7kk6fTDXZ3Zt+Tj2RKUuxL+a8=; b=Xv1LVzWMRL/efn1Vdqy9Rm8TJcR1/6fL2QD7al6gTMcd9goDQLHlg9yU2S0c+A/Vi5 Q5hphy6miNrdaolFUvR+TZcT7KUeLOrqLq3Ul8AWZfZRWMC9sDFqL67s9pE+YfoEZlwT gM9W6spaArPzC5GIuSPc5QSdKQngFukqn8xweCtqGAQXEEFD/OVQqXLeZtSdgq/ye5oP Ox68GHbSsFQwvnItu4eZniuv0CeAf88tFMO/izv5ek1tHr/QD9gP3G9dGe9qLeYv46xX Fu4IX9XdCGSDXzJNMAWlDOVqBcp26m/sG/K17x+Pru81Us2HYDtwqJ7J5GyEG0WT2nD8 K6iA== X-Gm-Message-State: AOAM531BUJwuj2noEIEfauI/S2aQd9NNd6z8FbBXlvYPG+0UGIfGKDvt GMyPLgCHkhUDP4l0wV1Bd+vWeMo= X-Received: by 2002:a5d:6802:: with SMTP id w2mr69479724wru.88.1594479597634; Sat, 11 Jul 2020 07:59:57 -0700 (PDT) Received: from localhost.localdomain ([46.53.249.169]) by smtp.gmail.com with ESMTPSA id p25sm13157545wmg.39.2020.07.11.07.59.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Jul 2020 07:59:56 -0700 (PDT) Date: Sat, 11 Jul 2020 17:59:54 +0300 From: Alexey Dobriyan To: peterz@infradead.org, mingo@redhat.com, will@kernel.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH] rwsem: fix commas in initialisation Message-ID: <20200711145954.GA1178171@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Leading comma prevents arbitrary reordering of initialisation clauses. The whole point of C99 initialisation is to allow any such reordering. Signed-off-by: Alexey Dobriyan --- include/linux/rwsem.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) --- a/include/linux/rwsem.h +++ b/include/linux/rwsem.h @@ -66,22 +66,22 @@ static inline int rwsem_is_locked(struct rw_semaphore *sem) #ifdef CONFIG_DEBUG_LOCK_ALLOC # define __RWSEM_DEP_MAP_INIT(lockname) \ - , .dep_map = { \ + .dep_map = { \ .name = #lockname, \ .wait_type_inner = LD_WAIT_SLEEP, \ - } + }, #else # define __RWSEM_DEP_MAP_INIT(lockname) #endif #ifdef CONFIG_DEBUG_RWSEMS -# define __DEBUG_RWSEM_INITIALIZER(lockname) , .magic = &lockname +# define __DEBUG_RWSEM_INITIALIZER(lockname) .magic = &lockname, #else # define __DEBUG_RWSEM_INITIALIZER(lockname) #endif #ifdef CONFIG_RWSEM_SPIN_ON_OWNER -#define __RWSEM_OPT_INIT(lockname) , .osq = OSQ_LOCK_UNLOCKED +#define __RWSEM_OPT_INIT(lockname) .osq = OSQ_LOCK_UNLOCKED, #else #define __RWSEM_OPT_INIT(lockname) #endif @@ -90,7 +90,7 @@ static inline int rwsem_is_locked(struct rw_semaphore *sem) { __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) \ + .wait_lock = __RAW_SPIN_LOCK_UNLOCKED(name.wait_lock),\ __RWSEM_OPT_INIT(name) \ __DEBUG_RWSEM_INITIALIZER(name) \ __RWSEM_DEP_MAP_INIT(name) }