Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1986851iog; Thu, 16 Jun 2022 19:22:22 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sH8AtmBZrULcfbSFouA8BJS5PrrpFtIyojeh6HpOV0/jybmWdLNJLMKcbIYEDDOu5GneQ0 X-Received: by 2002:a17:90b:1bc7:b0:1e8:317d:6b3b with SMTP id oa7-20020a17090b1bc700b001e8317d6b3bmr8092966pjb.136.1655432542427; Thu, 16 Jun 2022 19:22:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655432542; cv=none; d=google.com; s=arc-20160816; b=Ygot6xIfAxPpCaFLF/Vt+WJ+xT5JDnHL8QIQg3PACGCiYYaHubo8ywH3namLCLVNZQ abRa5gv3TNFJC5TKfGmDFdwDIoWv0dNhxz6bqxY3Mg1+4BnMpgPyLjEstCI3Om1w8K0z jt2rYWvf4gs0QiBwi+Z5ZYGru+knkVGz6IBXj1zVTrCFZl/ucFKs1Y2I4rVj0j5JmrJ8 nPDseVKbgX/79ONkDoF5qzV8O80Awym4FSAFfvDvQV4E2IELWzlI1Oui7kA3qh52QdZQ l6ekTqRBcUGCwFWx0sg0Zv8FVOBMRVzpixZxpVoEJegS1mndNYRf2F65oGoINXlk5YaV VnlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:abuse-reports-to:tuid:mime-version:message-id :date:subject:cc:to:from; bh=Ie5YPSQu0Ct0OJFz6lS9f0YRbs4A96Zw5XIxQFX6Kg0=; b=gTzVXdA7z46wUo0liOdUgzIMfnzZ/ke1gs+0oN3OBqec9yuvJIDSdrGfHdUDKN+9/3 WO2qaQoTSS7+hFRsl4/aSOvua7V0uClFBITWNCZq9zT4G2V/fLGeobIJDLpSbCiNjL7f Qi3ZjwBpSFD/KyBzAXIh/Ofkvc08RIC78GWHdCPmXN/l3HOHZr9hxfzfUb/rEnUrSJHT LZ6Z7chrzclj4WVGXtmWiOzrIbj/GCwfvl4X/JvKKaGrZPR8rceQZ0xFfozRbl8Out2D 43Dpo9GheTVlmqNiwX04963GByMTxxGBQK31ca+GscjqCQ0XgWzoMXW+cOPGXKBtw9oh qQyQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w2-20020a170902e88200b0015eaa9783ddsi5247055plg.532.2022.06.16.19.21.57; Thu, 16 Jun 2022 19:22:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379543AbiFQCGF (ORCPT + 99 others); Thu, 16 Jun 2022 22:06:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230527AbiFQCGE (ORCPT ); Thu, 16 Jun 2022 22:06:04 -0400 Received: from unicom145.biz-email.net (unicom145.biz-email.net [210.51.26.145]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 401DA61633 for ; Thu, 16 Jun 2022 19:06:03 -0700 (PDT) Received: from ([60.208.111.195]) by unicom145.biz-email.net ((D)) with ASMTP (SSL) id LYX00100; Fri, 17 Jun 2022 10:06:00 +0800 Received: from localhost.localdomain (10.200.104.97) by jtjnmail201602.home.langchao.com (10.100.2.2) with Microsoft SMTP Server id 15.1.2308.27; Fri, 17 Jun 2022 10:05:59 +0800 From: Bo Liu To: , CC: , , Bo Liu Subject: [PATCH] iommu: Remove usage of the deprecated ida_simple_xxx API Date: Thu, 16 Jun 2022 22:05:55 -0400 Message-ID: <20220617020555.2361-1-liubo03@inspur.com> X-Mailer: git-send-email 2.18.2 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.200.104.97] tUid: 2022617100600453ddd2e082b575ad03dc12b7589ef45 X-Abuse-Reports-To: service@corp-email.com Abuse-Reports-To: service@corp-email.com X-Complaints-To: service@corp-email.com X-Report-Abuse-To: service@corp-email.com X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use ida_alloc_xxx()/ida_free() instead of ida_simple_get()/ida_simple_remove(). The latter is deprecated and more verbose. Signed-off-by: Bo Liu --- drivers/iommu/iommu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 847ad47a2dfd..cdc86c39954e 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -600,7 +600,7 @@ static void iommu_group_release(struct kobject *kobj) if (group->iommu_data_release) group->iommu_data_release(group->iommu_data); - ida_simple_remove(&iommu_group_ida, group->id); + ida_free(&iommu_group_ida, group->id); if (group->default_domain) iommu_domain_free(group->default_domain); @@ -641,7 +641,7 @@ struct iommu_group *iommu_group_alloc(void) INIT_LIST_HEAD(&group->devices); INIT_LIST_HEAD(&group->entry); - ret = ida_simple_get(&iommu_group_ida, 0, 0, GFP_KERNEL); + ret = ida_alloc(&iommu_group_ida, GFP_KERNEL); if (ret < 0) { kfree(group); return ERR_PTR(ret); @@ -651,7 +651,7 @@ struct iommu_group *iommu_group_alloc(void) ret = kobject_init_and_add(&group->kobj, &iommu_group_ktype, NULL, "%d", group->id); if (ret) { - ida_simple_remove(&iommu_group_ida, group->id); + ida_free(&iommu_group_ida, group->id); kobject_put(&group->kobj); return ERR_PTR(ret); } -- 2.27.0