linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH linux-next] mm/slab_common: Remove the unneeded result variable
@ 2022-08-23  7:52 cgel.zte
  2022-08-23  8:37 ` Hyeonggon Yoo
  2022-08-23 14:04 ` Vlastimil Babka
  0 siblings, 2 replies; 3+ messages in thread
From: cgel.zte @ 2022-08-23  7:52 UTC (permalink / raw)
  To: 42.hyeyoo
  Cc: cl, rientjes, iamjoonsoo.kim, vbabka, roman.gushchin, linux-mm,
	linux-kernel, ye xingchen, Zeal Robot

From: ye xingchen <ye.xingchen@zte.com.cn>

Return the value from __kmem_cache_shrink() directly instead of storing it
 in another redundant variable.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
---
 mm/slab_common.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/mm/slab_common.c b/mm/slab_common.c
index 17996649cfe3..0dfa3cfb6be5 100644
--- a/mm/slab_common.c
+++ b/mm/slab_common.c
@@ -495,13 +495,9 @@ EXPORT_SYMBOL(kmem_cache_destroy);
  */
 int kmem_cache_shrink(struct kmem_cache *cachep)
 {
-	int ret;
-
-
 	kasan_cache_shrink(cachep);
-	ret = __kmem_cache_shrink(cachep);
 
-	return ret;
+	return __kmem_cache_shrink(cachep);
 }
 EXPORT_SYMBOL(kmem_cache_shrink);
 
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH linux-next] mm/slab_common: Remove the unneeded result variable
  2022-08-23  7:52 [PATCH linux-next] mm/slab_common: Remove the unneeded result variable cgel.zte
@ 2022-08-23  8:37 ` Hyeonggon Yoo
  2022-08-23 14:04 ` Vlastimil Babka
  1 sibling, 0 replies; 3+ messages in thread
From: Hyeonggon Yoo @ 2022-08-23  8:37 UTC (permalink / raw)
  To: cgel.zte
  Cc: cl, rientjes, iamjoonsoo.kim, vbabka, roman.gushchin, linux-mm,
	linux-kernel, ye xingchen, Zeal Robot

On Tue, Aug 23, 2022 at 4:52 PM <cgel.zte@gmail.com> wrote:
>
> From: ye xingchen <ye.xingchen@zte.com.cn>
>
> Return the value from __kmem_cache_shrink() directly instead of storing it
>  in another redundant variable.
>
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
> ---
>  mm/slab_common.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/mm/slab_common.c b/mm/slab_common.c
> index 17996649cfe3..0dfa3cfb6be5 100644
> --- a/mm/slab_common.c
> +++ b/mm/slab_common.c
> @@ -495,13 +495,9 @@ EXPORT_SYMBOL(kmem_cache_destroy);
>   */
>  int kmem_cache_shrink(struct kmem_cache *cachep)
>  {
> -       int ret;
> -
> -
>         kasan_cache_shrink(cachep);
> -       ret = __kmem_cache_shrink(cachep);
>
> -       return ret;
> +       return __kmem_cache_shrink(cachep);
>  }
>  EXPORT_SYMBOL(kmem_cache_shrink);
>

Acked-by: Hyeonggon Yoo <42.hyeyoo@gmail.com>

> --
> 2.25.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH linux-next] mm/slab_common: Remove the unneeded result variable
  2022-08-23  7:52 [PATCH linux-next] mm/slab_common: Remove the unneeded result variable cgel.zte
  2022-08-23  8:37 ` Hyeonggon Yoo
@ 2022-08-23 14:04 ` Vlastimil Babka
  1 sibling, 0 replies; 3+ messages in thread
From: Vlastimil Babka @ 2022-08-23 14:04 UTC (permalink / raw)
  To: cgel.zte, 42.hyeyoo
  Cc: cl, rientjes, iamjoonsoo.kim, roman.gushchin, linux-mm,
	linux-kernel, ye xingchen, Zeal Robot

On 8/23/22 09:52, cgel.zte@gmail.com wrote:
> From: ye xingchen <ye.xingchen@zte.com.cn>
> 
> Return the value from __kmem_cache_shrink() directly instead of storing it
>  in another redundant variable.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>

Thanks, added to slab.git for-6.1/trivial

> ---
>  mm/slab_common.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/mm/slab_common.c b/mm/slab_common.c
> index 17996649cfe3..0dfa3cfb6be5 100644
> --- a/mm/slab_common.c
> +++ b/mm/slab_common.c
> @@ -495,13 +495,9 @@ EXPORT_SYMBOL(kmem_cache_destroy);
>   */
>  int kmem_cache_shrink(struct kmem_cache *cachep)
>  {
> -	int ret;
> -
> -
>  	kasan_cache_shrink(cachep);
> -	ret = __kmem_cache_shrink(cachep);
>  
> -	return ret;
> +	return __kmem_cache_shrink(cachep);
>  }
>  EXPORT_SYMBOL(kmem_cache_shrink);
>  


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-08-23 17:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-23  7:52 [PATCH linux-next] mm/slab_common: Remove the unneeded result variable cgel.zte
2022-08-23  8:37 ` Hyeonggon Yoo
2022-08-23 14:04 ` Vlastimil Babka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).