Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1500313lqp; Mon, 15 Apr 2024 08:12:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXEYHnJBLEhTBc1eKgMGXVE3MCj8RiQmLBjIwBNJCuszLUMTw+vm/pMwi8WcM/sAgEs4tnxxm2Qxgy1O6yFN3BRA9pxJg8ltWwTRAt+Vw== X-Google-Smtp-Source: AGHT+IGM2mzEzq/sR2bhcAEhnm5rwTYqJh4Uyx1zN0QDX7iuJux/fYPwGUeLIKkRIudQL8pj65mQ X-Received: by 2002:a05:6808:2a04:b0:3c5:ee12:44a with SMTP id ez4-20020a0568082a0400b003c5ee12044amr10068394oib.19.1713193938812; Mon, 15 Apr 2024 08:12:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713193938; cv=pass; d=google.com; s=arc-20160816; b=mQSzldSN8cXC1xYZ/mt0t2lnGCIvgRn8PpdvZxnKkCzCbxgnPmH8qVv1+xqCCC6xpK aeJZMDQjHu2/Bllw6I/G0Gz9DXHm8e0vUXDUYjdYJfhTonQTXMF1IoAb/9X8yIvEaHgR gViYJiem/6ET8+dQs8im3iHuFT0xOFntO/M65hOLDA7MD7kgMo6CBKuW0gS4tsXDCjU2 xBVJ4cHCeBvnab+yGgR4JT0abV8JNhmmLoZCqh7cTSDlTVyExDetZpKxEEeRCxeyNS80 4rwibdXtBmixLqE2Db0JKRpLtlK+c8kKg1wVKeT4o5Y0M5tMHnkn6V+AbSMV/d52nqYb qjow== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=SbyGHHxuAPwJJuDThLJ122fp+48lrH6AHuEX5Eg+hI4=; fh=+pWd10vtsOLLNvb8y19ZvQNULrZYP20kKVArhjUuxok=; b=CViTtPyQGHK2IgAL1AzvcVXZ4F3ruPYcQzqBqpNpMzZ4ZN0g7qN4kJ9cFQIGcuAn7S 7mGxgL1Br8Wn6fansmLjaIcGhln1PJZFiBLGbunX9OcjTxCEf+tBVhN+QognDVAgAlVO qB+jvbm7rFTzFD4c1tG/hGeN2D/VvrXT7vHbOR6f+NbnvO9EjxAv3+bSBGTdruoAipR5 3r6ilKKavrN2l5H4rvGili5QMikXt4Mo203bSTfCcEWxIvKR/fV3fApqXQ4ctDBV39KN ikMCLIlmlkLg5SAthTN9gckccUDX+Kr6PMT9z/A9KWquEnT4mvDJV01TJgzxtI30sA68 a8kA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=Nr59BGyj; arc=pass (i=1 spf=pass spfdomain=linux.ibm.com dkim=pass dkdomain=ibm.com dmarc=pass fromdomain=linux.ibm.com); spf=pass (google.com: domain of linux-kernel+bounces-145432-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145432-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id r25-20020ab04699000000b007e5dc3ae66esi1347890uaa.33.2024.04.15.08.12.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 08:12:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-145432-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=Nr59BGyj; arc=pass (i=1 spf=pass spfdomain=linux.ibm.com dkim=pass dkdomain=ibm.com dmarc=pass fromdomain=linux.ibm.com); spf=pass (google.com: domain of linux-kernel+bounces-145432-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145432-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 723CA1C21FE3 for ; Mon, 15 Apr 2024 15:12:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 49DB877F22; Mon, 15 Apr 2024 15:12:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="Nr59BGyj" Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 327247602A; Mon, 15 Apr 2024 15:12:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713193928; cv=none; b=eWPdvWIWviVKQIM8yODBCNUN43XOWmH27UEQD3ra82P40fJwN/Hb6PKSAbGFAAaIHpOpjLYN44eTl3LB7j/xda97QcKkiVqowrW5UHyba7jZM2pPfnvVP08UYRMhKObuzUjK9Xk3pmKgIFd6Ow0GD47nsXbY7cyoZ4237MT4828= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713193928; c=relaxed/simple; bh=AhVsaeNKLsQfSUwDhIxXZ+4WW601PvLgcTzUQdtxoLM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=e+p0sFDFmFfin8bXe8iNe1C3g8AokJoxUb+Q939GxI3duKUY8UfCXspcRl4Qy+AKrhQkibxpmN8rIRDNjKgLpD9fh7q4nF3rooVRfg97m679bE6AsHHN2HFSkKyrWARVhIUlwsP+XLCPnLNpRT9B3stve64ug7FFIlxdaeH3p30= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=Nr59BGyj; arc=none smtp.client-ip=148.163.156.1 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Received: from pps.filterd (m0360083.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 43FEQUST022136; Mon, 15 Apr 2024 15:11:58 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=SbyGHHxuAPwJJuDThLJ122fp+48lrH6AHuEX5Eg+hI4=; b=Nr59BGyjTTLuEVAphAwrDqYeUDVmW0xhPA1+7bl3HOVsEcnNhCAUjZ8ioDSfcB1/rzM/ MDlR0joHJeLZjfujjufUfUJSXhG2iB553XDkJz6UiePi+V0RL/mL6mx+g3YspWeZAMV0 KQQT1u2sjovf++q9nDapUqduQO98yydO3wjzqgi0ppFqAsm4h8yZqnMJmPYNuEUW6CT1 e+4EweVK8SPmZw+CMcMv21d9TBulDhJgRdhzHb0m78zGp7fHm2JWuKbcd24/CNvAu3Er 0wooeS9EZvv31z6kgv6QFo/xQaKNAqeCyVtLEwiZljexkPZhv4Q8KLtyqxIYRpsc4VNI 0w== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3xgyg98xt1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 15 Apr 2024 15:11:57 +0000 Received: from m0360083.ppops.net (m0360083.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 43FFBuCD002354; Mon, 15 Apr 2024 15:11:56 GMT Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3xgyg98xsy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 15 Apr 2024 15:11:56 +0000 Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 43FC2MTW018206; Mon, 15 Apr 2024 15:11:55 GMT Received: from smtprelay02.dal12v.mail.ibm.com ([172.16.1.4]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 3xg4ct0s52-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 15 Apr 2024 15:11:55 +0000 Received: from smtpav02.dal12v.mail.ibm.com (smtpav02.dal12v.mail.ibm.com [10.241.53.101]) by smtprelay02.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 43FFBrIh43188892 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 15 Apr 2024 15:11:55 GMT Received: from smtpav02.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 937A85806F; Mon, 15 Apr 2024 15:11:51 +0000 (GMT) Received: from smtpav02.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6456A58071; Mon, 15 Apr 2024 15:11:51 +0000 (GMT) Received: from [9.61.157.174] (unknown [9.61.157.174]) by smtpav02.dal12v.mail.ibm.com (Postfix) with ESMTP; Mon, 15 Apr 2024 15:11:51 +0000 (GMT) Message-ID: <57291e66-fb7d-4ef8-985e-7e85866c90bb@linux.ibm.com> Date: Mon, 15 Apr 2024 10:11:51 -0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] fsi: occ: Remove usage of the deprecated ida_simple_xx() API To: Christophe JAILLET , Jeremy Kerr , Joel Stanley , Alistar Popple Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-fsi@lists.ozlabs.org References: <6e17f2145ce2bbc12af6700c8bd56a8a7bdb103d.1705738045.git.christophe.jaillet@wanadoo.fr> <487dcede-4ad3-4987-aff4-937513d2fa14@wanadoo.fr> Content-Language: en-US From: Eddie James In-Reply-To: <487dcede-4ad3-4987-aff4-937513d2fa14@wanadoo.fr> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 32eBqTWE-IKtnEvp4pNLJHojWrIkxwfY X-Proofpoint-GUID: 7h145Z6SmaMlnDyrcZaYbqR5ouEXI3q8 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-04-15_12,2024-04-15_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 priorityscore=1501 lowpriorityscore=0 phishscore=0 suspectscore=0 bulkscore=0 adultscore=0 clxscore=1011 spamscore=0 mlxlogscore=999 impostorscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2404010000 definitions=main-2404150099 On 4/14/24 04:00, Christophe JAILLET wrote: > Le 20/01/2024 à 09:07, Christophe JAILLET a écrit : >> ida_alloc() and ida_free() should be preferred to the deprecated >> ida_simple_get() and ida_simple_remove(). >> >> Note that the upper limit of ida_simple_get() is exclusive, but the >> one of >> ida_alloc_range() is inclusive. So, this upper limit, INT_MAX, should >> have >> been changed to INT_MAX-1. >> >> But, it is likely that the INT_MAX 'idx' is valid that the max value >> passed >> to ida_simple_get() should have been 0. >> >> So, allow this INT_MAX 'idx' value now. Reviewed-by: Eddie James >> >> Signed-off-by: Christophe JAILLET >> --- >> The change related to the INT_MAX value is speculative. >> Review with care. (or I can re-submit with INT_MAX-1, to be safe :)) >> --- > > Hi, > > polite reminder. Thank you! Looks good. > > CJ > > > >>   drivers/fsi/fsi-occ.c | 17 ++++++++--------- >>   1 file changed, 8 insertions(+), 9 deletions(-) >> >> diff --git a/drivers/fsi/fsi-occ.c b/drivers/fsi/fsi-occ.c >> index da35ca9e84a6..f7157c1d77d8 100644 >> --- a/drivers/fsi/fsi-occ.c >> +++ b/drivers/fsi/fsi-occ.c >> @@ -656,17 +656,16 @@ static int occ_probe(struct platform_device *pdev) >>           rc = of_property_read_u32(dev->of_node, "reg", ®); >>           if (!rc) { >>               /* make sure we don't have a duplicate from dts */ >> -            occ->idx = ida_simple_get(&occ_ida, reg, reg + 1, >> -                          GFP_KERNEL); >> +            occ->idx = ida_alloc_range(&occ_ida, reg, reg, >> +                           GFP_KERNEL); >>               if (occ->idx < 0) >> -                occ->idx = ida_simple_get(&occ_ida, 1, INT_MAX, >> -                              GFP_KERNEL); >> +                occ->idx = ida_alloc_min(&occ_ida, 1, >> +                             GFP_KERNEL); >>           } else { >> -            occ->idx = ida_simple_get(&occ_ida, 1, INT_MAX, >> -                          GFP_KERNEL); >> +            occ->idx = ida_alloc_min(&occ_ida, 1, GFP_KERNEL); >>           } >>       } else { >> -        occ->idx = ida_simple_get(&occ_ida, 1, INT_MAX, GFP_KERNEL); >> +        occ->idx = ida_alloc_min(&occ_ida, 1, GFP_KERNEL); >>       } >>         platform_set_drvdata(pdev, occ); >> @@ -680,7 +679,7 @@ static int occ_probe(struct platform_device *pdev) >>       rc = misc_register(&occ->mdev); >>       if (rc) { >>           dev_err(dev, "failed to register miscdevice: %d\n", rc); >> -        ida_simple_remove(&occ_ida, occ->idx); >> +        ida_free(&occ_ida, occ->idx); >>           kvfree(occ->buffer); >>           return rc; >>       } >> @@ -719,7 +718,7 @@ static int occ_remove(struct platform_device *pdev) >>       else >>           device_for_each_child(&pdev->dev, NULL, >> occ_unregister_of_child); >>   -    ida_simple_remove(&occ_ida, occ->idx); >> +    ida_free(&occ_ida, occ->idx); >>         return 0; >>   } >