From: YueHaibing <yuehaibing@huawei.com>
To: <benh@kernel.crashing.org>, <paulus@samba.org>,
<mpe@ellerman.id.au>, <nfont@linux.vnet.ibm.com>
Cc: <linux-kernel@vger.kernel.org>, <linuxppc-dev@lists.ozlabs.org>,
YueHaibing <yuehaibing@huawei.com>
Subject: [PATCH -next] powerpc/pseries/memory-hotplug: Fix return value type of find_aa_index
Date: Fri, 21 Sep 2018 18:37:59 +0800 [thread overview]
Message-ID: <20180921103759.24976-1-yuehaibing@huawei.com> (raw)
find_aa_index will return -1 when dlpar_clone_property fails,
its return value type should be int. Also the caller
update_lmb_associativity_index should use a int variable to
get it,then compared with 0.
Fixes: c05a5a40969e ("powerpc/pseries: Dynamic add entires to associativity lookup array")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
arch/powerpc/platforms/pseries/hotplug-memory.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c
index 9a15d39..6aad17c 100644
--- a/arch/powerpc/platforms/pseries/hotplug-memory.c
+++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
@@ -101,13 +101,12 @@ static struct property *dlpar_clone_property(struct property *prop,
return new_prop;
}
-static u32 find_aa_index(struct device_node *dr_node,
+static int find_aa_index(struct device_node *dr_node,
struct property *ala_prop, const u32 *lmb_assoc)
{
u32 *assoc_arrays;
- u32 aa_index;
int aa_arrays, aa_array_entries, aa_array_sz;
- int i, index;
+ int i, index, aa_index;
/*
* The ibm,associativity-lookup-arrays property is defined to be
@@ -168,7 +167,7 @@ static int update_lmb_associativity_index(struct drmem_lmb *lmb)
struct device_node *parent, *lmb_node, *dr_node;
struct property *ala_prop;
const u32 *lmb_assoc;
- u32 aa_index;
+ int aa_index;
parent = of_find_node_by_path("/");
if (!parent)
--
2.7.0
next reply other threads:[~2018-09-21 10:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-21 10:37 YueHaibing [this message]
2018-09-28 20:25 ` [PATCH -next] powerpc/pseries/memory-hotplug: Fix return value type of find_aa_index Nathan Fontenot
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=20180921103759.24976-1-yuehaibing@huawei.com \
--to=yuehaibing@huawei.com \
--cc=benh@kernel.crashing.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=nfont@linux.vnet.ibm.com \
--cc=paulus@samba.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;
as well as URLs for NNTP newsgroup(s).