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=-13.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 4D038C388F9 for ; Mon, 26 Oct 2020 16:52:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ED0BA2224A for ; Mon, 26 Oct 2020 16:52:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603731158; bh=kBhHqTFXZXvYhq/jtGD1o/JBzgBPxLe0agIn0ampbfQ=; h=From:To:Cc:Subject:Date:List-ID:From; b=n29KQYDe/ptDI44CwjXIQ4ftSKDgxsoruR1YgeROEG4XyHE8GPUlG5RNYh5x/zxhI gsBoGOSbiQ34EgieZU8jK437OkPzFtZ0LG8Q6XMlZmpsIzhhuSega+ZyM8Wf5SyqnY bChNyIOpzrtO6tRQnbpzWT3sCp4oN9rgoCpEvH/I= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1786570AbgJZQwg (ORCPT ); Mon, 26 Oct 2020 12:52:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:44484 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1786528AbgJZQuv (ORCPT ); Mon, 26 Oct 2020 12:50:51 -0400 Received: from localhost.localdomain (unknown [192.30.34.233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E7756221FC; Mon, 26 Oct 2020 16:50:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603731051; bh=kBhHqTFXZXvYhq/jtGD1o/JBzgBPxLe0agIn0ampbfQ=; h=From:To:Cc:Subject:Date:From; b=gDd238u+deaEqbi5jYSaibEhOibOVtWJfCVlJzktqSJIqFN7FsnyyWYryqNqfLJ8q oS+QxDeuTa4nAhga2rtbdqageZvqZ398dLBCuTgRTRoa1e5jD1cKDLJMhXf7BZ2+H0 cONBqMDO3uBXJhtjdhUl5rbmNKGk//CTy+CpcxuE= From: Arnd Bergmann To: Peter Zijlstra , Ingo Molnar , Will Deacon , "Ahmed S. Darwish" Cc: Arnd Bergmann , "Paul E. McKenney" , Marco Elver , linux-kernel@vger.kernel.org Subject: [PATCH] seqlock: avoid -Wshadow warnings Date: Mon, 26 Oct 2020 17:50:38 +0100 Message-Id: <20201026165044.3722931-1-arnd@kernel.org> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann When building with W=2, there is a flood of warnings about the seqlock macros shadowing local variables: 19806 linux/seqlock.h:331:11: warning: declaration of 'seq' shadows a previous local [-Wshadow] 48 linux/seqlock.h:348:11: warning: declaration of 'seq' shadows a previous local [-Wshadow] 8 linux/seqlock.h:379:11: warning: declaration of 'seq' shadows a previous local [-Wshadow] Prefix the local variables to make the warning useful elsewhere again. Fixes: 52ac39e5db51 ("seqlock: seqcount_t: Implement all read APIs as statement expressions") Signed-off-by: Arnd Bergmann --- include/linux/seqlock.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h index cbfc78b92b65..8d8552474c64 100644 --- a/include/linux/seqlock.h +++ b/include/linux/seqlock.h @@ -328,13 +328,13 @@ SEQCOUNT_LOCKNAME(ww_mutex, struct ww_mutex, true, &s->lock->base, ww_mu */ #define __read_seqcount_begin(s) \ ({ \ - unsigned seq; \ + unsigned __seq; \ \ - while ((seq = __seqcount_sequence(s)) & 1) \ + while ((__seq = __seqcount_sequence(s)) & 1) \ cpu_relax(); \ \ kcsan_atomic_next(KCSAN_SEQLOCK_REGION_MAX); \ - seq; \ + __seq; \ }) /** @@ -345,10 +345,10 @@ SEQCOUNT_LOCKNAME(ww_mutex, struct ww_mutex, true, &s->lock->base, ww_mu */ #define raw_read_seqcount_begin(s) \ ({ \ - unsigned seq = __read_seqcount_begin(s); \ + unsigned _seq = __read_seqcount_begin(s); \ \ smp_rmb(); \ - seq; \ + _seq; \ }) /** @@ -376,11 +376,11 @@ SEQCOUNT_LOCKNAME(ww_mutex, struct ww_mutex, true, &s->lock->base, ww_mu */ #define raw_read_seqcount(s) \ ({ \ - unsigned seq = __seqcount_sequence(s); \ + unsigned __seq = __seqcount_sequence(s); \ \ smp_rmb(); \ kcsan_atomic_next(KCSAN_SEQLOCK_REGION_MAX); \ - seq; \ + __seq; \ }) /** -- 2.27.0