From patchwork Wed Jan 11 12:46:18 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: 41971 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3301201wrt; Wed, 11 Jan 2023 04:56:18 -0800 (PST) X-Google-Smtp-Source: AMrXdXsgt/PvGbR11p6lcyoLTx6eOCK299W7Mv25YNPhNvT2VEiNaQZxbtaJT/TCKghgy80WzDGz X-Received: by 2002:a17:90a:d30b:b0:226:cefc:2709 with SMTP id p11-20020a17090ad30b00b00226cefc2709mr20671142pju.9.1673441778654; Wed, 11 Jan 2023 04:56:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673441778; cv=none; d=google.com; s=arc-20160816; b=xyl51OOzkTyWO5yqG6Z6pqWSBjyrrZcajX+PADRVvgf9dScCM1tV7GyT1p54G4x+3B f/SUi/dWgFDV993IBMN6rfgWkhcD2ulffm9YYb1gOW0ym69mVn4NyL+lakiOlaROtNT2 yBw72NbW9OhaVEkvIYHp/JooHLqJBRPA5r0PIq5eCqpwHbbiVUMWRWhNzc3HYdWU7Iz0 pMzDj7cLbxdysoqyr3e5wKS0yvn25csJbT54DDn0sP4qkyvuRZgWS64Dtd8yrZErvzbM NURjsXi8bKl/uoijI9f/xI+HyOasFmqqEPT6eXhjyvF7VukUA1FgZC/bqx/f2HBBXDpR DF1g== 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=HJRmCe2JRPrclyZDv+jxp2gCtkF0MB5rMYfHRUF55lY=; b=RXJd+n8DzDeZo2BxdgW37HO7OqRaA6qaDbZftHTp+ZtWOKo6RfrOFrXEN3WsqygNUJ AmShL43y5buN1yjGMoQCOjm6K5xrsGJxyjWYAIjPB7icxBhzyWEg4r3vL4TcFyHX25+r qCVZaeK/fiycPmmuHi8QQZO1K7EjwlhKume1IQG3KJUcEnp7Oq/8JjnM4J3qFNmfQhER YjIetq11FrwMvy+6VvfVvmIMzdVhZR/fi9yNK0Gpj6DklgOLwt6BqU1MY7zaqFqZEzxh EBZ9fSA7Lm4nx7DANoQarVQ/Ov57J855QoW7P4d+VRGUaLYnE/0G1MLtPcAYFYY6qS5f 3tXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="v/08Vtu9"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=OboHnC1k; 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 t6-20020a63dd06000000b0047895910bd0si14172619pgg.825.2023.01.11.04.56.04; Wed, 11 Jan 2023 04:56:18 -0800 (PST) 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="v/08Vtu9"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=OboHnC1k; 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 S231831AbjAKMq3 (ORCPT + 99 others); Wed, 11 Jan 2023 07:46:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231972AbjAKMqW (ORCPT ); Wed, 11 Jan 2023 07:46:22 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C11AE1DE; Wed, 11 Jan 2023 04:46:21 -0800 (PST) Date: Wed, 11 Jan 2023 12:46:18 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1673441179; 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=HJRmCe2JRPrclyZDv+jxp2gCtkF0MB5rMYfHRUF55lY=; b=v/08Vtu93GWOvzbL3W9z+cBDQK+TN1qqqrR66fvjzYO30IHyK9UZ51CUruPNEzWDJIGCcw hYI+xS0U/nJLWRDNDJJtIeG81AQHQJGrq1S5aeNMepSOsvJ0OlCnyd/RrQ3UBsTGyjiGs1 XtIaTN2HpdfVaOV/n8QenwGGzVkLiBfKdXQS0qVGLMzUIa6uqsCsKvI61Tcx47g23/lsna 3E4Ym4Hnbo5rscWcMqPA9doOdy/ATFA7MPS++FKv1USREq04i++KKwIq0pAjoJnGwGZ98B ctFU745KwIiT8QOGmZd9u9qg3wgP8FmBJ8Y6bYWZy4QFECOR6AgvonlRM8Vvkw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1673441179; 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=HJRmCe2JRPrclyZDv+jxp2gCtkF0MB5rMYfHRUF55lY=; b=OboHnC1keQvF/IqHOrgHfPYZfLgdLYCuOjFhDUjX3Axj9hqkt0NotVrgokR6gJ77EjL5st b47xyQqiW+31JaDg== From: "tip-bot2 for Yuntao Wang" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/cleanups] x86/setup: Move duplicate boot_cpu_data definition out of the ifdeffery Cc: Yuntao Wang , "Borislav Petkov (AMD)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20220601122914.820890-1-ytcoode@gmail.com> References: <20220601122914.820890-1-ytcoode@gmail.com> MIME-Version: 1.0 Message-ID: <167344117807.4906.12901315064552359156.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS 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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754730886337173356?= X-GMAIL-MSGID: =?utf-8?q?1754730886337173356?= The following commit has been merged into the x86/cleanups branch of tip: Commit-ID: 50c66d7b049ddec095644a005bfe0b28e22c4b02 Gitweb: https://git.kernel.org/tip/50c66d7b049ddec095644a005bfe0b28e22c4b02 Author: Yuntao Wang AuthorDate: Wed, 01 Jun 2022 20:29:14 +08:00 Committer: Borislav Petkov (AMD) CommitterDate: Wed, 11 Jan 2023 12:45:16 +01:00 x86/setup: Move duplicate boot_cpu_data definition out of the ifdeffery Both the if and else blocks define an exact same boot_cpu_data variable, move the duplicate variable definition out of the if/else block. In addition, do some other minor cleanups. [ bp: Massage. ] Signed-off-by: Yuntao Wang Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20220601122914.820890-1-ytcoode@gmail.com --- arch/x86/kernel/e820.c | 4 ++-- arch/x86/kernel/setup.c | 10 ++-------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c index 0614a79..fb8cf95 100644 --- a/arch/x86/kernel/e820.c +++ b/arch/x86/kernel/e820.c @@ -395,7 +395,7 @@ int __init e820__update_table(struct e820_table *table) /* Continue building up new map based on this information: */ if (current_type != last_type || e820_nomerge(current_type)) { - if (last_type != 0) { + if (last_type) { new_entries[new_nr_entries].size = change_point[chg_idx]->addr - last_addr; /* Move forward only if the new size was non-zero: */ if (new_entries[new_nr_entries].size != 0) @@ -403,7 +403,7 @@ int __init e820__update_table(struct e820_table *table) if (++new_nr_entries >= max_nr_entries) break; } - if (current_type != 0) { + if (current_type) { new_entries[new_nr_entries].addr = change_point[chg_idx]->addr; new_entries[new_nr_entries].type = current_type; last_addr = change_point[chg_idx]->addr; diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 8818854..16babff 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -114,11 +114,6 @@ static struct resource bss_resource = { #ifdef CONFIG_X86_32 /* CPU data as detected by the assembly code in head_32.S */ struct cpuinfo_x86 new_cpu_data; - -/* Common CPU data for all CPUs */ -struct cpuinfo_x86 boot_cpu_data __read_mostly; -EXPORT_SYMBOL(boot_cpu_data); - unsigned int def_to_bigsmp; struct apm_info apm_info; @@ -132,11 +127,10 @@ EXPORT_SYMBOL(ist_info); struct ist_info ist_info; #endif -#else -struct cpuinfo_x86 boot_cpu_data __read_mostly; -EXPORT_SYMBOL(boot_cpu_data); #endif +struct cpuinfo_x86 boot_cpu_data __read_mostly; +EXPORT_SYMBOL(boot_cpu_data); #if !defined(CONFIG_X86_PAE) || defined(CONFIG_X86_64) __visible unsigned long mmu_cr4_features __ro_after_init;