Skip to content

Commit

Permalink
mm: remove arguments of show_mem()
Browse files Browse the repository at this point in the history
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/[email protected]
Signed-off-by: Kefeng Wang <[email protected]>
Cc: Christophe Leroy <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Matthew Wilcox <[email protected]>
Cc: Michael Ellerman <[email protected]>
Cc: Nicholas Piggin <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
Kefeng Wang authored and akpm00 committed Aug 18, 2023
1 parent 626e98c commit 527ed4f
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion arch/powerpc/xmon/xmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,7 @@ cmds(struct pt_regs *excp)
memzcan();
break;
case 'i':
show_mem(0, NULL);
show_mem();
break;
default:
termch = cmd;
Expand Down
2 changes: 1 addition & 1 deletion drivers/tty/sysrq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion drivers/tty/vt/keyboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions include/linux/mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion init/initramfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down
2 changes: 1 addition & 1 deletion kernel/panic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 527ed4f

Please sign in to comment.