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=-20.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 240EDC433ED for ; Wed, 7 Apr 2021 19:22:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D2B6F61153 for ; Wed, 7 Apr 2021 19:22:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355598AbhDGTWv (ORCPT ); Wed, 7 Apr 2021 15:22:51 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:38372 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229512AbhDGTWt (ORCPT ); Wed, 7 Apr 2021 15:22:49 -0400 Date: Wed, 07 Apr 2021 19:22:36 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1617823358; 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=j55FbUowvvspGmP82pJL7+9tG7t14xv/PZWFTM7KWfE=; b=H+x4sAwSUuE597t22ctiZDbhL1tUTLRXHQ5srCGuElLO56zxJ/o7FdySYRlYiSDpcllyi1 lwB06gtmyEGuO50oOubDojXUdJxSXJO+JXenkGv2T2j3oZdouuMcJwEsucoEMjkE0sTWgj 159l9rEU9wAedwhYaz1fYh72/YuYlNV5UDdmteZbPdueigirHYd1+l2iEPoWiAkLAsfoq/ DEHIEDURKR/x/ZIMZUmEmtLMxje2oa4mMOMA5/FWJZ6cEnxaPjnkjxKKW5K509RCT6vP3c Lc0Yg3PTZUtBuAl7a8dVjeQOSrCqSoZTrlYyz3R3cybIoefM6qqXqA6nu2LS6g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1617823358; 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=j55FbUowvvspGmP82pJL7+9tG7t14xv/PZWFTM7KWfE=; b=US09382ShxFZE2jgnEcwqhAYdLQ1nIvnCsJF6AZiaL46sj/z86oiP73Zz0D0JERlq1Ykw0 xxGENRDdiyd/MBAw== From: "tip-bot2 for Yang Li" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/cleanups] x86/cacheinfo: Remove unneeded dead-store initialization Cc: Abaci Robot , Yang Li , Borislav Petkov , Nick Desaulniers , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <1617177624-24670-1-git-send-email-yang.lee@linux.alibaba.com> References: <1617177624-24670-1-git-send-email-yang.lee@linux.alibaba.com> MIME-Version: 1.0 Message-ID: <161782335615.29796.11696660764867463693.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the x86/cleanups branch of tip: Commit-ID: dda451f391eee5d68db3ca87fd8b2a42c8c2b507 Gitweb: https://git.kernel.org/tip/dda451f391eee5d68db3ca87fd8b2a42c8c2b507 Author: Yang Li AuthorDate: Wed, 31 Mar 2021 16:00:24 +08:00 Committer: Borislav Petkov CommitterDate: Wed, 07 Apr 2021 21:12:12 +02:00 x86/cacheinfo: Remove unneeded dead-store initialization $ make CC=clang clang-analyzer (needs clang-tidy installed on the system too) on x86_64 defconfig triggers: arch/x86/kernel/cpu/cacheinfo.c:880:24: warning: Value stored to 'this_cpu_ci' \ during its initialization is never read [clang-analyzer-deadcode.DeadStores] struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu); ^ arch/x86/kernel/cpu/cacheinfo.c:880:24: note: Value stored to 'this_cpu_ci' \ during its initialization is never read So simply remove this unneeded dead-store initialization. As compilers will detect this unneeded assignment and optimize this anyway the resulting object code is identical before and after this change. No functional change. No change to object code. [ bp: Massage commit message. ] Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: Borislav Petkov Reviewed-by: Nick Desaulniers Link: https://lkml.kernel.org/r/1617177624-24670-1-git-send-email-yang.lee@linux.alibaba.com --- arch/x86/kernel/cpu/cacheinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/cacheinfo.c b/arch/x86/kernel/cpu/cacheinfo.c index 3ca9be4..d66af29 100644 --- a/arch/x86/kernel/cpu/cacheinfo.c +++ b/arch/x86/kernel/cpu/cacheinfo.c @@ -877,7 +877,7 @@ void init_intel_cacheinfo(struct cpuinfo_x86 *c) static int __cache_amd_cpumap_setup(unsigned int cpu, int index, struct _cpuid4_info_regs *base) { - struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu); + struct cpu_cacheinfo *this_cpu_ci; struct cacheinfo *this_leaf; int i, sibling;