mm/slab_common: Remove the unneeded result variable
authorye xingchen <ye.xingchen@zte.com.cn>
Tue, 23 Aug 2022 07:52:41 +0000 (07:52 +0000)
committerVlastimil Babka <vbabka@suse.cz>
Tue, 23 Aug 2022 14:03:05 +0000 (16:03 +0200)
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>
Acked-by: Hyeonggon Yoo <42.hyeyoo@gmail.com>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
mm/slab_common.c

index 17996649cfe3e9efb174a16c00b5c8c22176067b..0dfa3cfb6be582304b3f50723ee9aedc9a93d4b2 100644 (file)
@@ -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);