From nobody Fri Dec 19 11:18:20 2025 Received: from smtp.smtpout.orange.fr (smtp-27.smtpout.orange.fr [80.12.242.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A162C405CB for ; Tue, 19 Dec 2023 19:34:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="URI7oMNT" Received: from pop-os.home ([92.140.202.140]) by smtp.orange.fr with ESMTPA id FfqmrwJWBO9apFfqmrMy24; Tue, 19 Dec 2023 20:33:59 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1703014439; bh=7M2CUQpwgjxF1irpAVXAbKH37iRCkSgrRaBNR4Uhpg4=; h=From:To:Cc:Subject:Date; b=URI7oMNTP6dtjUHuREZTiAp0OXCfjCKk/WxX8Z/5LWVRXDE6iNQ8sZd5ELg062+Ed X26VgA/780AmEnGx6WzjoWPYTAxGCH7BGp7Vc3liOwUs5ETw5dtP78U1/0uCU0DIKa nQ876NuA0/sNogK10tU83cGBjnfgqdYz2DLPDwKmY82QIZoy3hz4I/1XGDrPMOlzx4 bIL4uyOzTcgX5s+eGsk9gz7c8FDA6zYn9p9E79MPdPzcuACPg0mFHeBVJALAtPX0V+ 9q9CwQCgqCJN0GL82AlnXvnn4N0iOYDPjunx4xtwVP7IDnPTusJvKKh1yxAj+xgBId IGu30uiXGzy4g== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 19 Dec 2023 20:33:59 +0100 X-ME-IP: 92.140.202.140 From: Christophe JAILLET To: Fenghua Yu , Dave Jiang , Vinod Koul Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , dmaengine@vger.kernel.org Subject: [PATCH v2] dmaengine: idxd: Remove usage of the deprecated ida_simple_xx() API Date: Tue, 19 Dec 2023 20:33:50 +0100 Message-Id: X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" ida_alloc() and ida_free() should be preferred to the deprecated ida_simple_get() and ida_simple_remove(). This is less verbose. Note that the upper limit of ida_simple_get() is exclusive, but the one of ida_alloc_range() is inclusive. Sothis change allows one more device. MINORMASK is ((1U << MINORBITS) - 1), so allowing MINORMASK as a maximum va= lue makes sense. It is also consistent with other "ida_.*MINORMASK" and "ida_*MINOR()" usages. Signed-off-by: Christophe JAILLET Acked-by: Lijun Pan Reviewed-by: Fenghua Yu --- Changes v2: - remove note about compile tested only, now tested on hw by Fenghua Yu - fix some wording in the commit description [Fenghua Yu] =20 v1: https://lore.kernel.org/all/a899125f42c12fa782a881d341d147519cbb4a23.17= 02967302.git.christophe.jaillet@wanadoo.fr/ --- drivers/dma/idxd/cdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/dma/idxd/cdev.c b/drivers/dma/idxd/cdev.c index 0423655f5a88..b00926abc69a 100644 --- a/drivers/dma/idxd/cdev.c +++ b/drivers/dma/idxd/cdev.c @@ -165,7 +165,7 @@ static void idxd_cdev_dev_release(struct device *dev) struct idxd_wq *wq =3D idxd_cdev->wq; =20 cdev_ctx =3D &ictx[wq->idxd->data->type]; - ida_simple_remove(&cdev_ctx->minor_ida, idxd_cdev->minor); + ida_free(&cdev_ctx->minor_ida, idxd_cdev->minor); kfree(idxd_cdev); } =20 @@ -463,7 +463,7 @@ int idxd_wq_add_cdev(struct idxd_wq *wq) cdev =3D &idxd_cdev->cdev; dev =3D cdev_dev(idxd_cdev); cdev_ctx =3D &ictx[wq->idxd->data->type]; - minor =3D ida_simple_get(&cdev_ctx->minor_ida, 0, MINORMASK, GFP_KERNEL); + minor =3D ida_alloc_max(&cdev_ctx->minor_ida, MINORMASK, GFP_KERNEL); if (minor < 0) { kfree(idxd_cdev); return minor; --=20 2.34.1