From: Bart Van Assche <Bart.VanAssche@sandisk.com>
To: "osandov@osandov.com" <osandov@osandov.com>,
"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
"axboe@fb.com" <axboe@fb.com>
Cc: "kernel-team@fb.com" <kernel-team@fb.com>
Subject: Re: [PATCH v2 04/12] blk-mq-debugfs: don't open code strstrip()
Date: Thu, 4 May 2017 23:10:34 +0000 [thread overview]
Message-ID: <1493939434.2692.15.camel@sandisk.com> (raw)
In-Reply-To: <65b6e5cb3c0be1eaa543a38e47512c2f45a0ace1.1493882751.git.osandov@fb.com>
On Thu, 2017-05-04 at 00:31 -0700, Omar Sandoval wrote:
> From: Omar Sandoval <osandov@fb.com>
>=20
> Slightly more readable, plus we also strip leading spaces.
>=20
> Signed-off-by: Omar Sandoval <osandov@fb.com>
> ---
> block/blk-mq-debugfs.c | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
>=20
> diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c
> index 2a19237455d4..109ae9f3d400 100644
> --- a/block/blk-mq-debugfs.c
> +++ b/block/blk-mq-debugfs.c
> @@ -111,17 +111,16 @@ static ssize_t blk_queue_flags_store(struct file *f=
ile, const char __user *buf,
> size_t count, loff_t *ppos)
> {
> struct request_queue *q =3D file_inode(file)->i_private;
> - char op[16] =3D { }, *s;
> + char opbuf[16] =3D { }, *op;
> =20
> - if (count >=3D sizeof(op)) {
> + if (count >=3D sizeof(opbuf)) {
> pr_err("%s: operation too long\n", __func__);
> goto inval;
> }
> =20
> - if (copy_from_user(op, buf, count))
> + if (copy_from_user(opbuf, buf, count))
> return -EFAULT;
> - s =3D op;
> - strsep(&s, " \t\n"); /* strip trailing whitespace */
> + op =3D strstrip(opbuf);
> if (strcmp(op, "run") =3D=3D 0) {
> blk_mq_run_hw_queues(q, true);
> } else if (strcmp(op, "start") =3D=3D 0) {
Hello Omar,
Sorry but in my opinion the value of this patch is so small that I'm not su=
re
it's worth to merge this patch.
Bart.=
next prev parent reply other threads:[~2017-05-04 23:10 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-04 7:31 [PATCH v2 00/12] blk-mq-sched: scheduler support and cleanups Omar Sandoval
2017-05-04 7:31 ` [PATCH v2 01/12] blk-mq-debugfs: separate flags with | Omar Sandoval
2017-05-04 11:19 ` Hannes Reinecke
2017-05-04 7:31 ` [PATCH v2 02/12] blk-mq-debugfs: clean up flag definitions Omar Sandoval
2017-05-04 11:20 ` Hannes Reinecke
2017-05-04 7:31 ` [PATCH v2 03/12] blk-mq-debugfs: error on long write to queue "state" file Omar Sandoval
2017-05-04 11:21 ` Hannes Reinecke
2017-05-04 23:06 ` Bart Van Assche
2017-05-04 7:31 ` [PATCH v2 04/12] blk-mq-debugfs: don't open code strstrip() Omar Sandoval
2017-05-04 11:22 ` Hannes Reinecke
2017-05-04 23:10 ` Bart Van Assche [this message]
2017-05-04 7:31 ` [PATCH v2 05/12] blk-mq-debugfs: rename hw queue directories from <n> to hctx<n> Omar Sandoval
2017-05-04 11:24 ` Hannes Reinecke
2017-05-04 14:11 ` Jens Axboe
2017-05-04 7:31 ` [PATCH v2 06/12] blk-mq-debugfs: get rid of a bunch of boilerplate Omar Sandoval
2017-05-04 11:25 ` Hannes Reinecke
2017-05-04 23:13 ` Bart Van Assche
2017-05-04 7:31 ` [PATCH v2 07/12] blk-mq: Do not invoke queue operations on a dead queue Omar Sandoval
2017-05-04 11:25 ` Hannes Reinecke
2017-05-04 7:31 ` [PATCH v2 08/12] blk-mq: move debugfs declarations to a separate header file Omar Sandoval
2017-05-04 11:26 ` Hannes Reinecke
2017-05-04 7:31 ` [PATCH v2 09/12] blk-mq: untangle debugfs and sysfs Omar Sandoval
2017-05-04 11:28 ` Hannes Reinecke
2017-05-04 7:31 ` [PATCH v2 10/12] blk-mq-debugfs: allow schedulers to register debugfs attributes Omar Sandoval
2017-05-04 11:28 ` Hannes Reinecke
2017-05-04 14:22 ` Jens Axboe
2017-05-04 7:31 ` [PATCH v2 11/12] kyber: add " Omar Sandoval
2017-05-04 11:29 ` Hannes Reinecke
2017-05-04 23:17 ` Bart Van Assche
2017-05-04 7:31 ` [PATCH v2 12/12] mq-deadline: " Omar Sandoval
2017-05-04 11:29 ` Hannes Reinecke
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=1493939434.2692.15.camel@sandisk.com \
--to=bart.vanassche@sandisk.com \
--cc=axboe@fb.com \
--cc=kernel-team@fb.com \
--cc=linux-block@vger.kernel.org \
--cc=osandov@osandov.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 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.