Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp487571imm; Fri, 21 Sep 2018 03:40:53 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYVgARmOLm3iKmJrqfjX9stNgVz8EWjIfiVm31AQs7ftpXRE3aBpRjZlDUjk6HY0nEhUqr/ X-Received: by 2002:a17:902:7203:: with SMTP id ba3-v6mr44440527plb.179.1537526453158; Fri, 21 Sep 2018 03:40:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537526453; cv=none; d=google.com; s=arc-20160816; b=ILnXAJEh4x8CkgTdbIZs32KFblVdmvGwcCgM23g0t07hkor4euQdbeMawegf+cHsNB m+Jaz2mvwTVHsk7S6ieulmtvgQ6PYMn1ZGpKvte4gvyGr5ERg3gP2HW6/Y1DRd1cq6De fAdDaBeolMf99Qvzu8b5O19DmgENC+XmP6hqUC22LPJ9r53VMuQlVWaIsx7mO6hL/v2e 49a4nP+T9rc/BO+V6PEPJDa6iw+dOw29TmcIvx2Km3aaeNeGhRjUGpMxwW3K0Z8ZXSxF AgcDFGz7y1hY2HCXuFH9THLX53a4+meObkKNxyccpHLooh3/IpsupVJH1vo1izJKc8Wt Lb4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=ylaLMMLSphRsYDJiHbRzxRKMrbdoNRrjzhYJXQH02iY=; b=rq+4NzITX8sMKO2JSnsHvDan4NjiKa4fAsTQqsW2Fhb3S2YwWurJyPCPQjaV+LOlLh q8X6OZ90H9j/ohf87k6IEsDPEnzkNunCVRM/UQqEKfyAn0u1aMIAEns0q0S9naJ+096F Yb3TVDI+eFCuy8lZUAc+VfKrafXZ/xWBLK2cqch3X+yJmHuikJ/ABjC4HKb02iFsefZh //b+DRFn+GesHfd6ta9iXxvcJwtN0KGwOC64KckXUmDK5LNRwR85EiSch8BoSwHxPNqC S9oMHTPCOwOxaVHrM7YEHepfUdKFNa3XrnMaT3or3Rw6NPoNpcva6m7cqqraoCnWOfpS 85IA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h3-v6si26161317pgc.122.2018.09.21.03.40.37; Fri, 21 Sep 2018 03:40:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389911AbeIUQ2i (ORCPT + 99 others); Fri, 21 Sep 2018 12:28:38 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:44871 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727681AbeIUQ2h (ORCPT ); Fri, 21 Sep 2018 12:28:37 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 1EE93ECBA553E; Fri, 21 Sep 2018 18:40:18 +0800 (CST) Received: from localhost (10.177.31.96) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.399.0; Fri, 21 Sep 2018 18:40:10 +0800 From: YueHaibing To: , , , CC: , , YueHaibing Subject: [PATCH -next] powerpc/pseries/memory-hotplug: Fix return value type of find_aa_index Date: Fri, 21 Sep 2018 18:37:59 +0800 Message-ID: <20180921103759.24976-1-yuehaibing@huawei.com> X-Mailer: git-send-email 2.10.2.windows.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.177.31.96] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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