]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
mm/memory-failure: use bool for forcekill state
authorYe Liu <liuye@kylinos.cn>
Fri, 10 Apr 2026 07:47:39 +0000 (15:47 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 29 May 2026 04:04:49 +0000 (21:04 -0700)
'forcekill' is used as a boolean flag to control whether processes should
be forcibly killed.  It is only assigned from boolean expressions and
never used in arithmetic or bitmask operations.

Convert it from int to bool.

No functional change intended.

Link: https://lore.kernel.org/20260410074740.2524718-1-ye.liu@linux.dev
Signed-off-by: Ye Liu <liuye@kylinos.cn>
Reviewed-by: SeongJae Park <sj@kernel.org>
Acked-by: Miaohe Lin <linmiaohe@huawei.com>
Cc: Liu Ye <liuye@kylinos.cn>
Cc: Naoya Horiguchi <nao.horiguchi@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/memory-failure.c

index ee42d43613097f4cb8d58efe0fe13d4f77337b61..62b547c168fca0b28e8361ce921a61e61495af60 100644 (file)
@@ -459,7 +459,7 @@ void add_to_kill_ksm(struct task_struct *tsk, const struct page *p,
  * Only do anything when FORCEKILL is set, otherwise just free the
  * list (this is used for clean pages which do not need killing)
  */
-static void kill_procs(struct list_head *to_kill, int forcekill,
+static void kill_procs(struct list_head *to_kill, bool forcekill,
                unsigned long pfn, int flags)
 {
        struct to_kill *tk, *next;
@@ -1582,7 +1582,7 @@ static bool hwpoison_user_mappings(struct folio *folio, struct page *p,
 {
        LIST_HEAD(tokill);
        bool unmap_success;
-       int forcekill;
+       bool forcekill;
        bool mlocked = folio_test_mlocked(folio);
 
        /*
@@ -1703,7 +1703,7 @@ static void unmap_and_kill(struct list_head *to_kill, unsigned long pfn,
                unmap_mapping_range(mapping, start, size, 0);
        }
 
-       kill_procs(to_kill, flags & MF_MUST_KILL, pfn, flags);
+       kill_procs(to_kill, !!(flags & MF_MUST_KILL), pfn, flags);
 }
 
 /*