Message ID | 727714bdfcd69d21e7f2a0c5c7426fcb70439b91.1702228605.git.christophe.jaillet@wanadoo.fr |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp6617128vqy; Sun, 10 Dec 2023 09:17:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IHeM5EK2OEPyLjkXzphKS6hu/96qEGEOUUwvvFkrXQHCfTUYnEP31zz6+rmA/Dojs6/bcci X-Received: by 2002:a92:cd8d:0:b0:35d:7036:bc29 with SMTP id r13-20020a92cd8d000000b0035d7036bc29mr4188276ilb.8.1702228650012; Sun, 10 Dec 2023 09:17:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702228649; cv=none; d=google.com; s=arc-20160816; b=GYj5NeQ/zx4pjonSOlqlGZAp90AzUitup95zs8UjqKKxWSHLfxVE4UQNi47pwE7A89 WnzgjhJsLqnQrAFefhZX89h1TppYcV/QXOocQeRj88Ara9ZnQKY62oLO2W940UQDgTYF WmXYivp8Qq2itN9hZi+rh7fl5So+lK6NNG86a7ZAKgmtJbDcb7LSVSh9hQGUBqKle7s+ 1x1vCl5xZHEAUBr7MTgrtF2fcipbC90s0Lmv7fLGi9riqjESqA6ROWHFOQ/7FFLiigGd x4roGMTBz7Knp6sy7Z5d06MLx4GQr3okN6dm+VWJwagE3NGLF9tfD12ve1vQFf/VoYQW vCug== 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=aurnWtncV7Q1TSEkm/6CYQqUg0/hz67stY/BfmCeZBs=; fh=bcQBqjYLegCslPpv2+sj/djB8RM3sYMYC5FxY/tMopc=; b=K95T29UA9fkxDvn0kGYfgFmKlqEcWxDG+bFq7nrIh0ArhFBm2htGlNEDI7UAAmC5ou bpDIynOoQfbSEgYPck/Z/PCfpNwQYatN0OU6vTU+ZYYUMVN+9madG5MKHQ/pYhgtgUB5 tcw2ncaQ5KDCKFKnkbWQH9IfeO1hl3oA9GZmF8MNkl3BBXC9cMe7Yc+2qRbKSwP3Gbb2 GcIuWY9Qi9eWhgYeCscPY3G2yAH2GNTLNjrUhwX4kZpFeB5JrSKwfuhkHZwgI/YjprNu 1hp3YMqSmRU66KQwtH9cM7IOjLks8xjqGsgG1qjmmuWqyoHSMfOnNpUk84wpLAXF/pUi IJ/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=iySQgHrO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id 11-20020a63154b000000b005bd641c3614si4680231pgv.769.2023.12.10.09.17.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Dec 2023 09:17:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=iySQgHrO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id 733968075DF8; Sun, 10 Dec 2023 09:17:27 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231755AbjLJRRJ (ORCPT <rfc822;rua109.linux@gmail.com> + 99 others); Sun, 10 Dec 2023 12:17:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229550AbjLJRRJ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 10 Dec 2023 12:17:09 -0500 Received: from smtp.smtpout.orange.fr (smtp-23.smtpout.orange.fr [80.12.242.23]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C0D7FA for <linux-kernel@vger.kernel.org>; Sun, 10 Dec 2023 09:17:15 -0800 (PST) Received: from pop-os.home ([92.140.202.140]) by smtp.orange.fr with ESMTPA id CNQWrHujroJwrCNQXrDwLo; Sun, 10 Dec 2023 18:17:13 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1702228633; bh=aurnWtncV7Q1TSEkm/6CYQqUg0/hz67stY/BfmCeZBs=; h=From:To:Cc:Subject:Date; b=iySQgHrOimU8UrWY2H6752ATWXqMQfNcZmXjNkLTNmktMAtyBKNMFhhoMCZ/IJm50 2J8zeKjcPZXftwO4SpFc5sILyaWGXFxUIcpeUMnl9bJG44YlNeCTPm/guO1AEf53kZ f0341g9cxYGLx33XdTVeq+YIPwda8m7yffQZkFOdOfJFJ0anR3trdeekzE9ZNJot1F UYkyHs20FNDT3B+tFeytXAwUYJxfofJr45XJYIAQPfMHqeaHKeikDUS6x+XUV87R8P SA1o++NwCM86wrLtFTRd8Y1y9ieOyu+KVm5ZpIBtxdm+kdu0RDX8KOH5MXuLztKS73 xQrhEwvIxHEeQ== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 10 Dec 2023 18:17:13 +0100 X-ME-IP: 92.140.202.140 From: Christophe JAILLET <christophe.jaillet@wanadoo.fr> To: Peter Rosin <peda@axentia.se> Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET <christophe.jaillet@wanadoo.fr> Subject: [PATCH] mux: Remove usage of the deprecated ida_simple_xx() API Date: Sun, 10 Dec 2023 18:17:10 +0100 Message-Id: <727714bdfcd69d21e7f2a0c5c7426fcb70439b91.1702228605.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 morse.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Sun, 10 Dec 2023 09:17:27 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784916108583824415 X-GMAIL-MSGID: 1784916108583824415 |
Series |
mux: Remove usage of the deprecated ida_simple_xx() API
|
|
Commit Message
Christophe JAILLET
Dec. 10, 2023, 5:17 p.m. UTC
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 <christophe.jaillet@wanadoo.fr>
---
drivers/mux/core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Comments
Le 10/12/2023 à 18:17, 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 <christophe.jaillet@wanadoo.fr> > --- > drivers/mux/core.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/mux/core.c b/drivers/mux/core.c > index 775816112932..78c0022697ec 100644 > --- a/drivers/mux/core.c > +++ b/drivers/mux/core.c > @@ -64,7 +64,7 @@ static void mux_chip_release(struct device *dev) > { > struct mux_chip *mux_chip = to_mux_chip(dev); > > - ida_simple_remove(&mux_ida, mux_chip->id); > + ida_free(&mux_ida, mux_chip->id); > kfree(mux_chip); > } > > @@ -111,7 +111,7 @@ struct mux_chip *mux_chip_alloc(struct device *dev, > mux_chip->dev.of_node = dev->of_node; > dev_set_drvdata(&mux_chip->dev, mux_chip); > > - mux_chip->id = ida_simple_get(&mux_ida, 0, 0, GFP_KERNEL); > + mux_chip->id = ida_alloc(&mux_ida, GFP_KERNEL); > if (mux_chip->id < 0) { > int err = mux_chip->id; > 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/
diff --git a/drivers/mux/core.c b/drivers/mux/core.c index 775816112932..78c0022697ec 100644 --- a/drivers/mux/core.c +++ b/drivers/mux/core.c @@ -64,7 +64,7 @@ static void mux_chip_release(struct device *dev) { struct mux_chip *mux_chip = to_mux_chip(dev); - ida_simple_remove(&mux_ida, mux_chip->id); + ida_free(&mux_ida, mux_chip->id); kfree(mux_chip); } @@ -111,7 +111,7 @@ struct mux_chip *mux_chip_alloc(struct device *dev, mux_chip->dev.of_node = dev->of_node; dev_set_drvdata(&mux_chip->dev, mux_chip); - mux_chip->id = ida_simple_get(&mux_ida, 0, 0, GFP_KERNEL); + mux_chip->id = ida_alloc(&mux_ida, GFP_KERNEL); if (mux_chip->id < 0) { int err = mux_chip->id;