mm: remove arguments of show_mem()
authorKefeng Wang <wangkefeng.wang@huawei.com>
Fri, 30 Jun 2023 06:22:52 +0000 (14:22 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 18 Aug 2023 17:12:02 +0000 (10:12 -0700)
All callers of show_mem() pass 0 and NULL, so we can remove the two
arguments by directly calling __show_mem(0, NULL, MAX_NR_ZONES - 1) in
show_mem().

Link: https://lkml.kernel.org/r/20230630062253.189440-1-wangkefeng.wang@huawei.com
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/powerpc/xmon/xmon.c
drivers/tty/sysrq.c
drivers/tty/vt/keyboard.c
include/linux/mm.h
init/initramfs.c
kernel/panic.c

index fae747cc57d2dd8af03768cae8df506f75286639..ee17270d35d0e4fbb042f762b0530c5f1d0cc249 100644 (file)
@@ -1084,7 +1084,7 @@ cmds(struct pt_regs *excp)
                                memzcan();
                                break;
                        case 'i':
-                               show_mem(0, NULL);
+                               show_mem();
                                break;
                        default:
                                termch = cmd;
index b6e70c5cfa1742bb5fd540ac47f2c98c11dad206..e1df63a88aac8f2e2628c52287353f86d04cc70d 100644 (file)
@@ -342,7 +342,7 @@ static const struct sysrq_key_op sysrq_ftrace_dump_op = {
 
 static void sysrq_handle_showmem(int key)
 {
-       show_mem(0, NULL);
+       show_mem();
 }
 static const struct sysrq_key_op sysrq_showmem_op = {
        .handler        = sysrq_handle_showmem,
index be8313cdbac360ac3911b5d9c038dbfceebaaecb..358f216c6cd6eea453033a03635fbea3cb8fd07f 100644 (file)
@@ -606,7 +606,7 @@ static void fn_scroll_back(struct vc_data *vc)
 
 static void fn_show_mem(struct vc_data *vc)
 {
-       show_mem(0, NULL);
+       show_mem();
 }
 
 static void fn_show_state(struct vc_data *vc)
index 6d150990e35c1017e70602fb75705a59a6e5905f..8c3e3eec9008be455946a0b1472fca0f73db8f8c 100644 (file)
@@ -3068,9 +3068,9 @@ extern void mem_init(void);
 extern void __init mmap_init(void);
 
 extern void __show_mem(unsigned int flags, nodemask_t *nodemask, int max_zone_idx);
-static inline void show_mem(unsigned int flags, nodemask_t *nodemask)
+static inline void show_mem(void)
 {
-       __show_mem(flags, nodemask, MAX_NR_ZONES - 1);
+       __show_mem(0, NULL, MAX_NR_ZONES - 1);
 }
 extern long si_mem_available(void);
 extern void si_meminfo(struct sysinfo * val);
index e7a01c2ccd1b0c33f795dd94a0c58ab57092bb93..8d0fd946cdd2b3fc8eae59ae6715928fa70e6f18 100644 (file)
@@ -61,7 +61,7 @@ static void __init error(char *x)
 }
 
 #define panic_show_mem(fmt, ...) \
-       ({ show_mem(0, NULL); panic(fmt, ##__VA_ARGS__); })
+       ({ show_mem(); panic(fmt, ##__VA_ARGS__); })
 
 /* link hash */
 
index 10effe40a3fa65f87d0dde7353105a29fa212fc8..07239d4ad81e87e1de4477f8196e8ffcd105161b 100644 (file)
@@ -216,7 +216,7 @@ static void panic_print_sys_info(bool console_flush)
                show_state();
 
        if (panic_print & PANIC_PRINT_MEM_INFO)
-               show_mem(0, NULL);
+               show_mem();
 
        if (panic_print & PANIC_PRINT_TIMER_INFO)
                sysrq_timer_list_show();