Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp383864iof; Mon, 6 Jun 2022 05:28:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5GBgCqqF33Yqcv8ntfP+v4de0oun3Dt5pBVFhIlRDnj1pDa3rb/a5SwCG8jBZURk+VR+s X-Received: by 2002:a05:6a00:1305:b0:512:ebab:3b20 with SMTP id j5-20020a056a00130500b00512ebab3b20mr24064227pfu.82.1654518506610; Mon, 06 Jun 2022 05:28:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654518506; cv=none; d=google.com; s=arc-20160816; b=RB58m7rkm0U79Qm02DPH06QoeOZu4xU0DGjXMSk/htISG1oCwaCMoZVxhRpO2b6+CJ L5AYXw9lWTjzrbPy3ymIEmTnugybfL6eAFPKjX3f15dzGC+0OGvzG/H1CvBCp2gIWeXy aCYVhGdzIOsRkFg10DYeaX2V+GSIACfSVJxsIjd8qfa3MwDQks2jScc7E1B1d63f3M+D 2uytrrFMEjKrLFB4my6kJZfwdZTwaZB2o7+N/cfr8jhpbpXZW1xKSWHoF5zl1Q7VBYxz F031XM4f8QxZanqnE8MaqwCRVPucbY0oKmjJYds4/JP1oc4myV/mXoPKAa3QelC0HffH pPsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=m+rADbAcWTbWpNd7kKSHXZhcwLIBUvTV9VG7iUePm8A=; b=ymMWQH8ZFdjz4Cst/wBt+RqDRYrWpmTnB5ccmcZbc2afTqG0QhSXkGb2szgzjbBavX FsNjVzJrVrUcCNS1RikBQCbKIvpS7fpAg9l2i445+gMiDFmz2b139kJwNVsLlFKEgMvf jSBU2Ir6Q5d/36EMiqfkL8qHhA1mjcVqrVd6wpBLBtxQRPSoB9eHV4pEoVf2O+0eJEyM Ca89YRNrq2MQalRQbr9Vsv144M8T0IdEbBxT5aDrlWlnZM/qT3jFpNJQGpS8OA/lYcQN rxYb8Vk3mNnrH81K33qRLL6AeIFALVVw9+OiCTIx+4Mi6l9GMZW/b9hzFEnVMIGQNZaC sfVQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id 130-20020a630488000000b003fc5ca10e2asi19298669pge.73.2022.06.06.05.28.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jun 2022 05:28:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5F04E52E5D; Mon, 6 Jun 2022 05:23:47 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236788AbiFFMXf (ORCPT + 99 others); Mon, 6 Jun 2022 08:23:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236785AbiFFMXe (ORCPT ); Mon, 6 Jun 2022 08:23:34 -0400 Received: from mail.nfschina.com (unknown [IPv6:2400:dd01:100f:2:72e2:84ff:fe10:5f45]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AC9BE4ECCB for ; Mon, 6 Jun 2022 05:23:31 -0700 (PDT) Received: from localhost (unknown [127.0.0.1]) by mail.nfschina.com (Postfix) with ESMTP id 71D481E80D76; Mon, 6 Jun 2022 20:23:19 +0800 (CST) X-Virus-Scanned: amavisd-new at test.com Received: from mail.nfschina.com ([127.0.0.1]) by localhost (mail.nfschina.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oJle7d--Zptp; Mon, 6 Jun 2022 20:23:16 +0800 (CST) Received: from localhost.localdomain (unknown [219.141.250.2]) (Authenticated sender: kunyu@nfschina.com) by mail.nfschina.com (Postfix) with ESMTPA id 735241E80D27; Mon, 6 Jun 2022 20:23:16 +0800 (CST) From: Li kunyu To: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, rafael.j.wysocki@intel.com, tony.luck@intel.com, tim.c.chen@linux.intel.com, tim.gardner@canonical.com, boris.ostrovsky@oracle.com Cc: peterz@infradead.org, ray.huang@amd.com, paulmck@kernel.org, ionela.voinescu@arm.com, linux-kernel@vger.kernel.org, Li kunyu Subject: [PATCH] x86: topology_update_package_map function doesn't use the return value Date: Mon, 6 Jun 2022 20:23:16 +0800 Message-Id: <20220606122316.291022-1-kunyu@nfschina.com> X-Mailer: git-send-email 2.18.2 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 topology_update_package_map function could remove the return value, and it could remove the BUG_ON check. Signed-off-by: Li kunyu --- arch/x86/include/asm/topology.h | 6 +++--- arch/x86/kernel/cpu/common.c | 2 +- arch/x86/kernel/smpboot.c | 3 +-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h index 458c891a8273..eabfb44b63ed 100644 --- a/arch/x86/include/asm/topology.h +++ b/arch/x86/include/asm/topology.h @@ -136,7 +136,7 @@ static inline int topology_max_smt_threads(void) return __max_smt_threads; } -int topology_update_package_map(unsigned int apicid, unsigned int cpu); +void topology_update_package_map(unsigned int apicid, unsigned int cpu); int topology_update_die_map(unsigned int dieid, unsigned int cpu); int topology_phys_to_logical_pkg(unsigned int pkg); int topology_phys_to_logical_die(unsigned int die, unsigned int cpu); @@ -144,8 +144,8 @@ bool topology_is_primary_thread(unsigned int cpu); bool topology_smt_supported(void); #else #define topology_max_packages() (1) -static inline int -topology_update_package_map(unsigned int apicid, unsigned int cpu) { return 0; } +static inline void +topology_update_package_map(unsigned int apicid, unsigned int cpu) { } static inline int topology_update_die_map(unsigned int dieid, unsigned int cpu) { return 0; } static inline int topology_phys_to_logical_pkg(unsigned int pkg) { return 0; } diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index c296cb1c0113..22d19a1feafd 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -1673,7 +1673,7 @@ static void validate_apic_and_package_id(struct cpuinfo_x86 *c) pr_err(FW_BUG "CPU%u: APIC id mismatch. Firmware: %x APIC: %x\n", cpu, apicid, c->initial_apicid); } - BUG_ON(topology_update_package_map(c->phys_proc_id, cpu)); + topology_update_package_map(c->phys_proc_id, cpu); BUG_ON(topology_update_die_map(c->cpu_die_id, cpu)); #else c->logical_proc_id = 0; diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 5e7f9532a10d..20c67cca245b 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -327,7 +327,7 @@ EXPORT_SYMBOL(topology_phys_to_logical_die); * @pkg: The physical package id as retrieved via CPUID * @cpu: The cpu for which this is updated */ -int topology_update_package_map(unsigned int pkg, unsigned int cpu) +void topology_update_package_map(unsigned int pkg, unsigned int cpu) { int new; @@ -343,7 +343,6 @@ int topology_update_package_map(unsigned int pkg, unsigned int cpu) } found: cpu_data(cpu).logical_proc_id = new; - return 0; } /** * topology_update_die_map - Update the physical to logical die map -- 2.18.2