From: therbert@google.com (Tom Herbert)
To: davem@davemloft.net, netdev@vger.kernel.org
Subject: RFC [PATCH net-2.6 5/6] net: Added cpumask_parse
Date: Wed, 5 Mar 2008 12:51:16 -0800 (PST) [thread overview]
Message-ID: <20080305205116.61E2D412793@localhost> (raw)
This patch adds the cpumask_parse function that allows parsing of a kernel buffer (analogous to bitmap_parse).
Signed-off-by: Tom Herbert <therbert@google.com>
---
diff -uprN -X /tmp/donts/cpumask net-2.6/include/linux/cpumask.h net-2.6.patch/include/linux/cpumask.h
--- net-2.6/include/linux/cpumask.h 2008-03-05 09:03:20.130056000 -0800
+++ net-2.6.patch/include/linux/cpumask.h 2008-03-05 09:25:33.435758000 -0800
@@ -49,6 +49,7 @@
* unsigned long *cpus_addr(mask) Array of unsigned long's in mask
*
* int cpumask_scnprintf(buf, len, mask) Format cpumask for printing
+ * int cpumask_parse(ubuf, ulen, mask) Parse ascii string as cpumask
* int cpumask_parse_user(ubuf, ulen, mask) Parse ascii string as cpumask
* int cpulist_scnprintf(buf, len, mask) Format cpumask as list for printing
* int cpulist_parse(buf, map) Parse ascii string as cpulist
@@ -273,6 +274,14 @@ static inline int __cpumask_scnprintf(ch
return bitmap_scnprintf(buf, len, srcp->bits, nbits);
}
+#define cpumask_parse(ubuf, ulen, dst) \
+ __cpumask_parse((ubuf), (ulen), &(dst), NR_CPUS)
+static inline int __cpumask_parse(const char __user *buf, int len,
+ cpumask_t *dstp, int nbits)
+{
+ return bitmap_parse(buf, len, dstp->bits, nbits);
+}
+
#define cpumask_parse_user(ubuf, ulen, dst) \
__cpumask_parse_user((ubuf), (ulen), &(dst), NR_CPUS)
static inline int __cpumask_parse_user(const char __user *buf, int len,
reply other threads:[~2008-03-05 20:51 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20080305205116.61E2D412793@localhost \
--to=therbert@google.com \
--cc=davem@davemloft.net \
--cc=netdev@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.