From nobody Tue Apr 28 23:22:39 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A3BA2C433F5 for ; Fri, 27 May 2022 07:06:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229509AbiE0HGi (ORCPT ); Fri, 27 May 2022 03:06:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345130AbiE0HGU (ORCPT ); Fri, 27 May 2022 03:06:20 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95BBE242 for ; Fri, 27 May 2022 00:06:17 -0700 (PDT) Received: from dggpemm500021.china.huawei.com (unknown [172.30.72.56]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4L8bSK47sXzDqJk; Fri, 27 May 2022 15:06:09 +0800 (CST) Received: from dggpemm500018.china.huawei.com (7.185.36.111) by dggpemm500021.china.huawei.com (7.185.36.109) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 27 May 2022 15:06:15 +0800 Received: from localhost.localdomain (10.175.112.125) by dggpemm500018.china.huawei.com (7.185.36.111) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 27 May 2022 15:06:15 +0800 From: keliu To: , CC: keliu Subject: [PATCH] intel_th: Directly use ida_alloc()/free() Date: Fri, 27 May 2022 07:27:43 +0000 Message-ID: <20220527072743.2383355-1-liuke94@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm500018.china.huawei.com (7.185.36.111) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Use ida_alloc()/ida_free() instead of deprecated ida_simple_get()/ida_simple_remove() . Signed-off-by: keliu --- drivers/hwtracing/intel_th/core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/hwtracing/intel_th/core.c b/drivers/hwtracing/intel_th= /core.c index 7e753a75d23b..7393cc0c64ac 100644 --- a/drivers/hwtracing/intel_th/core.c +++ b/drivers/hwtracing/intel_th/core.c @@ -871,7 +871,7 @@ intel_th_alloc(struct device *dev, const struct intel_t= h_drvdata *drvdata, if (!th) return ERR_PTR(-ENOMEM); =20 - th->id =3D ida_simple_get(&intel_th_ida, 0, 0, GFP_KERNEL); + th->id =3D ida_alloc(&intel_th_ida, GFP_KERNEL); if (th->id < 0) { err =3D th->id; goto err_alloc; @@ -931,7 +931,7 @@ intel_th_alloc(struct device *dev, const struct intel_t= h_drvdata *drvdata, "intel_th/output"); =20 err_ida: - ida_simple_remove(&intel_th_ida, th->id); + ida_free(&intel_th_ida, th->id); =20 err_alloc: kfree(th); @@ -964,7 +964,7 @@ void intel_th_free(struct intel_th *th) __unregister_chrdev(th->major, 0, TH_POSSIBLE_OUTPUTS, "intel_th/output"); =20 - ida_simple_remove(&intel_th_ida, th->id); + ida_free(&intel_th_ida, th->id); =20 kfree(th); } --=20 2.25.1