Skip to content

Commit 4c239d5

Browse files
youngjuniakpm00
authored andcommitted
mm: swap: change swap_alloc_slow() to void
swap_alloc_slow() does not need to return a bool, as all callers handle allocation results via the entry parameter. Update the function signature and remove return statements accordingly. Link: https://lkml.kernel.org/r/20251031065011.40863-5-youngjun.park@lge.com Signed-off-by: Youngjun Park <youngjun.park@lge.com> Reviewed-by: Kairui Song <kasong@tencent.com> Reviewed-by: Baoquan He <bhe@redhat.com> Acked-by: Chris Li <chrisl@kernel.org> Cc: Barry Song <baohua@kernel.org> Cc: Kemeng Shi <shikemeng@huaweicloud.com> Cc: Nhat Pham <nphamcs@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent f1bae15 commit 4c239d5

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

mm/swapfile.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1339,7 +1339,7 @@ static bool swap_alloc_fast(swp_entry_t *entry,
13391339
}
13401340

13411341
/* Rotate the device and switch to a new cluster */
1342-
static bool swap_alloc_slow(swp_entry_t *entry,
1342+
static void swap_alloc_slow(swp_entry_t *entry,
13431343
int order)
13441344
{
13451345
unsigned long offset;
@@ -1356,10 +1356,10 @@ static bool swap_alloc_slow(swp_entry_t *entry,
13561356
put_swap_device(si);
13571357
if (offset) {
13581358
*entry = swp_entry(si->type, offset);
1359-
return true;
1359+
return;
13601360
}
13611361
if (order)
1362-
return false;
1362+
return;
13631363
}
13641364

13651365
spin_lock(&swap_avail_lock);
@@ -1378,7 +1378,6 @@ static bool swap_alloc_slow(swp_entry_t *entry,
13781378
goto start_over;
13791379
}
13801380
spin_unlock(&swap_avail_lock);
1381-
return false;
13821381
}
13831382

13841383
/*

0 commit comments

Comments
 (0)