Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1412322rwb; Thu, 10 Nov 2022 16:05:39 -0800 (PST) X-Google-Smtp-Source: AMsMyM5J+IcGpQxN8gUN0E5hm14Z3vLCedjDTlKU+8KXpk2XBuV4X2YvaksTjg5FxFyxfXaany4X X-Received: by 2002:a05:6402:6c6:b0:461:c7bd:7da3 with SMTP id n6-20020a05640206c600b00461c7bd7da3mr3996069edy.218.1668125139667; Thu, 10 Nov 2022 16:05:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668125139; cv=none; d=google.com; s=arc-20160816; b=ID4dimMFF6ADW0Q7xKe4WZqvwSVVS0oU6SeCB9O9jiCuZNTErjkJsyeZZijnMlWI6K CCjYftstuqtGL18CqJ7AtENDnz1mhuMgn7RHlhzJYK8Urj6lkro6KrTyY2/Z87L+4TQn vXCnXr3c4I3npteFnMFPsnoZ94lXeE/bIWOKU+Ycl6K+2Cm6i1QkD1DnFPGg7Wfw8Dc3 2N2VrWIgsRxAxNZCHhKw3cCCXKIGneAwMQR0BRF+LfZ7oaEuQf5g5/0B3ndNHFO5zPLv p5QsC16aoCufGjgdfZJ2bNNsD4CtsjP9ySCV3iZB4PhjHi6kIuV/tmUaJiOjZpB0oDgg 07JQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=uG7bdFaJevSvh/aSZv2JisI1Ydj+vNVvbYY8FhkNxTM=; b=Fa2VRMeUkmnipc7hQ2ggc+BFbuZfXs1hoz8ywEsDP0KzKNXJTYw0vFBK7UUvhbIJBW 0arYLPivGtOnvGMOMnCDNRWkm9FVFVyGzy2c/OFhu0xEXZWQhMqtgaBOVqphnHQvdf6A c/QnGU361XiFPHHaXauZSv/P+ABIdYDPOLZFWPaIhqG4F4r4WztZ6ZpGgXqDgC8mv5sd 1/50s3tIv1i2LD4N1zLzWnY+DzG3qy+zNhcVmgG/ts2tSMQycCM0LKMdmh5R6uN3FeXQ vEawdijWkU3xKSVrTuxg6MVbyNsQDXtMFq0mB1XrZfjPS3mdXtfT8NbmCVUjyylvyp41 P15w== 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:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e17-20020a17090658d100b007a92b00c094si722037ejs.421.2022.11.10.16.05.18; Thu, 10 Nov 2022 16:05:39 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231320AbiKJXRz (ORCPT + 92 others); Thu, 10 Nov 2022 18:17:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229536AbiKJXRy (ORCPT ); Thu, 10 Nov 2022 18:17:54 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 018345F87B; Thu, 10 Nov 2022 15:17:53 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EBF8923A; Thu, 10 Nov 2022 15:17:58 -0800 (PST) Received: from [192.168.122.164] (U203867.austin.arm.com [10.118.30.40]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 14CB53F73D; Thu, 10 Nov 2022 15:17:50 -0800 (PST) Message-ID: <285274e0-51bd-3334-1cb2-3af1b1aa1ba2@arm.com> Date: Thu, 10 Nov 2022 17:17:50 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH 3/5] ACPI: PPTT: Remove acpi_find_cache_levels() Content-Language: en-US To: Pierre Gondois , linux-kernel@vger.kernel.org Cc: Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , "Rafael J. Wysocki" , Len Brown , Sudeep Holla , Greg Kroah-Hartman , Gavin Shan , Peter Chen , Jakub Kicinski , linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, linux-acpi@vger.kernel.org References: <20221108110424.166896-1-pierre.gondois@arm.com> <20221108110424.166896-4-pierre.gondois@arm.com> From: Jeremy Linton In-Reply-To: <20221108110424.166896-4-pierre.gondois@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE 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 On 11/8/22 05:04, Pierre Gondois wrote: > acpi_find_cache_levels() is used at a single place and is short > enough to be merged into the calling function. The removal allows > an easier renaming of the calling function in the next patch. > > Also reorder the parameters in the 'reversed Christmas tree' order. > > Signed-off-by: Pierre Gondois This bit looks fine too: Reviewed-by: Jeremy Linton > --- > drivers/acpi/pptt.c | 21 ++++++--------------- > 1 file changed, 6 insertions(+), 15 deletions(-) > > diff --git a/drivers/acpi/pptt.c b/drivers/acpi/pptt.c > index c91342dcbcd6..97c1d33822d1 100644 > --- a/drivers/acpi/pptt.c > +++ b/drivers/acpi/pptt.c > @@ -281,19 +281,6 @@ static struct acpi_pptt_processor *acpi_find_processor_node(struct acpi_table_he > return NULL; > } > > -static int acpi_find_cache_levels(struct acpi_table_header *table_hdr, > - u32 acpi_cpu_id) > -{ > - int number_of_levels = 0; > - struct acpi_pptt_processor *cpu; > - > - cpu = acpi_find_processor_node(table_hdr, acpi_cpu_id); > - if (cpu) > - number_of_levels = acpi_count_levels(table_hdr, cpu); > - > - return number_of_levels; > -} > - > static u8 acpi_cache_type(enum cache_type type) > { > switch (type) { > @@ -613,9 +600,10 @@ static int check_acpi_cpu_flag(unsigned int cpu, int rev, u32 flag) > */ > int acpi_find_last_cache_level(unsigned int cpu) > { > - u32 acpi_cpu_id; > + struct acpi_pptt_processor *cpu_node; > struct acpi_table_header *table; > int number_of_levels = 0; > + u32 acpi_cpu_id; > > table = acpi_get_pptt(); > if (!table) > @@ -624,7 +612,10 @@ int acpi_find_last_cache_level(unsigned int cpu) > pr_debug("Cache Setup find last level CPU=%d\n", cpu); > > acpi_cpu_id = get_acpi_id_for_cpu(cpu); > - number_of_levels = acpi_find_cache_levels(table, acpi_cpu_id); > + cpu_node = acpi_find_processor_node(table, acpi_cpu_id); > + if (cpu_node) > + number_of_levels = acpi_count_levels(table, cpu_node); > + > pr_debug("Cache Setup find last level level=%d\n", number_of_levels); > > return number_of_levels;