Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4226756rdb; Mon, 11 Dec 2023 12:31:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IGVnx2IGsAPByP2oHrdA4PAwx3aHA3bO4Nn+I2GCzEgXkOhXHAY5Q4LovHR+BmED3GPJEg3 X-Received: by 2002:a17:902:d503:b0:1d1:d7b2:23f2 with SMTP id b3-20020a170902d50300b001d1d7b223f2mr5759929plg.74.1702326695305; Mon, 11 Dec 2023 12:31:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702326695; cv=none; d=google.com; s=arc-20160816; b=rgSwCNAkRwjVfSH5i9EKAtjiP9rcVMz8vXskcj6UDSqfnjMwH4/IHfvVDBvbOfH+YY s3nys3ac4B7cfAGJlCSvAEqmc7is8o71UztJKAjnMzzBQUmyeNrCR3Cx+nMVxPsd9qSL LjkUuqraPx0jAgd5bNjcaqLcOChOphJJBX5U1/MtAPEGHGXa8sfgrKcsWkyq8YFKm9pY iNq5ckKRv0bYs3NDvCs+KTC5IZSHYzYI6dAqv6mSF/ALieOn+zQTPpQZ5GxLmqe5MmKl sqfejjxCdcvvH6Mvx5S/VFCtU+ZUNkKu6aZK8qQ45n/uYreZJZkCnFV9oT3d+GcLiFoJ R3Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=vHzJfqKnTRuFgSnoz8eTVV5fD+/O2UFMaWIC2xo2TfQ=; fh=fcvt8SgxOq8DFdzsKFLWDwNp6PNz29L4oiNfiyFx8II=; b=Wy258q9VHnpRbKPsRgF7D7RKTwrz4SOYHg2nh0zuIogyQ5dHROOaO0d8+94B8sfRbP +VnySxBal06YsNvD7zuJLQupXxZxTgwKotw9uiiot7ZFhms2YzNexEj16YMxSFm/cAHT eIjtlspvmpE9rjlNvVtBYlKpglaQL3JNoKQ77ZlfDQCara7AsBxhzqWXC25sRGQgMaXY Kzv8QFQtxpwvKfVNsv2URF1OJNm8TvlrqkakX52lQB3h0bCAQUPscroUdvusRAnQwwF0 IQuipBkCPkiVwFsLVLpOOZMJiBcxSY4Bo/z/gOdiYNQPWH+k0qjEsxPQBE/ztjoKyAub vYUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=Sw0GPVKq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id u2-20020a17090282c200b001d0b4540b7esi6479298plz.314.2023.12.11.12.31.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 12:31:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=Sw0GPVKq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 7B2518098FDD; Mon, 11 Dec 2023 12:31:32 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344425AbjLKUbO (ORCPT + 99 others); Mon, 11 Dec 2023 15:31:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229790AbjLKUbN (ORCPT ); Mon, 11 Dec 2023 15:31:13 -0500 Received: from smtp.smtpout.orange.fr (smtp-30.smtpout.orange.fr [80.12.242.30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78F05DC for ; Mon, 11 Dec 2023 12:31:18 -0800 (PST) Received: from pop-os.home ([92.140.202.140]) by smtp.orange.fr with ESMTPA id CmvrrmwWfLeGRCmvsrAVcE; Mon, 11 Dec 2023 21:31:16 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1702326676; bh=vHzJfqKnTRuFgSnoz8eTVV5fD+/O2UFMaWIC2xo2TfQ=; h=From:To:Cc:Subject:Date; b=Sw0GPVKqbVO88d8UJ3tqzuM+f5EH2tF4ykBwRuK8UdGzxG/J5SE3wCajBx7fO7/NH zDi3MGd6pjXxpI9P95iTCvQzf70q1dAHe7EVkApwev9+O7iZCaEjziglo86jNCoGUc xAI8vqsB5NzXDOO3ZT3YS9TODXlKuKeP9rP6mxUqJvONUvhuganZYdPmT9e8mLn61j Ze8jKAU3L2MNSZSUt/I7o0KB+b2DeWIw+E3PFJFgnoUJPEVa75CYAK9BmzqdoLHKkY E/KUdt5GQMld2lMT+h0zU9JQYpblxV+IrzYftqy6cTM8pMWptg1qSckCDVGLi/GUCL qmQ8ICncfktVg== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Mon, 11 Dec 2023 21:31:16 +0100 X-ME-IP: 92.140.202.140 From: Christophe JAILLET To: Parthiban Veerasooran , Christian Gromm Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] most: Remove usage of the deprecated ida_simple_xx() API Date: Mon, 11 Dec 2023 21:31:11 +0100 Message-Id: <988c218ef3d91bffaf4c3db9b6fba0d369cbb2b2.1702326601.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 11 Dec 2023 12:31:32 -0800 (PST) ida_alloc() and ida_free() should be preferred to the deprecated ida_simple_get() and ida_simple_remove(). This is less verbose. Signed-off-by: Christophe JAILLET --- drivers/most/core.c | 10 +++++----- drivers/most/most_cdev.c | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/most/core.c b/drivers/most/core.c index e4412c7d25b0..81d60d4ee8c2 100644 --- a/drivers/most/core.c +++ b/drivers/most/core.c @@ -1286,7 +1286,7 @@ int most_register_interface(struct most_interface *iface) !iface->poison_channel || (iface->num_channels > MAX_CHANNELS)) return -EINVAL; - id = ida_simple_get(&mdev_id, 0, 0, GFP_KERNEL); + id = ida_alloc(&mdev_id, GFP_KERNEL); if (id < 0) { dev_err(iface->dev, "Failed to allocate device ID\n"); return id; @@ -1294,7 +1294,7 @@ int most_register_interface(struct most_interface *iface) iface->p = kzalloc(sizeof(*iface->p), GFP_KERNEL); if (!iface->p) { - ida_simple_remove(&mdev_id, id); + ida_free(&mdev_id, id); return -ENOMEM; } @@ -1308,7 +1308,7 @@ int most_register_interface(struct most_interface *iface) dev_err(iface->dev, "Failed to register interface device\n"); kfree(iface->p); put_device(iface->dev); - ida_simple_remove(&mdev_id, id); + ida_free(&mdev_id, id); return -ENOMEM; } @@ -1366,7 +1366,7 @@ int most_register_interface(struct most_interface *iface) } kfree(iface->p); device_unregister(iface->dev); - ida_simple_remove(&mdev_id, id); + ida_free(&mdev_id, id); return -ENOMEM; } EXPORT_SYMBOL_GPL(most_register_interface); @@ -1397,7 +1397,7 @@ void most_deregister_interface(struct most_interface *iface) device_unregister(&c->dev); } - ida_simple_remove(&mdev_id, iface->p->dev_id); + ida_free(&mdev_id, iface->p->dev_id); kfree(iface->p); device_unregister(iface->dev); } diff --git a/drivers/most/most_cdev.c b/drivers/most/most_cdev.c index 3ed8f461e01e..b9423f82373d 100644 --- a/drivers/most/most_cdev.c +++ b/drivers/most/most_cdev.c @@ -100,7 +100,7 @@ static void destroy_cdev(struct comp_channel *c) static void destroy_channel(struct comp_channel *c) { - ida_simple_remove(&comp.minor_id, MINOR(c->devno)); + ida_free(&comp.minor_id, MINOR(c->devno)); kfifo_free(&c->fifo); kfree(c); } @@ -425,7 +425,7 @@ static int comp_probe(struct most_interface *iface, int channel_id, if (c) return -EEXIST; - current_minor = ida_simple_get(&comp.minor_id, 0, 0, GFP_KERNEL); + current_minor = ida_alloc(&comp.minor_id, GFP_KERNEL); if (current_minor < 0) return current_minor; @@ -472,7 +472,7 @@ static int comp_probe(struct most_interface *iface, int channel_id, err_free_c: kfree(c); err_remove_ida: - ida_simple_remove(&comp.minor_id, current_minor); + ida_free(&comp.minor_id, current_minor); return retval; } -- 2.34.1