mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>,
	Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH master 12/23] include: linux/slab: retire krealloc
Date: Wed, 24 Apr 2024 08:40:47 +0200	[thread overview]
Message-ID: <20240424064058.3608016-13-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20240424064058.3608016-1-a.fatoum@pengutronix.de>

We have no users of this function in-tree, so it doesn't make sense to
invest the work to make it DMA compatible at the present.

Therefore, let's just remove it.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 include/linux/device.h | 2 --
 include/linux/slab.h   | 5 -----
 lib/kasan/test_kasan.c | 4 ++--
 3 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/include/linux/device.h b/include/linux/device.h
index d892a9cb0ef5..66294910abb3 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -12,13 +12,11 @@
 #define __devm_wrapper(fn, dev, ...) ({ BUG_ON(!dev); fn(__VA_ARGS__); })
 
 #define devm_kmalloc(...)		__devm_wrapper(kmalloc, __VA_ARGS__)
-#define devm_krealloc(...)		__devm_wrapper(krealloc, __VA_ARGS__)
 #define devm_kvasprintf(...)		__devm_wrapper(kvasprintf, __VA_ARGS__)
 #define devm_kasprintf(...)		__devm_wrapper(kasprintf, __VA_ARGS__)
 #define devm_kzalloc(...)		__devm_wrapper(kzalloc, __VA_ARGS__)
 #define devm_kmalloc_array(...)		__devm_wrapper(kmalloc_array, __VA_ARGS__)
 #define devm_kcalloc(...)		__devm_wrapper(kcalloc, __VA_ARGS__)
-#define devm_krealloc_array(...)	__devm_wrapper(krealloc_array, __VA_ARGS__)
 #define devm_kfree(...)			__devm_wrapper(kfree, __VA_ARGS__)
 #define devm_kstrdup(...)		__devm_wrapper(kstrdup, __VA_ARGS__)
 #define devm_kstrdup_const(...)		__devm_wrapper(kstrdup_const, __VA_ARGS__)
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 47b0aec7e3b8..eba3593d758a 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -107,11 +107,6 @@ static inline void *kcalloc(size_t n, size_t size, gfp_t flags)
 	return dma_zalloc(size_mul(n, size));
 }
 
-static inline void *krealloc(void *ptr, size_t size, gfp_t flags)
-{
-	return realloc(ptr, size);
-}
-
 static inline char *kstrdup(const char *str, gfp_t flags)
 {
 	return strdup(str);
diff --git a/lib/kasan/test_kasan.c b/lib/kasan/test_kasan.c
index a74251a6d9ad..bacc02b56e98 100644
--- a/lib/kasan/test_kasan.c
+++ b/lib/kasan/test_kasan.c
@@ -69,7 +69,7 @@ static noinline void malloc_oob_realloc_more(void)
 	size_t size1 = 17;
 	size_t size2 = 19;
 
-	pr_info("out-of-bounds after krealloc more\n");
+	pr_info("out-of-bounds after realloc more\n");
 	ptr1 = malloc(size1);
 	ptr2 = realloc(ptr1, size2);
 	if (!ptr1 || !ptr2) {
@@ -92,7 +92,7 @@ static noinline void malloc_oob_realloc_less(void)
 	size_t size1 = 17;
 	size_t size2 = 15;
 
-	pr_info("out-of-bounds after krealloc less\n");
+	pr_info("out-of-bounds after realloc less\n");
 	ptr1 = malloc(size1);
 	ptr2 = realloc(ptr1, size2);
 	if (!ptr1 || !ptr2) {
-- 
2.39.2




  parent reply	other threads:[~2024-04-24  7:09 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-24  6:40 [PATCH master 00/23] treewide: fix bugs using DMA API Ahmad Fatoum
2024-04-24  6:40 ` [PATCH master 01/23] habv4: use DMA-capable memory for getting event from BootROM Ahmad Fatoum
2024-04-24  6:40 ` [PATCH master 02/23] dma: give inline dma_alloc a single external definition Ahmad Fatoum
2024-04-24  6:40 ` [PATCH master 03/23] dma: add definition for dma_zalloc Ahmad Fatoum
2024-04-24  6:40 ` [PATCH master 04/23] include: linux/kernel.h: factor out alignment macros Ahmad Fatoum
2024-04-24  6:40 ` [PATCH master 05/23] driver: move out struct device definition into its own header Ahmad Fatoum
2024-04-24  6:40 ` [PATCH master 06/23] dma: remove common.h include from asm/dma.h Ahmad Fatoum
2024-04-24  6:40 ` [PATCH master 07/23] RISC-V: dma: fix dma.h inclusion Ahmad Fatoum
2024-04-24  6:40 ` [PATCH master 08/23] sandbox: dma: drop unused driver.h include Ahmad Fatoum
2024-04-24  6:40 ` [PATCH master 09/23] dma: remove linux/kernel.h dependency from dma.h Ahmad Fatoum
2024-04-24  6:40 ` [PATCH master 10/23] include: linux/slab: fix possible overflow in kmalloc_array Ahmad Fatoum
2024-04-24  6:40 ` [PATCH master 11/23] include: linux/slab: use dma_alloc for kmalloc Ahmad Fatoum
2024-04-24  6:40 ` Ahmad Fatoum [this message]
2024-04-24  6:40 ` [PATCH master 13/23] commands: mmc_extcsd: use DMA capable memory where needed Ahmad Fatoum
2024-04-24  6:40 ` [PATCH master 14/23] net: macb: use DMA-capable memory for receive buffer Ahmad Fatoum
2024-04-24  6:40 ` [PATCH master 15/23] firmware: qemu_fw_cfg: use bounce buffer for write Ahmad Fatoum
2024-04-24  6:40 ` [PATCH master 16/23] net: usb: asix: use dma_alloc for buffers in USB control messages Ahmad Fatoum
2024-04-24  6:40 ` [PATCH master 17/23] net: usb: smsc95xx: use DMA memory for usb_control_msg Ahmad Fatoum
2024-04-24  6:40 ` [PATCH master 18/23] usb: hub: use DMA memory in usb_get_port_status Ahmad Fatoum
2024-04-24  6:40 ` [PATCH master 19/23] usb: hub: use DMA-capable memory in usb_hub_configure Ahmad Fatoum
2024-04-24  6:40 ` [PATCH master 20/23] treewide: use new dma_zalloc instead of opencoding Ahmad Fatoum
2024-04-24  6:40 ` [PATCH master 21/23] usb: dwc2: host: fix mismatch between dma_map_single and unmap Ahmad Fatoum
2024-04-24  6:40 ` [PATCH master 22/23] net: bcmgenet: map DMA buffers with dma_map_single Ahmad Fatoum
2024-04-24  6:40 ` [PATCH master 23/23] dma: debug: add alignment check when mapping buffers Ahmad Fatoum
2024-04-25  7:39 ` [PATCH master 00/23] treewide: fix bugs using DMA API Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240424064058.3608016-13-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=enrico.scholz@sigma-chemnitz.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox