Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3945139rdb; Thu, 14 Sep 2023 07:28:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF8G1gs935wGYRJTtYKAREu4wnJvtzl3FYyGhXcLc+2NiUsEcaF+rHpM2nNB4D6eqh+skVc X-Received: by 2002:a05:6a21:a5a2:b0:137:4fd0:e2e6 with SMTP id gd34-20020a056a21a5a200b001374fd0e2e6mr6668242pzc.6.1694701707579; Thu, 14 Sep 2023 07:28:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694701707; cv=none; d=google.com; s=arc-20160816; b=tO7goV9n75Qiuyy6JNP1sfAUuX+qE07MjqDbplnpiTV7Q7ufDEWIkieuxyfDRs29aN HPMalbl4C8bM2GFG7LtegRl/OMcvgTesCesgVEW2Wf6JGb1QkrcigblHh+YPoHOA5J8b ol3s7z9HrOeDMB54PVnG4+JYs6033Jfzny4B+p3/mkRU0pDS1K4Pc3W6MtjHGt1ECO/a /n71FGZmWJmNE6BrQTMpTPQlp4A+bMG7eaAQEqd087r1do405xC31EtG7cJTaqP2NWOa +IzV7ixUHZ4kx4dUZdAJbCdL3bzw/W5+4GdjZHgD/8E3wl4FQRw2yeUYAk5Q08F0cp7A 3ATg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=dX4ZleZXeJ6YezcuByBe+PcI3d6nXTc4iXDUpv12vsU=; fh=oO43h3w0Gnh1/uzgjBLTRg+oe1Gv6aFHPIod5z8aS5s=; b=Gn4nvyr28FQoDDZLVQ+e2bM3AD2hwo4jSbDqDBuhsZbThMT2aDeNpM1MUXm99iD/Rc QpH+lf6wryEh0JNDAOTg4bFz4gPKksCugHl228rmat28CdHCmhQ9WpjnoD+9onOUAykO QEOXHjtvPTVQ4fajoDtql1olOQ9GZda5CsGEL0dYl77fHO8QFGumTLl/NOs2dOlOktUJ u0p5STDZ+JBWIXEPDHIoqgF96CIr5OQQ5GP3eM1jnEiYiJt1ukpf0q90qEItspp1pCh0 34jiCbDw4s0mDLQKabHzp+ai9ynTy5EpyeBJDMljyJlYfl1QZd85cKhy2RMs7Ze0eu7e wLOg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id i17-20020a170902e49100b001bdd1f48f91si1688205ple.564.2023.09.14.07.28.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 07:28:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 7D2A382A54E6; Thu, 14 Sep 2023 07:17:38 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239903AbjINOR3 (ORCPT + 99 others); Thu, 14 Sep 2023 10:17:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239493AbjINOR2 (ORCPT ); Thu, 14 Sep 2023 10:17:28 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA923DD; Thu, 14 Sep 2023 07:17:23 -0700 (PDT) Received: from lhrpeml500005.china.huawei.com (unknown [172.18.147.200]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4RmfRD5nVkz6D8gq; Thu, 14 Sep 2023 22:12:40 +0800 (CST) Received: from localhost (10.202.227.76) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Thu, 14 Sep 2023 15:17:21 +0100 Date: Thu, 14 Sep 2023 15:17:20 +0100 From: Jonathan Cameron To: James Morse CC: , , , , , , , , , Salil Mehta , Russell King , Jean-Philippe Brucker , , Subject: Re: [RFC PATCH v2 20/35] ACPI: Rename acpi_processor_hotadd_init and remove pre-processor guards Message-ID: <20230914151720.00007105@Huawei.com> In-Reply-To: <20230913163823.7880-21-james.morse@arm.com> References: <20230913163823.7880-1-james.morse@arm.com> <20230913163823.7880-21-james.morse@arm.com> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.202.227.76] X-ClientProxiedBy: lhrpeml100002.china.huawei.com (7.191.160.241) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 14 Sep 2023 07:17:38 -0700 (PDT) X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email On Wed, 13 Sep 2023 16:38:08 +0000 James Morse wrote: > acpi_processor_hotadd_init() will make a CPU present by mapping it > based on its hardware id. > > 'hotadd_init' is ambiguous once there are two different behaviours > for cpu hotplug. This is for toggling the _STA present bit. Subsequent > patches will add support for toggling the _STA enabled bit, named > acpi_processor_make_enabled(). > > Rename it acpi_processor_make_present() to make it clear this is > for CPUs that were not previously present. > > Expose the function prototypes it uses to allow the preprocessor > guards to be removed. The IS_ENABLED() check will let the compiler > dead-code elimination pass remove this if it isn't going to be > used. > > Signed-off-by: James Morse > --- > drivers/acpi/acpi_processor.c | 14 +++++--------- > include/linux/acpi.h | 2 -- > 2 files changed, 5 insertions(+), 11 deletions(-) > > diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c > index 75257fae10e7..22a15a614f95 100644 > --- a/drivers/acpi/acpi_processor.c > +++ b/drivers/acpi/acpi_processor.c > @@ -182,13 +182,15 @@ static void __init acpi_pcc_cpufreq_init(void) {} > #endif /* CONFIG_X86 */ > > /* Initialization */ > -#ifdef CONFIG_ACPI_HOTPLUG_PRESENT_CPU > -static int acpi_processor_hotadd_init(struct acpi_processor *pr) > +static int acpi_processor_make_present(struct acpi_processor *pr) > { > unsigned long long sta; > acpi_status status; > int ret; > > + if (!IS_ENABLED(CONFIG_ACPI_HOTPLUG_PRESENT_CPU)) > + return -ENODEV; > + > if (invalid_phys_cpuid(pr->phys_id)) > return -ENODEV; > > @@ -222,12 +224,6 @@ static int acpi_processor_hotadd_init(struct acpi_processor *pr) > cpu_maps_update_done(); > return ret; > } > -#else > -static inline int acpi_processor_hotadd_init(struct acpi_processor *pr) > -{ > - return -ENODEV; > -} > -#endif /* CONFIG_ACPI_HOTPLUG_PRESENT_CPU */ > > static int acpi_processor_get_info(struct acpi_device *device) > { > @@ -335,7 +331,7 @@ static int acpi_processor_get_info(struct acpi_device *device) > * because cpuid <-> apicid mapping is persistent now. > */ > if (invalid_logical_cpuid(pr->id) || !cpu_present(pr->id)) { > - int ret = acpi_processor_hotadd_init(pr); > + int ret = acpi_processor_make_present(pr); > > if (ret) > return ret; > diff --git a/include/linux/acpi.h b/include/linux/acpi.h > index 651dd43976a9..b7ab85857bb7 100644 > --- a/include/linux/acpi.h > +++ b/include/linux/acpi.h > @@ -316,12 +316,10 @@ static inline int acpi_processor_evaluate_cst(acpi_handle handle, u32 cpu, > } > #endif > > -#ifdef CONFIG_ACPI_HOTPLUG_PRESENT_CPU > /* Arch dependent functions for cpu hotplug support */ > int acpi_map_cpu(acpi_handle handle, phys_cpuid_t physid, u32 acpi_id, > int *pcpu); > int acpi_unmap_cpu(int cpu); I've lost track somewhat but I think the definitions of these are still under ifdefs which is messy if nothing else and might cause build issues. > -#endif /* CONFIG_ACPI_HOTPLUG_PRESENT_CPU */ > > #ifdef CONFIG_ACPI_HOTPLUG_IOAPIC > int acpi_get_ioapic_id(acpi_handle handle, u32 gsi_base, u64 *phys_addr);