Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp435797rdb; Thu, 8 Feb 2024 10:00:06 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUooV/ajgCJEuKr9nH52hjrUuGYYr38odZ1o7eS85VmiriysCp9J0+9S3b9Xfs3F6cu8Nwo4pQsL1prBcU5lL8rUN60vTRBNPL07qrpWA== X-Google-Smtp-Source: AGHT+IFlVGExgiGojtIk+d/4mZe51BzHPHkVRn1at5gN1I/cngjKqM80BtyvGW2yuFnQoQvw2nJ7 X-Received: by 2002:a05:6a21:2d86:b0:19c:a887:e945 with SMTP id ty6-20020a056a212d8600b0019ca887e945mr308865pzb.45.1707415205864; Thu, 08 Feb 2024 10:00:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707415205; cv=pass; d=google.com; s=arc-20160816; b=Pb3v95hJrJ3F6GfMgK3Hvfu26WRHIN+DyyxxRTvPPe/h/LA+vou0vSBBWYvEgN3ras j8zwgur6ePsUt5MuyeV7+2ehY2meQyrZCBkzyEDQTOIofrfM0+lZkhRuKeVVb2f6F7uS L9EnB8p8kTA/N31ihEPk2DfF0vTXLsrjfhFew0CvR96ePN/QNAXudBuB6ffyR8MDUUj8 ybZbCAJ8Ma2azqRpmT9olv/UO3eBp2BD8KG36OQqJ1xr2Kj/swhGJ1ptuAaL+rnkz4Xx +FqW0wXh2/bkyljHxcS9Q31JJtGKv0XWLJhGOwaWSgAZzYJv8426BLJz01+ayDHjdgvp gstQ== 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:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=d1DcgIzE9EZd0ov7YeMV/nM/+bfXtMzjpIPPeF2ftLE=; fh=acQK6O3RWvDLiYRtMl7P7og43+dcXxmdZ2lJoXdZdRI=; b=pZjJSZ7taNjA4v6d83HLjjGVMPhzoBG75r2mBI7h0O+IWb4KI/n3xTrtoaGkGmMhuH 4bMPcIJM84WyZuE8ofYIyV4Iww2/CDSJrS3mR5kTCJh7fh6xe/urLyLV9d3OzI4+0tOJ rbtnhJqtR2CNjr1cfzKYyYQwfQINboHf9zLfMfcuq23nnuBk56Grk36RaieJK/2fO9p4 KfUYPrvEtuzbcHzZPq9lIbKYdv4QIx7Azj2gAExNunxhC13kzOvMme1bN8EvnDYJlSUf qJVoP2k99n+z13u1o7FI/DEI2VVP+9jINHvv2E5fYPdueU39oKukZfgE4XBq1Oc9RrVH S9cw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=oC4tGY5p; arc=pass (i=1 spf=pass spfdomain=wanadoo.fr dkim=pass dkdomain=wanadoo.fr dmarc=pass fromdomain=wanadoo.fr); spf=pass (google.com: domain of linux-kernel+bounces-58501-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58501-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr X-Forwarded-Encrypted: i=2; AJvYcCULF/NarJXtF4g/QXcv3zJy3oYqSqaDLJVkCc365L6isOQjpq2i3iGtDdN48hbduHbspR1NJddfIyZTeWq68iPwJYV2YS+MDCgsvcZ2cg== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id g19-20020a056a0023d300b006de3fd7b370si6693pfc.368.2024.02.08.10.00.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 10:00:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58501-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=oC4tGY5p; arc=pass (i=1 spf=pass spfdomain=wanadoo.fr dkim=pass dkdomain=wanadoo.fr dmarc=pass fromdomain=wanadoo.fr); spf=pass (google.com: domain of linux-kernel+bounces-58501-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58501-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 6957729024C for ; Thu, 8 Feb 2024 17:58:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7ACA384A2D; Thu, 8 Feb 2024 17:58:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="oC4tGY5p" Received: from smtp.smtpout.orange.fr (smtp-17.smtpout.orange.fr [80.12.242.17]) (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 BB897823D6 for ; Thu, 8 Feb 2024 17:58:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.12.242.17 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707415106; cv=none; b=B+Ry+Sih4k3BVy646XMSt3777GzRdNaHkYcRjuUxAteYuDzQcULFGw1NXgl7in5lGU7KnMw72b/mgd2VXb3e/5aaH990sPu/mYNT8wLKntP7Rcn7Q+ZQ4LU0O6P8g7vKsa1YkJoJsWGmTXar1xBC5ZigxnkQdaTOtrPwDVqYj9g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707415106; c=relaxed/simple; bh=th0F13JDFVk5R9A7Ft9dqnzPjRv6bRZMN8DdL8VHn4U=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=q2UPVRiYBzkrRuFQB1CWcNPTj/9tyDsJIHKbZoaQuvoCBGzwfhbJaAYePn/iTwF+f35XTE3xo4FJkp59Lcxz1Nce9FQV/v/23jDnECgN7RR+rVIrdncybh5eBBleSxpKW9GEhWfzwN6HKhhtKD2BxkRtj3qayK84dqyb5WamjwA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=wanadoo.fr; spf=pass smtp.mailfrom=wanadoo.fr; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b=oC4tGY5p; arc=none smtp.client-ip=80.12.242.17 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 Received: from [192.168.1.18] ([92.140.202.140]) by smtp.orange.fr with ESMTPA id Y8eLrzbSOF1QfY8fGrnOpw; Thu, 08 Feb 2024 18:58:23 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1707415103; bh=d1DcgIzE9EZd0ov7YeMV/nM/+bfXtMzjpIPPeF2ftLE=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=oC4tGY5pt6nDFY0SQLr7+vc9+D83mScZtoqzi1hQfUKGfqQiY2lbh5ZOnzq8dcESD gb2wa49Xn57Xc8HZZ4Uzu9bkO9Ox+awOyCPyO0pqqYtPg7P0uxTbBwH7v8lPOWMlAM 7zKbI1CkFA4UulFmGVHGmfNaciq4zg6YsgENCIGiETIaZAesYz4TE9wYFYk9nKdqw5 9p4Hth8Q6rL+uzOJAsyJe9dsZd1lUCgdWsVeE3nYli02ZQYoNUv3iCnhg2nQb8eeE+ MOK0Koh6DstVMIkB2nIhq+9gghNLUd+AqAxQuODBddmLtQyCnUCWfF4GEoH56YASPx Ac9B9uhlrNxFQ== X-ME-Helo: [192.168.1.18] X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Thu, 08 Feb 2024 18:58:23 +0100 X-ME-IP: 92.140.202.140 Message-ID: <89ac2f7b-2a4f-4ce4-ae71-bbe5a5507df2@wanadoo.fr> Date: Thu, 8 Feb 2024 18:58:22 +0100 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] most: Remove usage of the deprecated ida_simple_xx() API Content-Language: en-MW To: Parthiban Veerasooran , Christian Gromm Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org References: <988c218ef3d91bffaf4c3db9b6fba0d369cbb2b2.1702326601.git.christophe.jaillet@wanadoo.fr> From: Christophe JAILLET In-Reply-To: <988c218ef3d91bffaf4c3db9b6fba0d369cbb2b2.1702326601.git.christophe.jaillet@wanadoo.fr> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Le 11/12/2023 à 21:31, Christophe JAILLET a écrit : > 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; > } > Hi, gentle reminder. All patches to remove the ida_simple API have been sent. And Matthew Wilcox seems happy with the on going work. (see [1]) Based on next-20240207 $git grep ida_simple_get | wc -l 38 https://elixir.bootlin.com/linux/v6.8-rc3/A/ident/ida_simple_get 50 https://elixir.bootlin.com/linux/v6.7.4/A/ident/ida_simple_get 81 Thanks CJ [1]: https://lore.kernel.org/all/ZaqruGVz734zjxrZ@casper.infradead.org/