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

mm/swap: remove unneeded return value of free_swap_slot

The return value of free_swap_slot is always 0 and also ignored now.
Remove it to clean up the code.

Link: https://lkml.kernel.org/r/20220509131416.17553-5-linmiaohe@huawei.com
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Oscar Salvador <osalvador@suse.de>
Cc: Alistair Popple <apopple@nvidia.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Naoya Horiguchi <naoya.horiguchi@nec.com>
Cc: NeilBrown <neilb@suse.de>
Cc: Peter Xu <peterx@redhat.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Miaohe Lin and committed by
akpm
bc4a68ad afba72b1

+2 -4
+1 -1
include/linux/swap_slots.h
··· 24 24 void disable_swap_slots_cache_lock(void); 25 25 void reenable_swap_slots_cache_unlock(void); 26 26 void enable_swap_slots_cache(void); 27 - int free_swap_slot(swp_entry_t entry); 27 + void free_swap_slot(swp_entry_t entry); 28 28 29 29 extern bool swap_slot_cache_enabled; 30 30
+1 -3
mm/swap_slots.c
··· 269 269 return cache->nr; 270 270 } 271 271 272 - int free_swap_slot(swp_entry_t entry) 272 + void free_swap_slot(swp_entry_t entry) 273 273 { 274 274 struct swap_slots_cache *cache; 275 275 ··· 297 297 direct_free: 298 298 swapcache_free_entries(&entry, 1); 299 299 } 300 - 301 - return 0; 302 300 } 303 301 304 302 swp_entry_t folio_alloc_swap(struct folio *folio)