mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Qiang Su <suqiang4@huawei.com>
To: <gregkh@linuxfoundation.org>, <suqiang4@huawei.com>
Cc: <linux-kernel@vger.kernel.org>, <leeyou.li@huawei.com>,
	<nixiaoming@huawei.com>
Subject: [PATCH] UIO: make MAX_UIO_MAPS configurable by menuconfig
Date: Fri, 6 Mar 2020 15:11:22 +0800	[thread overview]
Message-ID: <20200306071122.71838-1-suqiang4@huawei.com> (raw)

Now each uio device can only support 5 memory entry. It is
far from enough for some big system. On the other hand, the
hard-coded style is not flexible.
Consider the marco is used as array index, so we set a range
for the config in menuconfig. The range is set as 1 to 512.
The default value is still 5 to keep consistent with current
code.

Signed-off-by: Qiang Su <suqiang4@huawei.com>
---
 drivers/uio/Kconfig        | 9 +++++++++
 include/linux/uio_driver.h | 2 +-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/uio/Kconfig b/drivers/uio/Kconfig
index 202ee81cfc2b..31c53f1dd86a 100644
--- a/drivers/uio/Kconfig
+++ b/drivers/uio/Kconfig
@@ -165,4 +165,13 @@ config UIO_HV_GENERIC
 	  to network and storage devices from userspace.
 
 	  If you compile this as a module, it will be called uio_hv_generic.
+
+config UIO_MAX_UIO_MAPS
+	depends on UIO
+	int "Maximum of memory nodes each uio device support(1-512)"
+	range 1 512
+	default 5
+	help
+	  make the max number of uio device configurable.
+
 endif
diff --git a/include/linux/uio_driver.h b/include/linux/uio_driver.h
index 01081c4726c0..efdf8f6bf8bf 100644
--- a/include/linux/uio_driver.h
+++ b/include/linux/uio_driver.h
@@ -44,7 +44,7 @@ struct uio_mem {
 	struct uio_map		*map;
 };
 
-#define MAX_UIO_MAPS	5
+#define MAX_UIO_MAPS	CONFIG_MAX_UIO_MAPS
 
 struct uio_portio;
 
-- 
2.12.3


             reply	other threads:[~2020-03-06  7:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-06  7:11 Qiang Su [this message]
2020-03-06 14:55 ` kbuild test robot
2020-03-06 15:04 ` kbuild test robot

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=20200306071122.71838-1-suqiang4@huawei.com \
    --to=suqiang4@huawei.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=leeyou.li@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nixiaoming@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

all inboxes | Powered by JetHome®