From patchwork Mon Aug 5 10:29:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13753489 Received: from msa.smtpout.orange.fr (out-70.smtpout.orange.fr [193.252.22.70]) (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 9CC1522309 for ; Mon, 5 Aug 2024 10:30:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.252.22.70 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722853803; cv=none; b=t6zC92pybFjMs8FYi5p0bYQ4xF3eq8R4XwRCSkeq/wMbaZo08B3t6t8WpiXfIBqhjjhEe0oy3Ek7pDCy2EsoxDhk7xTV8vJLK74AltADVQXXJ8UPKaWKWxSQsKe9Y2PBmr9eS1Z6EJov4XGvhh94R+KiaYDyMTD4T5N0aW4G6mY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722853803; c=relaxed/simple; bh=/cPONUnalwhAghdVZucg3m5xD23JaHM8N6fr9ohMXew=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Qh6/J8UIqpLcKlUTVl6NedyCwrveaqZ6q1rdnINMwxujmmykEeZZMKfObmj+QQusYfwOPNwely9kcIrrta2xLPA8IbgLqFtNvjnezQ/QNFybfHerrijap/S6rRatkOGGHSCnuMcuYbCcu8YrxnTyhmXJU4yZCXqIHLJ+0A527TU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr; spf=pass smtp.mailfrom=wanadoo.fr; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b=giRnpPpX; arc=none smtp.client-ip=193.252.22.70 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="giRnpPpX" Received: from fedora.home ([90.11.132.44]) by smtp.orange.fr with ESMTPA id auyPsh8Id6NRTauyVsps4D; Mon, 05 Aug 2024 12:29:59 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1722853799; bh=p85YbJjmqld36aUPh9Xr2h0pVcDZA31M4MN1X79ClEQ=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=giRnpPpXwh2AaAu7Si+w1MSbHMhHx7ppsEwgMd529CpB0fOrVyBknY5Wgew8G6Phq lHjkyCyO8Ry9SSEz+RNWUy73OXezBpvu7crDWcAJZyou63jx7Kz7eziz98L/X+7j9V tuJBQWtQs0NzYAhBAXqa5nEpqU3bb9kOMGINcMn2y/Oly8AzqKoW2649u7rYkBdhar S+jwdVlCGuyaxekrarCzjKy+7V8UYgOuhRMMOxJdowv4ZoQs9GhtHD9DqlPgXHcrj8 otdC78bj55LXNQI0a3KJYzBSAoZZTT58GS0w9Dgbs9VfxbzLhN7rcAXaLCp+08vttT 3wDsizw0KSSuw== X-ME-Helo: fedora.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Mon, 05 Aug 2024 12:29:59 +0200 X-ME-IP: 90.11.132.44 From: Christophe JAILLET To: willy@infradead.org, srinivas.kandagatla@linaro.org Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH v2 1/3] idr test suite: Remove usage of the deprecated ida_simple_xx() API Date: Mon, 5 Aug 2024 12:29:47 +0200 Message-ID: <715cff763aa4b2c174cc649750e14e404db6e65b.1722853349.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.45.2 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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()/ida_alloc_max() is inclusive. But because of the ranges used for the tests, there is no need to adjust them. While at it remove some useless {}. Signed-off-by: Christophe JAILLET Acked-by: Matthew Wilcox (Oracle) --- Changes in v2: - This patch was already proposed see [1]. This one also rename the function used for the test: s/ida_simple_get_remove_test/ida_alloc_free_test/. I've kept the A-b tag given at that time. v1: https://lore.kernel.org/all/81f44a41b7ccceb26a802af473f931799445821a.1705683269.git.christophe.jaillet@wanadoo.fr/ --- tools/testing/radix-tree/idr-test.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/tools/testing/radix-tree/idr-test.c b/tools/testing/radix-tree/idr-test.c index 84b8c3c92c79..2f830ff8396c 100644 --- a/tools/testing/radix-tree/idr-test.c +++ b/tools/testing/radix-tree/idr-test.c @@ -499,19 +499,17 @@ void ida_check_random(void) goto repeat; } -void ida_simple_get_remove_test(void) +void ida_alloc_free_test(void) { DEFINE_IDA(ida); unsigned long i; - for (i = 0; i < 10000; i++) { - assert(ida_simple_get(&ida, 0, 20000, GFP_KERNEL) == i); - } - assert(ida_simple_get(&ida, 5, 30, GFP_KERNEL) < 0); + for (i = 0; i < 10000; i++) + assert(ida_alloc_max(&ida, 20000, GFP_KERNEL) == i); + assert(ida_alloc_range(&ida, 5, 30, GFP_KERNEL) < 0); - for (i = 0; i < 10000; i++) { - ida_simple_remove(&ida, i); - } + for (i = 0; i < 10000; i++) + ida_free(&ida, i); assert(ida_is_empty(&ida)); ida_destroy(&ida); @@ -524,7 +522,7 @@ void user_ida_checks(void) ida_check_nomem(); ida_check_conv_user(); ida_check_random(); - ida_simple_get_remove_test(); + ida_alloc_free_test(); radix_tree_cpu_dead(1); } From patchwork Mon Aug 5 10:29:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13753490 Received: from smtp.smtpout.orange.fr (smtp-22.smtpout.orange.fr [80.12.242.22]) (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 AB2E415689B for ; Mon, 5 Aug 2024 10:30:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.12.242.22 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722853805; cv=none; b=YA7tPbEv5PpbdI4B1zI5wmlGXDKw0Sqjvis6LO0MQBjFL6gcC8XjZiMlgwqfWzsTmEnf1XLawDtN4Fxvudx5LZkWnPUG0eo27YIrUussdq1rE5PpabpbaehQNKQ2kVRcvCvW9rHljDFeRQ2NssUhELAlD/iu437nG+KMs/MW9rQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722853805; c=relaxed/simple; bh=JuOl0jwvRacIVVmMz9i/DNsJFghR7Ps+bku/MuxJZjE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YNjpocSRlYifdOVVMkOSbfX8ww9u/HUTDsXKry6HROCXS8kK1D2mvK92eAH3R42I8BD6qckg8R/moff+10jbdR8Sy2ofNwnhnLqhB6PrdRCzdHNWSyTNkeanm7lbPISfUknJ+hQZDxZsfPJxtFLHrayZFJ877y/Ka8Mxx1eC39o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr; spf=pass smtp.mailfrom=wanadoo.fr; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b=MgiUmdKh; arc=none smtp.client-ip=80.12.242.22 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="MgiUmdKh" Received: from fedora.home ([90.11.132.44]) by smtp.orange.fr with ESMTPA id auyPsh8Id6NRTauyYsps7P; Mon, 05 Aug 2024 12:30:02 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1722853802; bh=26AbValjT7Vk4kQ03bbizfA7G7UEuqTMoxXJ/fluyLM=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=MgiUmdKhCqVn+pq6mwgruZpr78Pf5qVebAde0iagP40Tb3DeJV4GToVLMrKetEvag TCao9jW44o+WgdqhEeoYSm8EzPrm8Wu7YYZ5DVKdLrRXSsBMQBe27yLLt4JdifQcsv 7oo4BUMmicd9xi5F+5JCQgM5VvDgJiSfLpCmtQHWUR1ygFCdxqVPHrDSWqRY0aAy3W oxonoC+zybeDAJoyKjoXu+gYpqwQhxMmIVOqy5HSWgNbFLXAq603sXju6Cq/EZeBVl afqQwMZLQX07/9stSc0S28tiF9hQS2zyTBUjAKaXlaLVHdw0WupHgoMBpMfUyYTAE6 wDOKYvwFBd2HA== X-ME-Helo: fedora.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Mon, 05 Aug 2024 12:30:02 +0200 X-ME-IP: 90.11.132.44 From: Christophe JAILLET To: willy@infradead.org, srinivas.kandagatla@linaro.org Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH v2 2/3] ida: Remove the ida_simple_xxx() API Date: Mon, 5 Aug 2024 12:29:48 +0200 Message-ID: <2e9b298991fb8cd47815c917a8fc069b553cea10.1722853349.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.45.2 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 All users of the ida_simple_xxx() have been converted. In Linux 6.11-rc2, the only callers are in tools/testing/. So it is now time to remove the definition of this old and deprecated ida_simple_get() and ida_simple_remove(). Signed-off-by: Christophe JAILLET --- v2: new patch --- include/linux/idr.h | 8 -------- 1 file changed, 8 deletions(-) diff --git a/include/linux/idr.h b/include/linux/idr.h index da5f5fa4a3a6..60216f8fc04c 100644 --- a/include/linux/idr.h +++ b/include/linux/idr.h @@ -316,14 +316,6 @@ static inline void ida_init(struct ida *ida) xa_init_flags(&ida->xa, IDA_INIT_FLAGS); } -/* - * ida_simple_get() and ida_simple_remove() are deprecated. Use - * ida_alloc() and ida_free() instead respectively. - */ -#define ida_simple_get(ida, start, end, gfp) \ - ida_alloc_range(ida, start, (end) - 1, gfp) -#define ida_simple_remove(ida, id) ida_free(ida, id) - static inline bool ida_is_empty(const struct ida *ida) { return xa_empty(&ida->xa); From patchwork Mon Aug 5 10:29:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13753491 Received: from smtp.smtpout.orange.fr (smtp-21.smtpout.orange.fr [80.12.242.21]) (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 8AD15157492 for ; Mon, 5 Aug 2024 10:30:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.12.242.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722853808; cv=none; b=DsC/CKw/wg/xS6h0cxJarLT+G34BKcYaqO5H6ztnS9d9jDWj5EiiyQZEy+6z+3dPMBdU78hbj+EJtIAy3SrhF77zMrcOB5qYKg43A/w7+TShSn/DC/cOSACGETw6d4LEtSVN5+1MmL90pjIwD+Nzxg1ME/gw19ke0cMdXgo1Wfk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722853808; c=relaxed/simple; bh=WM4jDsNl88icLtOhSZc2z02eEcUwms+W5Nt3XUgfBA0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uOmr1kqzavg6eEKPimzP4vdAO4HLgaCEZwch+kXN7l4IyVLGiiDNoSfjBxBQ8Hy4IIMDlS7zhFPB/tp5ecLy0zfQT5lwtF48gsAbSBl9M+CRdsPb0hhAFn/s3DKVebrgHb2xvHHNNddlRcUlfvAT/MTELGlB0yR/7B4XUusrBmg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr; spf=pass smtp.mailfrom=wanadoo.fr; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b=kriIqqh2; arc=none smtp.client-ip=80.12.242.21 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="kriIqqh2" Received: from fedora.home ([90.11.132.44]) by smtp.orange.fr with ESMTPA id auyPsh8Id6NRTauybsps9S; Mon, 05 Aug 2024 12:30:05 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1722853805; bh=SUPvmmO6LqCQ5AJ+3l+Xza8HDESgMwZoQBA6LVUiG6Y=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=kriIqqh2bjejAkv2YmddnEc0Y4ilI3Oz9+o896mHu/UmgG34i37XlCUGmgJBCJKY+ 7Nx1UNUqr3mKPSgDFgAzj0KALd2FGAv9NWF16moXTKyZ24nytpJD1ZZ2yv5rieCf20 BSyRL5QCZ5i1BDZ1wwBc6XITuqwkPKziCioYcsxpHfXffY+cObAvFgYrlche/TVshv kKkgnTILIeJlvPEKTJkuDvXXovt90EOd9WLtU1qAvjgLUCRFfWK5NyPCPJIBdGnk74 d8NYE2cKJhkVFYmDemegMJnJ+AuVEzjhZnFx8m6xs4jgUZ5y2NnPJfJOcRTDTaZrVY owXjzL7fktMkA== X-ME-Helo: fedora.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Mon, 05 Aug 2024 12:30:05 +0200 X-ME-IP: 90.11.132.44 From: Christophe JAILLET To: willy@infradead.org, srinivas.kandagatla@linaro.org Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH v2 3/3] nvmem: Update a comment related to struct nvmem_config Date: Mon, 5 Aug 2024 12:29:49 +0200 Message-ID: <10fd5b4afb1a43f4c4665fe4f362e671a729b37f.1722853349.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.45.2 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Update a comment to match the function used in nvmem_register(). ida_simple_get() was replaced by ida_alloc() in commit 1eb51d6a4fce ("nvmem: switch to simpler IDA interface") Signed-off-by: Christophe JAILLET --- Changes in v2: - No chnages v1: https://lore.kernel.org/all/032b8035bd1f2dcc13ffc781c8348d9fbdf9e3b2.1713606957.git.christophe.jaillet@wanadoo.fr/ --- include/linux/nvmem-provider.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/nvmem-provider.h b/include/linux/nvmem-provider.h index 3ebeaa0ded00..9a5f262d20f5 100644 --- a/include/linux/nvmem-provider.h +++ b/include/linux/nvmem-provider.h @@ -103,7 +103,7 @@ struct nvmem_cell_info { * * Note: A default "nvmem" name will be assigned to the device if * no name is specified in its configuration. In such case "" is - * generated with ida_simple_get() and provided id field is ignored. + * generated with ida_alloc() and provided id field is ignored. * * Note: Specifying name and setting id to -1 implies a unique device * whose name is provided as-is (kept unaltered).