From: hch@lst.de (Christoph Hellwig)
Subject: [PATCH] nvme-pci: Fix queue_count to consider nr_possible_cpu
Date: Wed, 8 May 2019 09:14:56 +0200 [thread overview]
Message-ID: <20190508071456.GA21604@lst.de> (raw)
In-Reply-To: <20190504113923.32316-1-minwoo.im.dev@gmail.com>
On Sat, May 04, 2019@08:39:23PM +0900, Minwoo Im wrote:
> --- a/drivers/nvme/host/pci.c
> +++ b/drivers/nvme/host/pci.c
> @@ -147,6 +147,7 @@ static int io_queue_depth_set(const char *val, const struct kernel_param *kp)
> static int queue_count_set(const char *val, const struct kernel_param *kp)
> {
> int n, ret;
> + char cnt[6];
>
> ret = kstrtoint(val, 10, &n);
> if (ret)
> @@ -154,7 +155,8 @@ static int queue_count_set(const char *val, const struct kernel_param *kp)
> if (n > num_possible_cpus())
> n = num_possible_cpus();
>
> - return param_set_int(val, kp);
> + sprintf(cnt, "%d", n);
> + return param_set_int(cnt, kp);
This just looks weird. If we ant to limit the number why not
get rid of all these param_ops stuff and just verify the
number in nvme_calc_irq_sets without all that boilerplate code?
next prev parent reply other threads:[~2019-05-08 7:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-04 11:39 [PATCH] nvme-pci: Fix queue_count to consider nr_possible_cpu Minwoo Im
2019-05-08 7:14 ` Christoph Hellwig [this message]
2019-05-12 13:09 ` Minwoo Im
2019-05-12 14:16 ` Sagi Grimberg
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=20190508071456.GA21604@lst.de \
--to=hch@lst.de \
/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