The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Baokun Li <libaokun@linux.alibaba.com>
To: Joshua Crofts <joshua.crofts1@gmail.com>
Cc: "Ritesh Harjani (IBM)" <ritesh.list@gmail.com>,
	Ojaswin Mujoo <ojaswin@linux.ibm.com>, Jan Kara <jack@suse.cz>,
	Andreas Dilger <adilger.kernel@dilger.ca>,
	Theodore Ts'o <tytso@mit.edu>,
	linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org,
	Zhang Yi <yi.zhang@huawei.com>
Subject: Re: [PATCH] ext4: use str_plural() instead of custom macro
Date: Mon, 13 Jul 2026 11:47:24 +0800	[thread overview]
Message-ID: <cddfc510-0fcf-49e5-975a-6edde4afb39b@linux.alibaba.com> (raw)
In-Reply-To: <20260711-remove-plural-macro-v1-1-b3dcd44e4068@gmail.com>

On 2026/7/11 14:38, Joshua Crofts wrote:
> Remove the custom PLURAL() macro and use str_plural() from
> string_choices.h instead.
>
> Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com>
 
Looks good to me, just one nit:

Reviewed-by: Baokun Li <libaokun@huawei.com>

> ---
>  fs/ext4/orphan.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/fs/ext4/orphan.c b/fs/ext4/orphan.c
> index 64ea47624233..e307d6d55451 100644
> --- a/fs/ext4/orphan.c
> +++ b/fs/ext4/orphan.c
> @@ -4,6 +4,7 @@
>  #include <linux/fs.h>
>  #include <linux/quotaops.h>
>  #include <linux/buffer_head.h>
> +#include <linux/string_choices.h>
>  
>  #include "ext4.h"
>  #include "ext4_jbd2.h"
> @@ -486,14 +487,13 @@ void ext4_orphan_cleanup(struct super_block *sb, struct ext4_super_block *es)
>  		}
>  	}
>  
> -#define PLURAL(x) (x), ((x) == 1) ? "" : "s"
>  

this leaves two blank lines here

>  	if (nr_orphans)
>  		ext4_msg(sb, KERN_INFO, "%d orphan inode%s deleted",
> -		       PLURAL(nr_orphans));
> +			 nr_orphans, str_plural(nr_orphans));
>  	if (nr_truncates)
>  		ext4_msg(sb, KERN_INFO, "%d truncate%s cleaned up",
> -		       PLURAL(nr_truncates));
> +			 nr_truncates, str_plural(nr_truncates));
>  #ifdef CONFIG_QUOTA
>  	/* Turn off quotas if they were enabled for orphan cleanup */
>  	if (quota_update) {
>
> ---
> base-commit: c143957520c6c9b5cd72e0de8b52b814f0c576fe
> change-id: 20260711-remove-plural-macro-7ecfa879fcae
>
> Best regards,



      parent reply	other threads:[~2026-07-13  3:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-11  6:38 [PATCH] ext4: use str_plural() instead of custom macro Joshua Crofts
2026-07-12 16:33 ` Jan Kara
2026-07-13  3:47 ` Baokun Li [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cddfc510-0fcf-49e5-975a-6edde4afb39b@linux.alibaba.com \
    --to=libaokun@linux.alibaba.com \
    --cc=adilger.kernel@dilger.ca \
    --cc=jack@suse.cz \
    --cc=joshua.crofts1@gmail.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ojaswin@linux.ibm.com \
    --cc=ritesh.list@gmail.com \
    --cc=tytso@mit.edu \
    --cc=yi.zhang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox