diff mbox series

[4/7] mm/shmem.c: use helper macro K()

Message ID 20230804012559.2617515-5-zhangpeng362@huawei.com (mailing list archive)
State New
Headers show
Series cleanup with helper macro K() | expand

Commit Message

Peng Zhang Aug. 4, 2023, 1:25 a.m. UTC
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/shmem.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

David Hildenbrand Aug. 7, 2023, 3:19 p.m. UTC | #1
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/shmem.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/mm/shmem.c b/mm/shmem.c
> index 30e96dcd71a2..7a0c1e19d9f8 100644
> --- a/mm/shmem.c
> +++ b/mm/shmem.c
> @@ -3881,8 +3881,7 @@ static int shmem_show_options(struct seq_file *seq, struct dentry *root)
>   	struct mempolicy *mpol;
>   
>   	if (sbinfo->max_blocks != shmem_default_max_blocks())
> -		seq_printf(seq, ",size=%luk",
> -			sbinfo->max_blocks << (PAGE_SHIFT - 10));
> +		seq_printf(seq, ",size=%luk", K(sbinfo->max_blocks));
>   	if (sbinfo->max_inodes != shmem_default_max_inodes())
>   		seq_printf(seq, ",nr_inodes=%lu", sbinfo->max_inodes);
>   	if (sbinfo->mode != (0777 | S_ISVTX))

Reviewed-by: David Hildenbrand <david@redhat.com>
diff mbox series

Patch

diff --git a/mm/shmem.c b/mm/shmem.c
index 30e96dcd71a2..7a0c1e19d9f8 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -3881,8 +3881,7 @@  static int shmem_show_options(struct seq_file *seq, struct dentry *root)
 	struct mempolicy *mpol;
 
 	if (sbinfo->max_blocks != shmem_default_max_blocks())
-		seq_printf(seq, ",size=%luk",
-			sbinfo->max_blocks << (PAGE_SHIFT - 10));
+		seq_printf(seq, ",size=%luk", K(sbinfo->max_blocks));
 	if (sbinfo->max_inodes != shmem_default_max_inodes())
 		seq_printf(seq, ",nr_inodes=%lu", sbinfo->max_inodes);
 	if (sbinfo->mode != (0777 | S_ISVTX))