Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp3544109rdb; Sun, 10 Dec 2023 09:50:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IHEzKth281jzcNIeAIXUtrfMqxTmkQEA1SPc8HAAv3EV2G6OSNcyZnFurTP/r36FHzFAhxD X-Received: by 2002:a05:6e02:802:b0:35d:a101:c223 with SMTP id u2-20020a056e02080200b0035da101c223mr3454856ilm.65.1702230621598; Sun, 10 Dec 2023 09:50:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702230621; cv=none; d=google.com; s=arc-20160816; b=ZvgWFNLvTLFyrpaSwCOvcOMZ5oLv5pOcFEG8ZEnagudSqA9wF+IEDc+biTz5IvSXt4 aAVIHUD1UHSMSDUZ80YkUjLAAu8o1ImSiyxqJG63H1sCdkhXWW6nysJRcaBfiCbDx1cj 9YeyfXIG6KBWZtvQnuwbyDLby5o2q7Z0oCKkzssQW2ueXCMM5D5G6XtpcwQrsnHSaF4a 9co0mktG1bpfVIxN5U4zf2u9PSGEKAW6+qPLmgToIubUiLPbUrysE9Wwj3QgVCuOXxZu 3G3TAi+zLg++4uFg9R7zg1sC0QdDQ/BhNVu/Ean8S13xAnWF1E7tggcOECcubLcKy536 7TZw== 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=HzZTGQuA0kr0qzhf9S/gzmjguN57sJaWf26PktWi9U4=; fh=EQErVxvJd4UmOiFM9lhbBF/k2L2vmMYkwlYPdJnL4sM=; b=sUaNbFkIybqfFxltcVy7dwhChb3m2aFlCgTJtKJJdQjJdb5S42yfIOeWKAXsbj3334 Q58C/pp+0A7+QGMjPUfapKSkpZHDoMK/5BdBFmgENeQW3OC+mLUnpF/nVUpaEJSJbrEh sJ97QCduT5tFbzRX2AG+MLXzLP+9s2XogOKvtlCrGiUjuOJYpQXV73HcY7nnzPmTp3TN o7yp6OkmgEBdRYzYl9MhEfp80Tc88JekrO62m2TgoL5KyT4S6qFH0+pOSTM+bIATbvSY 2zDqzzdkjn8Uz1Jcu436DDI8HzlfaVZ5Z3Xj8oB265giu9u79CyMkDeJ6uNj8WA8q17Y fhdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=s2eZNshY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id b18-20020a6567d2000000b005be1b2503ebsi4607556pgs.194.2023.12.10.09.50.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Dec 2023 09:50:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=s2eZNshY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 301DD805A896; Sun, 10 Dec 2023 09:50:19 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231949AbjLJRuH (ORCPT + 99 others); Sun, 10 Dec 2023 12:50:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231916AbjLJRuF (ORCPT ); Sun, 10 Dec 2023 12:50:05 -0500 Received: from smtp.smtpout.orange.fr (smtp-30.smtpout.orange.fr [80.12.242.30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F1AEFD for ; Sun, 10 Dec 2023 09:50:11 -0800 (PST) Received: from pop-os.home ([92.140.202.140]) by smtp.orange.fr with ESMTPA id CNwNr4gNwWblTCNwNrbUKc; Sun, 10 Dec 2023 18:50:10 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1702230610; bh=HzZTGQuA0kr0qzhf9S/gzmjguN57sJaWf26PktWi9U4=; h=From:To:Cc:Subject:Date; b=s2eZNshYTi2b1eXXjtC1TXyhFurVyBUyFnpASCghE6xZzdQkacTO0gSetG+bHAMwD GmbWPPMyGUzSOl98YCRa6qF3nOMDLpgz+TRyWu2SGI8v4UGoMbvAfxR76+62pXOPtM PUvKS7UcyX1kdIUeNMk33quvsuptSz5xrX/YDOyD7apbb6wFtbN8o5faCStcgpj7mX p+P9DxWPO+NGkbJRXHVmWc5DHX3QJrJcBRHzsxDTlPhhd03WlITdC6n4c/UJsxCJF/ pRieHQaY2FJblcUFaY+2gjI3twk9LYvFJRcVs8tvVa6lNPfrQJt/IoulMAxIZkKnDY NG84iK8KS0gaQ== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 10 Dec 2023 18:50:10 +0100 X-ME-IP: 92.140.202.140 From: Christophe JAILLET To: Nirmal Patel , Jonathan Derrick , Lorenzo Pieralisi , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-pci@vger.kernel.org Subject: [PATCH] PCI: vmd: Remove usage of the deprecated ida_simple_xx() API Date: Sun, 10 Dec 2023 18:50:03 +0100 Message-Id: <270f25cdc154f3b0309e57b2f6421776752e2170.1702230593.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 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]); Sun, 10 Dec 2023 09:50:19 -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/pci/controller/vmd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c index 94ba61fe1c44..00a4264711f1 100644 --- a/drivers/pci/controller/vmd.c +++ b/drivers/pci/controller/vmd.c @@ -984,7 +984,7 @@ static int vmd_probe(struct pci_dev *dev, const struct pci_device_id *id) return -ENOMEM; vmd->dev = dev; - vmd->instance = ida_simple_get(&vmd_instance_ida, 0, 0, GFP_KERNEL); + vmd->instance = ida_alloc(&vmd_instance_ida, GFP_KERNEL); if (vmd->instance < 0) return vmd->instance; @@ -1026,7 +1026,7 @@ static int vmd_probe(struct pci_dev *dev, const struct pci_device_id *id) return 0; out_release_instance: - ida_simple_remove(&vmd_instance_ida, vmd->instance); + ida_free(&vmd_instance_ida, vmd->instance); return err; } @@ -1048,7 +1048,7 @@ static void vmd_remove(struct pci_dev *dev) vmd_cleanup_srcu(vmd); vmd_detach_resources(vmd); vmd_remove_irq_domain(vmd); - ida_simple_remove(&vmd_instance_ida, vmd->instance); + ida_free(&vmd_instance_ida, vmd->instance); } static void vmd_shutdown(struct pci_dev *dev) -- 2.34.1