From patchwork Sun Jan 14 08:52:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13519124 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 80764C47077 for ; Sun, 14 Jan 2024 08:56:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=6EXWt9gLrWn7nt8lM4vmW7s3E0s1p4aa0/7u8VZK/CI=; b=yQSRhDu3rc9jpb lvr1kxP8qTylGrtZ4O8ebGQVsY3Osfz2Yi6vQ9XzbRgSUGWAy577+ZvRmXi6LRERbrclQCV+Syp6R GGLoeWOHaN57qD2L5N87S/pIZ+onr2uQXFTkHsjv1kHmir0tc+z7xGKJjjqzMoM/uQhuzU6DPuWU3 CQOcbHeiCZjeOwSdmmiOR4o4PunerkVl9ehhrOz/ykMoYa11RdCTgRCLtw2wz3weB7bonXQNVjf4O HICUYsXuZ7TZ2JFIZUlPr05F7ItF0ygIL7TZvvIUmdARB/rBehOP1sKs8DEkzjr5x6RJYMTz3+F3l jywlhIB3mq+Hw4PC3Mfw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rOwEo-006Lie-0b; Sun, 14 Jan 2024 08:53:02 +0000 Received: from smtp-24.smtpout.orange.fr ([80.12.242.24] helo=smtp.smtpout.orange.fr) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rOwEk-006LhW-1e for linux-arm-kernel@lists.infradead.org; Sun, 14 Jan 2024 08:53:01 +0000 Received: from fedora.home ([92.140.202.140]) by smtp.orange.fr with ESMTPA id OwEZrP7Of2jhsOwEZrsM9R; Sun, 14 Jan 2024 09:52:50 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1705222370; bh=yi38xR3jxyaNMmKPbq/ZSFZvYl79v0C2NPnhX4g7YBk=; h=From:To:Cc:Subject:Date; b=ssbkoVS1ZRNE8a3dVGCLxULy25MBTpxwBy07CDmMkeKUxMU4lGqdjnsGZr95CpCOQ Zp6BVWDeOOuVPT4gbzC0Aod4Kt99bTRE8SOIobJrnxvbRMtdKEgKtOCLGHLjhbQE4m XEOmGfFj/PK45n0AIdJA7QK9JWt8lmdxsVfbJmqLIeOny3zk8aryQgS6ACNU6iz+TG K7jvZPXs5QqUEBuyZ5jNF0PD0rN2eTgDLwcegwa4WcB7atXIn578kqYaU+2kxw5EtV 4D38/TyQv5dZ+lLlKgQHMmAwNmfKzjQ+V/k8dMnA6j+mExZcJWVv5DSe7Bo+kISc1N akRsy7qslzeng== X-ME-Helo: fedora.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 14 Jan 2024 09:52:50 +0100 X-ME-IP: 92.140.202.140 From: Christophe JAILLET To: Marc Zyngier , Thomas Gleixner Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-arm-kernel@lists.infradead.org Subject: [PATCH] irqchip/gic-v3-its: Remove usage of the deprecated ida_simple_xx() API Date: Sun, 14 Jan 2024 09:52:39 +0100 Message-ID: <3b472b0e7edf6e483b8b255cf8d1cb0163532adf.1705222332.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240114_005259_149571_206D9743 X-CRM114-Status: GOOD ( 11.31 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org ida_alloc() and ida_free() should be preferred to the deprecated ida_simple_get() and ida_simple_remove(). Note that the upper limit of ida_simple_get() is exclusive, but the one of ida_alloc_max() is inclusive. So a -1 has been added when needed. Signed-off-by: Christophe JAILLET Acked-by: Marc Zyngier --- drivers/irqchip/irq-gic-v3-its.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index d097001c1e3e..cd950f435cf0 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -4419,12 +4419,12 @@ static const struct irq_domain_ops its_sgi_domain_ops = { static int its_vpe_id_alloc(void) { - return ida_simple_get(&its_vpeid_ida, 0, ITS_MAX_VPEID, GFP_KERNEL); + return ida_alloc_max(&its_vpeid_ida, ITS_MAX_VPEID - 1, GFP_KERNEL); } static void its_vpe_id_free(u16 id) { - ida_simple_remove(&its_vpeid_ida, id); + ida_free(&its_vpeid_ida, id); } static int its_vpe_init(struct its_vpe *vpe)