Message ID | 20230804012559.2617515-4-zhangpeng362@huawei.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | cleanup with helper macro K() | expand |
On 04.08.23 03:25, Peng Zhang wrote: > From: ZhangPeng <zhangpeng362@huawei.com> > > Use helper macro K() to improve code readability. No functional > modification involved. > > Signed-off-by: ZhangPeng <zhangpeng362@huawei.com> > --- > mm/swap_state.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/mm/swap_state.c b/mm/swap_state.c > index 5a690c79cc13..01f15139b7d9 100644 > --- a/mm/swap_state.c > +++ b/mm/swap_state.c > @@ -63,9 +63,8 @@ static atomic_t swapin_readahead_hits = ATOMIC_INIT(4); > void show_swap_cache_info(void) > { > printk("%lu pages in swap cache\n", total_swapcache_pages()); > - printk("Free swap = %ldkB\n", > - get_nr_swap_pages() << (PAGE_SHIFT - 10)); > - printk("Total swap = %lukB\n", total_swap_pages << (PAGE_SHIFT - 10)); > + printk("Free swap = %ldkB\n", K(get_nr_swap_pages())); > + printk("Total swap = %lukB\n", K(total_swap_pages)); > } > > void *get_shadow_from_swap_cache(swp_entry_t entry) Reviewed-by: David Hildenbrand <david@redhat.com>
diff --git a/mm/swap_state.c b/mm/swap_state.c index 5a690c79cc13..01f15139b7d9 100644 --- a/mm/swap_state.c +++ b/mm/swap_state.c @@ -63,9 +63,8 @@ static atomic_t swapin_readahead_hits = ATOMIC_INIT(4); void show_swap_cache_info(void) { printk("%lu pages in swap cache\n", total_swapcache_pages()); - printk("Free swap = %ldkB\n", - get_nr_swap_pages() << (PAGE_SHIFT - 10)); - printk("Total swap = %lukB\n", total_swap_pages << (PAGE_SHIFT - 10)); + printk("Free swap = %ldkB\n", K(get_nr_swap_pages())); + printk("Total swap = %lukB\n", K(total_swap_pages)); } void *get_shadow_from_swap_cache(swp_entry_t entry)