Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mm/swap_slots.c: remove always zero and unused return value of enable_swap_slots_cache()

enable_swap_slots_cache() always return zero and its return value is just
ignored by the caller. So make enable_swap_slots_cache() void.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Link: https://lkml.kernel.org/r/20200924113554.50614-1-linmiaohe@huawei.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Miaohe Lin and committed by
Linus Torvalds
f3bc52cb a3e7bea0

+2 -3
+1 -1
include/linux/swap_slots.h
··· 23 23 24 24 void disable_swap_slots_cache_lock(void); 25 25 void reenable_swap_slots_cache_unlock(void); 26 - int enable_swap_slots_cache(void); 26 + void enable_swap_slots_cache(void); 27 27 int free_swap_slot(swp_entry_t entry); 28 28 29 29 extern bool swap_slot_cache_enabled;
+1 -2
mm/swap_slots.c
··· 237 237 return 0; 238 238 } 239 239 240 - int enable_swap_slots_cache(void) 240 + void enable_swap_slots_cache(void) 241 241 { 242 242 mutex_lock(&swap_slots_cache_enable_mutex); 243 243 if (!swap_slot_cache_initialized) { ··· 255 255 __reenable_swap_slots_cache(); 256 256 out_unlock: 257 257 mutex_unlock(&swap_slots_cache_enable_mutex); 258 - return 0; 259 258 } 260 259 261 260 /* called with swap slot cache's alloc lock held */