Received: by 2002:a05:7412:8d09:b0:fa:4c10:6cad with SMTP id bj9csp66646rdb; Mon, 15 Jan 2024 12:19:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IHgCOCVWOeR+xtGeed+MFqgfGky4eYjwRZ12ujQ28SKL+hRok50fBrwIBk3em7qa79lqKa/ X-Received: by 2002:a17:902:8e88:b0:1d5:6600:3d96 with SMTP id bg8-20020a1709028e8800b001d566003d96mr7322747plb.0.1705349997450; Mon, 15 Jan 2024 12:19:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705349997; cv=none; d=google.com; s=arc-20160816; b=uAnS/9pa7UH50wI8djuXvss+u3a+oiqzH+knDsoww1kkgSSdb14Kc9a6TqaZuFdKgy 78rfmdLKusR+0ss5wJYo79Hvk+fziUTammS37j08gSlXZ5VuOg9p0fKBAvVQ8nBohZ8G 1uJ7Fo8JiK1y0yUfLY/SdcOKKDvdR3HFgAeHkwvWNbZ/PSJyr9leGhBdTYP7R0CQZkiM X6GUhmjESbT6cl3HA3GMfTM+Orm+Mg34hxlmC7C7mrTvIG3JCKsvcIeml+ACFyQ6G6fb dYeH7T5kjwRLFxwm8484PXU7kJAScODoje11NtmjngzOVcf97hS/niJkTBGDUgHafvDz 4nzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=Nd4xsK13KUVRINMeDES9iWKoGtfPahNcjU6sjTGV0U4=; fh=UvIvorCy2UY0O6S4IA9AddpHMPl2crLKG2jvRdkPIkQ=; b=D1qeK+JuqNhxKdNQSfwEchFkk13MM02lENaBM9v0y1GP3BDwDWteRsdryoJ4xW1wKv tyuCimaXYbsh3Xvf2DD/P9NRCBFlB+AZ6wid7ltQ+pB/Mqpp7jg1PoGVf2ni2IzMGMD3 sSikEIB0CdZQe6yoBfwK+hbiKc1Gnxp+CWfxoN50wUUde0PGKkeKDQpJHd18GRf76jTL O2QJXEBzICW6IOTLk1iq6EpWvGGbO9NcLEbB4VgCOZQZ5yxFOD+Se0UOWMc0g+nkkQk6 dp5zlGn+q6yDTYf4/o6dOcuUB2SSgDvxCc8f3M2ONmCb9BhNJiUsR8KTuOb6fiWS+YMI HXSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=rvju9V8n; spf=pass (google.com: domain of linux-kernel+bounces-26472-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26472-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id k32-20020a634b60000000b005cdfdaa0a18si9411928pgl.666.2024.01.15.12.19.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 12:19:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-26472-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=rvju9V8n; spf=pass (google.com: domain of linux-kernel+bounces-26472-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26472-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 8EFEBB21CC6 for ; Mon, 15 Jan 2024 20:19:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 995B6199A3; Mon, 15 Jan 2024 20:19:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="rvju9V8n" Received: from smtp.smtpout.orange.fr (smtp-13.smtpout.orange.fr [80.12.242.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 60B2B18EB0 for ; Mon, 15 Jan 2024 20:19:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wanadoo.fr Received: from fedora.home ([92.140.202.140]) by smtp.orange.fr with ESMTPA id PTQNrgwv8ZHPAPTQNrErBY; Mon, 15 Jan 2024 21:19:12 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1705349952; bh=Nd4xsK13KUVRINMeDES9iWKoGtfPahNcjU6sjTGV0U4=; h=From:To:Cc:Subject:Date; b=rvju9V8nVQQCGIp2vv2cWzL991buAagC5aU7ROOXh64pAksfHuPeD0XCWauy49vzQ fp3B7xbnlcpbJ/9B/i3MnzRiWpmrC3lraAigKZP4cyY2//CsKelSU90LnFGxcoZuHi 9rBv0o+9KgfWfFuhxim4Nls1FBDWlXl3XpnXk77g7fOMwqJ+zx5qmmt8m7P7TBZWwr CfH57WK5vojg4fF+Bp8A6RtuOaKD/apiQc8SdoJZM00Vb3oEGgOnwHPBM3rEUlr6gj nAOCrF8rOYBpRfd+WFf2hoN//f+8R/A4XUumgJlgphbkZ+mm/ItNz1DyFtKGIBe5Ht 5Cckss9s3kYtA== X-ME-Helo: fedora.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Mon, 15 Jan 2024 21:19:12 +0100 X-ME-IP: 92.140.202.140 From: Christophe JAILLET To: Dmitry Torokhov Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-input@vger.kernel.org Subject: [PATCH] Input: Remove usage of the deprecated ida_simple_xx() API Date: Mon, 15 Jan 2024 21:19:04 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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_range() is inclusive. So a -1 has been added when needed. Signed-off-by: Christophe JAILLET --- drivers/input/input.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/input/input.c b/drivers/input/input.c index f71ea4fb173f..de7884a5be39 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -2629,17 +2629,15 @@ int input_get_new_minor(int legacy_base, unsigned int legacy_num, * locking is needed here. */ if (legacy_base >= 0) { - int minor = ida_simple_get(&input_ida, - legacy_base, - legacy_base + legacy_num, - GFP_KERNEL); + int minor = ida_alloc_range(&input_ida, legacy_base, + legacy_base + legacy_num - 1, + GFP_KERNEL); if (minor >= 0 || !allow_dynamic) return minor; } - return ida_simple_get(&input_ida, - INPUT_FIRST_DYNAMIC_DEV, INPUT_MAX_CHAR_DEVICES, - GFP_KERNEL); + return ida_alloc_range(&input_ida, INPUT_FIRST_DYNAMIC_DEV, + INPUT_MAX_CHAR_DEVICES - 1, GFP_KERNEL); } EXPORT_SYMBOL(input_get_new_minor); @@ -2652,7 +2650,7 @@ EXPORT_SYMBOL(input_get_new_minor); */ void input_free_minor(unsigned int minor) { - ida_simple_remove(&input_ida, minor); + ida_free(&input_ida, minor); } EXPORT_SYMBOL(input_free_minor); -- 2.43.0