diff mbox series

[2/5] mm, slab_common: Remove unused kmalloc_cache_name()

Message ID 20190903160430.1368-3-lpf.vector@gmail.com (mailing list archive)
State New, archived
Headers show
Series mm, slab: Make kmalloc_info[] contain all types of names | expand

Commit Message

Pengfei Li Sept. 3, 2019, 4:04 p.m. UTC
Since the name of kmalloc can be obtained from kmalloc_info[],
remove the kmalloc_cache_name() that is no longer used.

Signed-off-by: Pengfei Li <lpf.vector@gmail.com>
---
 mm/slab_common.c | 15 ---------------
 1 file changed, 15 deletions(-)

Comments

Vlastimil Babka Sept. 9, 2019, 2:59 p.m. UTC | #1
On 9/3/19 6:04 PM, Pengfei Li wrote:
> Since the name of kmalloc can be obtained from kmalloc_info[],
> remove the kmalloc_cache_name() that is no longer used.

That could simply be part of patch 1/5 really.

> Signed-off-by: Pengfei Li <lpf.vector@gmail.com>

Ack

> ---
>   mm/slab_common.c | 15 ---------------
>   1 file changed, 15 deletions(-)
Pengfei Li Sept. 9, 2019, 4:54 p.m. UTC | #2
On Mon, Sep 9, 2019 at 10:59 PM Vlastimil Babka <vbabka@suse.cz> wrote:
>
> On 9/3/19 6:04 PM, Pengfei Li wrote:
> > Since the name of kmalloc can be obtained from kmalloc_info[],
> > remove the kmalloc_cache_name() that is no longer used.
>
> That could simply be part of patch 1/5 really.
>

Ok, thanks.

> > Signed-off-by: Pengfei Li <lpf.vector@gmail.com>
>
> Ack
>
> > ---
> >   mm/slab_common.c | 15 ---------------
> >   1 file changed, 15 deletions(-)
diff mbox series

Patch

diff --git a/mm/slab_common.c b/mm/slab_common.c
index 7bd88cc09987..002e16673581 100644
--- a/mm/slab_common.c
+++ b/mm/slab_common.c
@@ -1191,21 +1191,6 @@  void __init setup_kmalloc_cache_index_table(void)
 	}
 }
 
-static const char *
-kmalloc_cache_name(const char *prefix, unsigned int size)
-{
-
-	static const char units[3] = "\0kM";
-	int idx = 0;
-
-	while (size >= 1024 && (size % 1024 == 0)) {
-		size /= 1024;
-		idx++;
-	}
-
-	return kasprintf(GFP_NOWAIT, "%s-%u%c", prefix, size, units[idx]);
-}
-
 static void __init
 new_kmalloc_cache(int idx, int type, slab_flags_t flags)
 {