From nobody Sat Feb 7 08:43:13 2026 Received: from out-173.mta0.migadu.com (out-173.mta0.migadu.com [91.218.175.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0D8323321B3 for ; Mon, 20 Oct 2025 17:37:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760981840; cv=none; b=pqCpP9J1k7edUIKpszF35rZOBHffcqq96PWBEoLuKY8j/Tl9T5Bfo4WvSyf0m2w1FCgSfXG1tpCI8/C2MmlWXuk+J+jREGQwD9VcBy/hzBbT7xQu+z0i/+trtDWNaqeae6HApyqJhfLAfQf4ue5E9m9DhTso79bQ+Mv9H0G/LXo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760981840; c=relaxed/simple; bh=f73eWFBfugp8MwCgSIQBfxYtokvEoHVFvyG6BdQ0I+k=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=SXUomaINZPLwUzThSs3r6g3odw/rlfYP/cse8ZBfQNrvhpd+uEkRLUODMtwJjkIBCzYWkB8l3h5JqqRkq4RCjwUM7mvdqn9G+MuRdEziadCO4Xkk0b3tanhxTjIHNzQHys72Yp5ZXZhQGX3U+anhpaLqPSIDwb4YxH2Nxb1dd2k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=Pw/SZog7; arc=none smtp.client-ip=91.218.175.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="Pw/SZog7" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1760981836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SCY5kU8EpU3MVckMObVG4N1+y1R9/TAdWq4ZwVcGpOQ=; b=Pw/SZog7hYOdybJ7k1aSlebCWTWzK21ik7PnlFzMjlHL6xuMFKLNo7z1GDSVakx+kymp2v ZYac/+ZIcsSNTHSRaE92Oxd99KaKlDXwNRxdEvBnwu67WPWs5l3A/GQevWZmFeVHDMyAZ4 V9xRnbcwo1zZLbrs7czv8AmC3LN1Gnw= From: Wen Yang To: Greg Kroah-Hartman , Jon Hunter Cc: stable@vger.kernel.org, linux-kernel@vger.kernel.org, Pierre Gondois , Jeremy Linton , "Rafael J . Wysocki" , Palmer Dabbelt , Sudeep Holla , Wen Yang Subject: [PATCH 6.1 04/10] ACPI: PPTT: Remove acpi_find_cache_levels() Date: Tue, 21 Oct 2025 01:36:18 +0800 Message-Id: <20251020173624.20228-5-wen.yang@linux.dev> In-Reply-To: <20251020173624.20228-1-wen.yang@linux.dev> References: <20251020173624.20228-1-wen.yang@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" From: Pierre Gondois [ Upstream commit fa4d566a605bc4cf32d69f16ef8cf9696635f75a ] 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 local variables in the 'reversed Christmas tree' order. Signed-off-by: Pierre Gondois Reviewed-by: Jeremy Linton Acked-by: Rafael J. Wysocki Acked-by: Palmer Dabbelt Link: https://lore.kernel.org/r/20230104183033.755668-5-pierre.gondois@arm.= com Signed-off-by: Sudeep Holla Signed-off-by: Wen Yang --- 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 1938e4778725..01aae0f203b0 100644 --- a/drivers/acpi/pptt.c +++ b/drivers/acpi/pptt.c @@ -286,19 +286,6 @@ static struct acpi_pptt_processor *acpi_find_processor= _node(struct acpi_table_he return NULL; } =20 -static int acpi_find_cache_levels(struct acpi_table_header *table_hdr, - u32 acpi_cpu_id) -{ - int number_of_levels =3D 0; - struct acpi_pptt_processor *cpu; - - cpu =3D acpi_find_processor_node(table_hdr, acpi_cpu_id); - if (cpu) - number_of_levels =3D acpi_count_levels(table_hdr, cpu); - - return number_of_levels; -} - static u8 acpi_cache_type(enum cache_type type) { switch (type) { @@ -621,9 +608,10 @@ static int check_acpi_cpu_flag(unsigned int cpu, int r= ev, 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 =3D 0; + u32 acpi_cpu_id; =20 table =3D acpi_get_pptt(); if (!table) @@ -632,7 +620,10 @@ int acpi_find_last_cache_level(unsigned int cpu) pr_debug("Cache Setup find last level CPU=3D%d\n", cpu); =20 acpi_cpu_id =3D get_acpi_id_for_cpu(cpu); - number_of_levels =3D acpi_find_cache_levels(table, acpi_cpu_id); + cpu_node =3D acpi_find_processor_node(table, acpi_cpu_id); + if (cpu_node) + number_of_levels =3D acpi_count_levels(table, cpu_node); + pr_debug("Cache Setup find last level level=3D%d\n", number_of_levels); =20 return number_of_levels; --=20 2.25.1