mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shrikanth Hegde <sshegde@linux.ibm.com>
To: Srikar Dronamraju <srikar@linux.ibm.com>,
	linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
	Madhavan Srinivasan <maddy@linux.ibm.com>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Nicholas Piggin <npiggin@gmail.com>,
	"Christophe Leroy (CS GROUP)" <chleroy@kernel.org>
Cc: skiboot@lists.ozlabs.org, arbab@linux.ibm.com,
	mahesh@linux.ibm.com, Ritesh Harjani <ritesh.list@gmail.com>,
	"Mike Rapoport (Microsoft)" <rppt@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/3] powerpc/numa: Simplify find_primary_domain_index
Date: Fri, 4 Sep 2026 15:35:52 +0530	[thread overview]
Message-ID: <f1d356ae-9f95-4139-903d-5ec1783278ca@linux.ibm.com> (raw)
In-Reply-To: <20260902123458.340456-6-srikar@linux.ibm.com>



On 9/2/26 6:05 PM, Srikar Dronamraju wrote:
> Initialize the return value once and use a single exit path in
> find_primary_domain_index().
> 
> This is a small cleanup that keeps the existing behavior unchanged while
> making the control flow easier to follow.
> 

Reviewed-by: Shrikanth Hegde <sshegde@linux.ibm.com>

> Signed-off-by: Srikar Dronamraju <srikar@linux.ibm.com>
> ---
> Changelog from v1:
> - Handle comments from Christophe Leroy
> 
>   arch/powerpc/mm/numa.c | 7 ++-----
>   1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
> index f4cf3ae036de..c44a80d8fc11 100644
> --- a/arch/powerpc/mm/numa.c
> +++ b/arch/powerpc/mm/numa.c
> @@ -432,7 +432,7 @@ static void __init initialize_form2_numa_distance_lookup_table(void)
>   
>   static int __init find_primary_domain_index(void)
>   {
> -	int index;
> +	int index = -1;
>   	struct device_node *root;
>   
>   	/*
> @@ -502,12 +502,9 @@ static int __init find_primary_domain_index(void)
>   		distance_ref_points_depth = MAX_DISTANCE_REF_POINTS;
>   	}
>   
> -	of_node_put(root);
> -	return index;
> -
>   err:
>   	of_node_put(root);
> -	return -1;
> +	return index;
>   }
>   
>   static void __init get_n_mem_cells(int *n_addr_cells, int *n_size_cells)


  reply	other threads:[~2026-09-04 10:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260902123458.340456-5-srikar@linux.ibm.com>
2026-09-02 12:35 ` Srikar Dronamraju
2026-09-04 10:05   ` Shrikanth Hegde [this message]
2026-09-02 12:35 ` [PATCH v3 2/3] powerpc/numa: Allow cpu_to_coregroup_id without PPC_SPLPAR Srikar Dronamraju
2026-09-04  9:59   ` Shrikanth Hegde
2026-09-04 11:10     ` Srikar Dronamraju
2026-09-02 12:35 ` [PATCH v3 3/3] powerpc/numa: Support coregroup on PowerNV Srikar Dronamraju
2026-09-04 10:04   ` Shrikanth Hegde
2026-09-04 11:34     ` Srikar Dronamraju

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f1d356ae-9f95-4139-903d-5ec1783278ca@linux.ibm.com \
    --to=sshegde@linux.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=arbab@linux.ibm.com \
    --cc=chleroy@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.ibm.com \
    --cc=mahesh@linux.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=npiggin@gmail.com \
    --cc=ritesh.list@gmail.com \
    --cc=rppt@kernel.org \
    --cc=skiboot@lists.ozlabs.org \
    --cc=srikar@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®