Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1176351imm; Fri, 28 Sep 2018 13:25:56 -0700 (PDT) X-Google-Smtp-Source: ACcGV62SowCUWsgnGZqF4v3Om8/iqwWbW/hZT4QAcleX3/xe18JpGbz+pkNXyGQuxVVGHTTuocZq X-Received: by 2002:a63:1224:: with SMTP id h36-v6mr241453pgl.120.1538166356626; Fri, 28 Sep 2018 13:25:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538166356; cv=none; d=google.com; s=arc-20160816; b=DY01jYyPHdZz3TcsktxcBFJuCit8t7tJ2BrXWx1BFhSsxPO7odkjDL+nfgpZblz/sI zs7psEmjldpLjJBfgYNMq9No4uXJ/aAVf9C+eTZKGOJCVCUIR6+6ul5cBf5Sj3SKPBuD L4roKEXDKWzscidnEo32ULnGb/FTlA3cZ8bcBgUyZjhkdM1w/qFBF1tBejIkFh+KN1Zw PBgmcb9w3lQTRMk8TsVkw1c4gB0sYrcSCsJ/7n8dBbsAZgpTR6DnJOTn/CF3vZvob1/L U+BfZgPprnlTxhuErp93LsPEs5Cr5rw/B7ghzpxC/0tuVdNefXJBTggZo6j3/tcogv54 VrVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date:from :references:cc:to:subject; bh=1P2xr8zL39beZNO8/Cak/Yws/KKk29SyjBRunS3NWqs=; b=AJHg09ON/R+ARKT69bQrgoikxU8bwdWsUCiJtFtSM+KuDXRzh7MYEnlzWFO1JfXyAC hCb3i3WyuDytCsllHRGdAR7P0vyovrI54RwQ3gRnYC1VL+Z9CkRfqFPe1q/ptZM7Od7R IM8xA7PxuoQ7+UfOHdafs9F/WGJJLDgIs3j1EfZ0CMD0lmpQSRlZjt0q+BaQ4YxCvsYb pReepGjy3oO5Db+4DAhV3kvxBoKpA6QzIDsl2Ue0YnGwQwT1vZnk4ZoeyO2W8DKt+uWo HZQAWJ5oIITU3mKEJ0FRqNy4dRXHEdqLZUcwerqY5Sb8uUA/NhpvayjQvE0p6ePMytZF xBsA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g15-v6si5362653plq.243.2018.09.28.13.25.41; Fri, 28 Sep 2018 13:25:56 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727080AbeI2Cus (ORCPT + 99 others); Fri, 28 Sep 2018 22:50:48 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:58974 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726789AbeI2Cus (ORCPT ); Fri, 28 Sep 2018 22:50:48 -0400 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w8SKO167080863 for ; Fri, 28 Sep 2018 16:25:24 -0400 Received: from e16.ny.us.ibm.com (e16.ny.us.ibm.com [129.33.205.206]) by mx0a-001b2d01.pphosted.com with ESMTP id 2mss8gcn93-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 28 Sep 2018 16:25:24 -0400 Received: from localhost by e16.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 28 Sep 2018 16:25:23 -0400 Received: from b01cxnp22033.gho.pok.ibm.com (9.57.198.23) by e16.ny.us.ibm.com (146.89.104.203) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 28 Sep 2018 16:25:22 -0400 Received: from b01ledav002.gho.pok.ibm.com (b01ledav002.gho.pok.ibm.com [9.57.199.107]) by b01cxnp22033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w8SKPLNk45875286 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 28 Sep 2018 20:25:21 GMT Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 67744124053; Fri, 28 Sep 2018 17:25:22 -0400 (EDT) Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 84ABF124052; Fri, 28 Sep 2018 17:25:21 -0400 (EDT) Received: from oc6428688403.ibm.com (unknown [9.41.179.188]) by b01ledav002.gho.pok.ibm.com (Postfix) with ESMTPS; Fri, 28 Sep 2018 17:25:21 -0400 (EDT) Subject: Re: [PATCH -next] powerpc/pseries/memory-hotplug: Fix return value type of find_aa_index To: YueHaibing , benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org References: <20180921103759.24976-1-yuehaibing@huawei.com> From: Nathan Fontenot Date: Fri, 28 Sep 2018 15:25:19 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180921103759.24976-1-yuehaibing@huawei.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 18092820-0072-0000-0000-000003AC4AE3 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009787; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000267; SDB=6.01095025; UDB=6.00566095; IPR=6.00875060; MB=3.00023547; MTD=3.00000008; XFM=3.00000015; UTC=2018-09-28 20:25:23 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18092820-0073-0000-0000-000049945160 Message-Id: <8428ad73-f817-5d8b-5472-67b9b33b8626@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-09-28_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=767 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1809280200 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/21/2018 05:37 AM, YueHaibing wrote: > 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. The aa_index that we are handling here is defined as an unsigned value in the PAPR so I'm a little hesitant in changing it to a signed value. Also, changing the aa_index to be signed, we still assign it to the u32 lmb->aa_index. There are some other places where the aa_index is treated as a signed value in finc_aa_index(). Perhaps the better solution is use an rc value to track the validation of finding the aa_index instead of the aa_index value itself. -Nathan > > 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) >