From patchwork Wed Nov 1 09:36:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 160490 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:abcd:0:b0:403:3b70:6f57 with SMTP id f13csp288888vqx; Wed, 1 Nov 2023 02:36:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHq3ogL4HpaFLBbVLVYKN1iSHcbQCJcc/g9DnLjZMWPdpKVfiRVlthatQ+A5gNuNsLGILZp X-Received: by 2002:a05:6830:1054:b0:6bd:b10:c321 with SMTP id b20-20020a056830105400b006bd0b10c321mr15846685otp.10.1698831391656; Wed, 01 Nov 2023 02:36:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698831391; cv=none; d=google.com; s=arc-20160816; b=XVJZ4lPe43EIU7VFqwcCL/IIz0EPpw1uPPXGvzdf5ZKOhwF1VM9JPJ+X1EG0rAoI5D tWhIRVpghXm2FMRR5boBNGwUQnkEfh673CP3JE01e7We0KhxXYCzANOrIIf8ufwpVaJw vVDtamUdhh74XALZxbvfavuV9hJYwhhkvbeIb0lR4PPlujiqNWp64qMW7zG1gx6ebKLt L+ryhjbAwAMykRsWZaMy78K9xhgs5dd6X94UihFmnjIUwiGvgIMaGjQyx/9qOJnHjnbj sivjtZ2YMg6a3aFHe2UGhQukBRU87gLgXDBdidoLlzWg6ngl4X25Nrd/+gfEU5zrC4sd wL3A== 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=NZ1iobFX10Nh/HKZlug5CXulRdixpZgCPip/7q+e51k=; fh=2n4bYWPhAs8kRhSFxfziAVhF/NgrvrESSG8iMkp1hSI=; b=HMTEEt8WLEi7RM2WjaqIoSCMy+dDvS17Nni1+TdJiZwk+4J/M84nQknEs2btdHJ4ub SFOwEZhQEQgEteRaByM1wJhCE+vmteGVfeEMMzpTMeAcRbKOhZEx0q+iSWj3hXQ+FZ+v tlZmIXK6jecst4kJFbAXi2jAiK5R6ZOUm8y5jyprAnS89N9YUK/kGejXnXnrBo1V00zh AFYL6cTbMHz5wFM48AaPd1IaT2nvb4R2GPiij0bShzrX9uT2Rlv7/b8phCHgWXvEnKP8 0vxp//3OVzvf5CVv0jHoEpWZIhBiPZWt5hSVHCqOdLYlKk1QGpYsNHnF7ZEE7NhB8ls6 6uKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=N58b8yS5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id f4-20020aa79d84000000b006c2d616b09bsi1182582pfq.346.2023.11.01.02.36.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 02:36:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=N58b8yS5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id 70FD8807E444; Wed, 1 Nov 2023 02:36:29 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230307AbjKAJgP (ORCPT + 35 others); Wed, 1 Nov 2023 05:36:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230178AbjKAJgN (ORCPT ); Wed, 1 Nov 2023 05:36:13 -0400 Received: from smtp.smtpout.orange.fr (smtp-22.smtpout.orange.fr [80.12.242.22]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7AE66DA for ; Wed, 1 Nov 2023 02:36:10 -0700 (PDT) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id y7dwqR8ijQRiPy7dwqGq2i; Wed, 01 Nov 2023 10:36:09 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1698831369; bh=NZ1iobFX10Nh/HKZlug5CXulRdixpZgCPip/7q+e51k=; h=From:To:Cc:Subject:Date; b=N58b8yS5T9e1AGnVTLHT5D9yQZIbYZvut3OPuh1dhJh5J+OBWVa55fwmOG+JqJyfb soCXr/tgO1by2Ka7A2gYbnjdl+iL/tPmSgTf4rLz4XscCcX2cIZ6LY8FfBjFFxWeHI woXsk7LBCEdRNIs2vWFJSftUAAz+KCF0YWPBnZT6BNyJMaGsykoLWEbV/de5jna5Nk PNzEVgmxODvu3TBSKH1gtwoZ5aArZ1w5+94pok0OXI3pnccDgz0gloII2R+kQJXbh2 GMmTqlqow5kLrJL88qhcQhKxdni7hJzVcgZ1vabT0PEUew6+7D+luXVQm5cDPUXHk1 hegOaO1W8Jofw== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Wed, 01 Nov 2023 10:36:09 +0100 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus , Greg Kroah-Hartman , "Rafael J. Wysocki" Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-acpi@vger.kernel.org Subject: [PATCH] software node: Remove usage of the deprecated ida_simple_xx() API Date: Wed, 1 Nov 2023 10:36:04 +0100 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 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 pete.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 (pete.vger.email [0.0.0.0]); Wed, 01 Nov 2023 02:36:29 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781353825344492430 X-GMAIL-MSGID: 1781353825344492430 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/base/swnode.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/base/swnode.c b/drivers/base/swnode.c index 1886995a0b3a..f7c4317b2ccf 100644 --- a/drivers/base/swnode.c +++ b/drivers/base/swnode.c @@ -747,10 +747,10 @@ static void software_node_release(struct kobject *kobj) struct swnode *swnode = kobj_to_swnode(kobj); if (swnode->parent) { - ida_simple_remove(&swnode->parent->child_ids, swnode->id); + ida_free(&swnode->parent->child_ids, swnode->id); list_del(&swnode->entry); } else { - ida_simple_remove(&swnode_root_ids, swnode->id); + ida_free(&swnode_root_ids, swnode->id); } if (swnode->allocated) @@ -776,8 +776,8 @@ swnode_register(const struct software_node *node, struct swnode *parent, if (!swnode) return ERR_PTR(-ENOMEM); - ret = ida_simple_get(parent ? &parent->child_ids : &swnode_root_ids, - 0, 0, GFP_KERNEL); + ret = ida_alloc(parent ? &parent->child_ids : &swnode_root_ids, + GFP_KERNEL); if (ret < 0) { kfree(swnode); return ERR_PTR(ret);