public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Steve Wahl <steve.wahl@hpe.com>
Cc: Dimitri Sivanich <dimitri.sivanich@hpe.com>,
	Russ Anderson <russ.anderson@hpe.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] x86/platform/uv: UV support for sub-NUMA clustering
Date: Wed, 25 Jan 2023 12:28:07 +0100	[thread overview]
Message-ID: <Y9ESRzbzM0e8Kr1M@gmail.com> (raw)
In-Reply-To: <20230123221812.3970769-1-steve.wahl@hpe.com>


* Steve Wahl <steve.wahl@hpe.com> wrote:

> +static int __init alloc_conv_table(int num_elem, unsigned short **table)
> +{
> +	int i;
> +	size_t bytes;
> +
> +	bytes = num_elem * sizeof(*table[0]);
> +	*table = kmalloc(bytes, GFP_KERNEL);
> +	WARN_ON_ONCE(!*table);
> +	if (!*table)
> +		return -ENOMEM;

WARN_ON_ONCE() is pass-through on the condition, so you can write this in a 
shorter form:

	if (!WARN_ON_ONCE(!*table))
		return -ENOMEM;

> +	uv_hub_info_list_blade = kzalloc(bytes, GFP_KERNEL);
> +	WARN_ON_ONCE(!uv_hub_info_list_blade);
> +	if (!uv_hub_info_list_blade)
> +		return;

Ditto.

> +		WARN_ON_ONCE(!new_hub);
> +		if (!new_hub)
> +			return;

Same. Also a memory leak of at least uv_hub_info_list_blade?

> +	WARN_ON_ONCE(!__uv_hub_info_list);
> +	if (!__uv_hub_info_list)
> +		return;

Same.

> +
> +	for_each_node(nodeid) {
> +		__uv_hub_info_list[nodeid] = uv_hub_info_list_blade[uv_node_to_blade_id(nodeid)];
> +	}

Unnecessary curly braces.

Looks good otherwise - presumably it's both tested and backwards compatible 
with older UV hardware?

Thanks,

	Ingo

  reply	other threads:[~2023-01-25 11:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-23 22:18 [PATCH v2] x86/platform/uv: UV support for sub-NUMA clustering Steve Wahl
2023-01-25 11:28 ` Ingo Molnar [this message]
2023-01-25 16:05   ` Steve Wahl

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=Y9ESRzbzM0e8Kr1M@gmail.com \
    --to=mingo@kernel.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=dimitri.sivanich@hpe.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=russ.anderson@hpe.com \
    --cc=steve.wahl@hpe.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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