From c51683731936b497712864ff910d0c0b851ab834 Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Tue, 12 Mar 2013 11:30:04 -0700 Subject: [PATCH] --- yaml --- r: 365505 b: refs/heads/master c: ba630e4940924ad1962883c207a62890778ced63 h: refs/heads/master i: 365503: 6d2c682f982b2bdc5270c19d7e7d78015deb0fba v: v3 --- [refs] | 2 +- trunk/include/linux/cpumask.h | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index ad389aa8a0cd..f09ee857cb7e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 8719dceae2f98a578507c0f6b49c93f320bd729c +refs/heads/master: ba630e4940924ad1962883c207a62890778ced63 diff --git a/trunk/include/linux/cpumask.h b/trunk/include/linux/cpumask.h index 032560295fcb..d08e4d2a9b92 100644 --- a/trunk/include/linux/cpumask.h +++ b/trunk/include/linux/cpumask.h @@ -590,6 +590,21 @@ static inline int cpulist_scnprintf(char *buf, int len, nr_cpumask_bits); } +/** + * cpumask_parse - extract a cpumask from from a string + * @buf: the buffer to extract from + * @dstp: the cpumask to set. + * + * Returns -errno, or 0 for success. + */ +static inline int cpumask_parse(const char *buf, struct cpumask *dstp) +{ + char *nl = strchr(buf, '\n'); + int len = nl ? nl - buf : strlen(buf); + + return bitmap_parse(buf, len, cpumask_bits(dstp), nr_cpumask_bits); +} + /** * cpulist_parse - extract a cpumask from a user string of ranges * @buf: the buffer to extract from