All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Chao Yu <chao@kernel.org>
Cc: linux-f2fs-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org, Yangtao Li <frank.li@vivo.com>
Subject: Re: [f2fs-dev] [PATCH] f2fs: convert to use sysfs_emit
Date: Wed, 5 Apr 2023 08:57:24 -0700	[thread overview]
Message-ID: <ZC2aZJFIJZclTkkK@google.com> (raw)
In-Reply-To: <3918411a-77fc-48d7-5b80-c4b84203a39c@kernel.org>

On 04/05, Chao Yu wrote:
> On 2023/3/31 19:33, Yangtao Li wrote:
> > Let's use sysfs_emit.
> > 
> > Signed-off-by: Yangtao Li <frank.li@vivo.com>
> > ---
> >   fs/f2fs/sysfs.c | 10 ++--------
> >   1 file changed, 2 insertions(+), 8 deletions(-)
> > 
> > diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c
> > index 9ddc6ee19433..2c0b2cb05a3a 100644
> > --- a/fs/f2fs/sysfs.c
> > +++ b/fs/f2fs/sysfs.c
> > @@ -312,19 +312,13 @@ static ssize_t f2fs_sbi_show(struct f2fs_attr *a,
> >   	if (!strcmp(a->attr.name, "ckpt_thread_ioprio")) {
> >   		struct ckpt_req_control *cprc = &sbi->cprc_info;
> > -		int len = 0;
> >   		int class = IOPRIO_PRIO_CLASS(cprc->ckpt_thread_ioprio);
> >   		int data = IOPRIO_PRIO_DATA(cprc->ckpt_thread_ioprio);
> > -		if (class == IOPRIO_CLASS_RT)
> > -			len += scnprintf(buf + len, PAGE_SIZE - len, "rt,");
> > -		else if (class == IOPRIO_CLASS_BE)
> > -			len += scnprintf(buf + len, PAGE_SIZE - len, "be,");
> > -		else
> > +		if (class != IOPRIO_CLASS_RT && class != IOPRIO_CLASS_BE)
> >   			return -EINVAL;
> > -		len += scnprintf(buf + len, PAGE_SIZE - len, "%d\n", data);
> > -		return len;
> > +		return sysfs_emit(buf, "%s,%d\n", class == IOPRIO_CLASS_RT ? "rt" : "be", data);
> 
> Exceed 80 columns.

Fixed and applied.

> 
> Thanks,
> 
> >   	}
> >   #ifdef CONFIG_F2FS_FS_COMPRESSION


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

WARNING: multiple messages have this Message-ID (diff)
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Chao Yu <chao@kernel.org>
Cc: Yangtao Li <frank.li@vivo.com>,
	linux-f2fs-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] f2fs: convert to use sysfs_emit
Date: Wed, 5 Apr 2023 08:57:24 -0700	[thread overview]
Message-ID: <ZC2aZJFIJZclTkkK@google.com> (raw)
In-Reply-To: <3918411a-77fc-48d7-5b80-c4b84203a39c@kernel.org>

On 04/05, Chao Yu wrote:
> On 2023/3/31 19:33, Yangtao Li wrote:
> > Let's use sysfs_emit.
> > 
> > Signed-off-by: Yangtao Li <frank.li@vivo.com>
> > ---
> >   fs/f2fs/sysfs.c | 10 ++--------
> >   1 file changed, 2 insertions(+), 8 deletions(-)
> > 
> > diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c
> > index 9ddc6ee19433..2c0b2cb05a3a 100644
> > --- a/fs/f2fs/sysfs.c
> > +++ b/fs/f2fs/sysfs.c
> > @@ -312,19 +312,13 @@ static ssize_t f2fs_sbi_show(struct f2fs_attr *a,
> >   	if (!strcmp(a->attr.name, "ckpt_thread_ioprio")) {
> >   		struct ckpt_req_control *cprc = &sbi->cprc_info;
> > -		int len = 0;
> >   		int class = IOPRIO_PRIO_CLASS(cprc->ckpt_thread_ioprio);
> >   		int data = IOPRIO_PRIO_DATA(cprc->ckpt_thread_ioprio);
> > -		if (class == IOPRIO_CLASS_RT)
> > -			len += scnprintf(buf + len, PAGE_SIZE - len, "rt,");
> > -		else if (class == IOPRIO_CLASS_BE)
> > -			len += scnprintf(buf + len, PAGE_SIZE - len, "be,");
> > -		else
> > +		if (class != IOPRIO_CLASS_RT && class != IOPRIO_CLASS_BE)
> >   			return -EINVAL;
> > -		len += scnprintf(buf + len, PAGE_SIZE - len, "%d\n", data);
> > -		return len;
> > +		return sysfs_emit(buf, "%s,%d\n", class == IOPRIO_CLASS_RT ? "rt" : "be", data);
> 
> Exceed 80 columns.

Fixed and applied.

> 
> Thanks,
> 
> >   	}
> >   #ifdef CONFIG_F2FS_FS_COMPRESSION

  reply	other threads:[~2023-04-05 15:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-31 11:33 [f2fs-dev] [PATCH] f2fs: convert to use sysfs_emit Yangtao Li via Linux-f2fs-devel
2023-03-31 11:33 ` Yangtao Li
2023-04-05  2:44 ` [f2fs-dev] " Chao Yu
2023-04-05  2:44   ` Chao Yu
2023-04-05 15:57   ` Jaegeuk Kim [this message]
2023-04-05 15:57     ` Jaegeuk Kim
2023-04-07  1:20     ` [f2fs-dev] " Chao Yu
2023-04-07  1:20       ` Chao Yu

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=ZC2aZJFIJZclTkkK@google.com \
    --to=jaegeuk@kernel.org \
    --cc=chao@kernel.org \
    --cc=frank.li@vivo.com \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.