zram: change scan_slots to return void

scan_slots_for_writeback() and scan_slots_for_recompress() work in a "best
effort" fashion, if they cannot allocate memory for a new pp-slot
candidate they just return and post-processing selects slots that were
successfully scanned thus far.  scan_slots functions never return errors
and their callers never check the return status, so convert them to return
void.

Link: https://lkml.kernel.org/r/20260317032349.753645-1-senozhatsky@chromium.org
Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Reviewed-by: SeongJae Park <sj@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Minchan Kim <minchan@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
Sergey Senozhatsky 2026-03-17 12:23:19 +09:00 committed by Andrew Morton
commit cba8299330

View file

@ -1196,9 +1196,9 @@ static int parse_mode(char *val, u32 *mode)
return 0;
}
static int scan_slots_for_writeback(struct zram *zram, u32 mode,
unsigned long lo, unsigned long hi,
struct zram_pp_ctl *ctl)
static void scan_slots_for_writeback(struct zram *zram, u32 mode,
unsigned long lo, unsigned long hi,
struct zram_pp_ctl *ctl)
{
u32 index = lo;
@ -1230,8 +1230,6 @@ next:
break;
index++;
}
return 0;
}
static ssize_t writeback_store(struct device *dev,
@ -2368,8 +2366,8 @@ static bool highest_priority_algorithm(struct zram *zram, u32 prio)
return true;
}
static int scan_slots_for_recompress(struct zram *zram, u32 mode, u32 prio,
struct zram_pp_ctl *ctl)
static void scan_slots_for_recompress(struct zram *zram, u32 mode, u32 prio,
struct zram_pp_ctl *ctl)
{
unsigned long nr_pages = zram->disksize >> PAGE_SHIFT;
unsigned long index;
@ -2404,8 +2402,6 @@ next:
if (!ok)
break;
}
return 0;
}
/*