[PATCH] mm/slob: make kmem_cache_boot static

Miaohe Lin posted 1 patch 4 years, 4 months ago
mm/slob.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] mm/slob: make kmem_cache_boot static
Posted by Miaohe Lin 4 years, 4 months ago
kmem_cache_boot is never accessed outside slob.c. Make it static.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 mm/slob.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/slob.c b/mm/slob.c
index 60c5842215f1..1179bcad2df8 100644
--- a/mm/slob.c
+++ b/mm/slob.c
@@ -708,7 +708,7 @@ int __kmem_cache_shrink(struct kmem_cache *d)
 	return 0;
 }
 
-struct kmem_cache kmem_cache_boot = {
+static struct kmem_cache kmem_cache_boot = {
 	.name = "kmem_cache",
 	.size = sizeof(struct kmem_cache),
 	.flags = SLAB_PANIC,
-- 
2.23.0

Re: [PATCH] mm/slob: make kmem_cache_boot static
Posted by Vlastimil Babka 4 years, 4 months ago
On 2/17/22 09:58, Miaohe Lin wrote:
> kmem_cache_boot is never accessed outside slob.c. Make it static.
> 
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>

Thanks, adding to slab tree.

> ---
>  mm/slob.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/slob.c b/mm/slob.c
> index 60c5842215f1..1179bcad2df8 100644
> --- a/mm/slob.c
> +++ b/mm/slob.c
> @@ -708,7 +708,7 @@ int __kmem_cache_shrink(struct kmem_cache *d)
>  	return 0;
>  }
>  
> -struct kmem_cache kmem_cache_boot = {
> +static struct kmem_cache kmem_cache_boot = {
>  	.name = "kmem_cache",
>  	.size = sizeof(struct kmem_cache),
>  	.flags = SLAB_PANIC,

Re: [PATCH] mm/slob: make kmem_cache_boot static
Posted by David Rientjes 4 years, 4 months ago
On Thu, 17 Feb 2022, Miaohe Lin wrote:

> kmem_cache_boot is never accessed outside slob.c. Make it static.
> 
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>

Acked-by: David Rientjes <rientjes@google.com>