From patchwork Mon Jul 10 08:37:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 117717 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp4882468vqx; Mon, 10 Jul 2023 02:00:49 -0700 (PDT) X-Google-Smtp-Source: APBJJlGc6Sm/XwxVbq/1RJPtqeGxyFI4oLUJKYxFE06tW+hBXpm04w1TPUOhDeNla9mO9FeQKLuk X-Received: by 2002:aa7:d55a:0:b0:51d:95ac:22ed with SMTP id u26-20020aa7d55a000000b0051d95ac22edmr15759867edr.1.1688979649388; Mon, 10 Jul 2023 02:00:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688979649; cv=none; d=google.com; s=arc-20160816; b=HDAds7vMqvoX1DpcV5vEohWVQF6D920G1tvZsDCzGDqvAbpIo4scVAdM7rJzdGM1Oj ZBITwOEpyJ6Ozo4F13D4HR4q6gCRT86EeOfiKHhVh4NVymsNZz3FEqrMkH7Xm5g2NUm4 DvN7ffiNlr333qp1vNCsq+AOqvfwpJUKRd2XRwmaeUWgwyr98QFq0i9KWGorscck4bzC biFqM+ohdc7tp91er6OmFjRbW6oGPoz6JQTkI+Zlv/qT39TFsRjHpRKRS1Tz1TIof6uD cTu4U1Qf+jEAwqZJUuCJjnudEfvgypqsjzctV0b5l4VATKLtfBrsHoCsarz3rP0kvGVJ uwqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=b5NJHJ+H28lGHwbhSa9F6XeQ+mXfL8Cc5aFSC6L775s=; fh=tFtxuEyh1oqaeGdGXrkrCi4h46RN10bcOvB+fCYMqDo=; b=Gt/DBN5rKxHfhdJrXp1xAzeV2OF/zh6gWDjhRFh70QNLQWc6gXCRhDAHTY5fpjBA59 zfSRPs4jpygwnGdla4dug9iCkBWziRoTdUa+CgOywwsEspLZhodWikDSPWZCdzlN0wvj QOXxT4YSmsiOJALxTEBgesouCbw4RJDhiYyx/5zn9PukbjWf2VG1Ggkp9t81sappWcnp 9x3Kjz262OvBrkMS/Huekm/IzPPeRnoLL6+0cEmVQE5QdmEvc1XhGv5C4TedepQf6Cec DZIUYkJXUfEaln8ShRVAlWohXxykcVbenvQSsVjfROwA7NJY6oYjXWjAhjvNdC2ydZqA HueQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=U5jqE1oD; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e25-20020a056402089900b0051bfc119d36si5312572edy.85.2023.07.10.02.00.26; Mon, 10 Jul 2023 02:00:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=U5jqE1oD; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231256AbjGJIiG (ORCPT + 99 others); Mon, 10 Jul 2023 04:38:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230446AbjGJIhy (ORCPT ); Mon, 10 Jul 2023 04:37:54 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDFBBC7; Mon, 10 Jul 2023 01:37:52 -0700 (PDT) Date: Mon, 10 Jul 2023 08:37:51 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1688978271; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=b5NJHJ+H28lGHwbhSa9F6XeQ+mXfL8Cc5aFSC6L775s=; b=U5jqE1oDQwhYZmqxQ6xXeEkdAnF44QO7HfBYnXkMjxD/fb/6SnPanxQaSWx5VqsaT1giqt CKCU4XCMoSBheHoOdxCT9DyqXlddDoa80Rq+GLVYfgh/BAPrpBPP41BC5IjvAe2FnmtHdH aodbGfSQfsAJLWdbjLGcdwAsjmEsI4rgl7MxtV5HPXIPsPfc2/2zFKkvFk37giky6AoRYh /9pIoIrklhHoaHs/1OJ9fz1/l4PFa6yvj5Kk/WqH2rrmLrdCafuJlymMxa07trp7l22wdq F1wrkADXX5R8jw1uOFCoGfXvosoAAG68ZSpwxI6xDBHKjR0/ELRDQF44GOSWog== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1688978271; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=b5NJHJ+H28lGHwbhSa9F6XeQ+mXfL8Cc5aFSC6L775s=; b=pR6E+3nn4EWwcvQeAzwUSb21dc1QGjkPsjQOnSgdgw3nebxB2AfVQoZWdNPukn6SDx08gr /OG7PPS9qgksMOBg== From: "tip-bot2 for Uros Bizjak" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: perf/core] locking/arch: Avoid variable shadowing in local_try_cmpxchg() Cc: Charlemagne Lasse , Uros Bizjak , "Peter Zijlstra (Intel)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230708090048.63046-1-ubizjak@gmail.com> References: <20230708090048.63046-1-ubizjak@gmail.com> MIME-Version: 1.0 Message-ID: <168897827110.404.18144213137097595757.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1770843789952725507 X-GMAIL-MSGID: 1771023524885900090 The following commit has been merged into the perf/core branch of tip: Commit-ID: d6b45484c130f4095313ae3edeb4aae662c12fb1 Gitweb: https://git.kernel.org/tip/d6b45484c130f4095313ae3edeb4aae662c12fb1 Author: Uros Bizjak AuthorDate: Sat, 08 Jul 2023 11:00:36 +02:00 Committer: Peter Zijlstra CommitterDate: Mon, 10 Jul 2023 09:52:36 +02:00 locking/arch: Avoid variable shadowing in local_try_cmpxchg() Several architectures define arch_try_local_cmpxchg macro using internal temporary variables named ___old, __old or _old. Remove temporary varible in local_try_cmpxchg to avoid variable shadowing. No functional change intended. Fixes: d994f2c8e241 ("locking/arch: Wire up local_try_cmpxchg()") Closes: https://lore.kernel.org/lkml/CAFGhKbyxtuk=LoW-E3yLXgcmR93m+Dfo5-u9oQA_YC5Fcy_t9g@mail.gmail.com/ Reported-by: Charlemagne Lasse Signed-off-by: Uros Bizjak Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20230708090048.63046-1-ubizjak@gmail.com --- arch/loongarch/include/asm/local.h | 4 ++-- arch/mips/include/asm/local.h | 4 ++-- arch/x86/include/asm/local.h | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/loongarch/include/asm/local.h b/arch/loongarch/include/asm/local.h index 83e995b..c496758 100644 --- a/arch/loongarch/include/asm/local.h +++ b/arch/loongarch/include/asm/local.h @@ -63,8 +63,8 @@ static inline long local_cmpxchg(local_t *l, long old, long new) static inline bool local_try_cmpxchg(local_t *l, long *old, long new) { - typeof(l->a.counter) *__old = (typeof(l->a.counter) *) old; - return try_cmpxchg_local(&l->a.counter, __old, new); + return try_cmpxchg_local(&l->a.counter, + (typeof(l->a.counter) *) old, new); } #define local_xchg(l, n) (atomic_long_xchg((&(l)->a), (n))) diff --git a/arch/mips/include/asm/local.h b/arch/mips/include/asm/local.h index 5daf6fe..e6ae3df 100644 --- a/arch/mips/include/asm/local.h +++ b/arch/mips/include/asm/local.h @@ -101,8 +101,8 @@ static __inline__ long local_cmpxchg(local_t *l, long old, long new) static __inline__ bool local_try_cmpxchg(local_t *l, long *old, long new) { - typeof(l->a.counter) *__old = (typeof(l->a.counter) *) old; - return try_cmpxchg_local(&l->a.counter, __old, new); + return try_cmpxchg_local(&l->a.counter, + (typeof(l->a.counter) *) old, new); } #define local_xchg(l, n) (atomic_long_xchg((&(l)->a), (n))) diff --git a/arch/x86/include/asm/local.h b/arch/x86/include/asm/local.h index 56d4ef6..635132a 100644 --- a/arch/x86/include/asm/local.h +++ b/arch/x86/include/asm/local.h @@ -127,8 +127,8 @@ static inline long local_cmpxchg(local_t *l, long old, long new) static inline bool local_try_cmpxchg(local_t *l, long *old, long new) { - typeof(l->a.counter) *__old = (typeof(l->a.counter) *) old; - return try_cmpxchg_local(&l->a.counter, __old, new); + return try_cmpxchg_local(&l->a.counter, + (typeof(l->a.counter) *) old, new); } /* Always has a lock prefix */