diff options
author | Brian W Hart <hartb@linux.vnet.ibm.com> | 2014-05-13 21:03:45 -0400 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2014-05-13 21:20:06 -0400 |
commit | cea092c9488cbb22c8b70336ab1413e0daf350f0 (patch) | |
tree | ab975eb72db9571ab550d3816a0e591722bc243b | |
parent | 5888bcc5d24acf911c3d12719d72968c9b27a02f (diff) |
cpumask.h: silence warning with -Wsign-compare
Silence the warning when building with -Wsign-compare when cpumask.h
is included:
include/linux/cpumask.h: In function ‘cpumask_parse’:
include/linux/cpumask.h:603:26: warning: signed and unsigned type in conditional expression [-Wsign-compare]
int len = nl ? nl - buf : strlen(buf);
^
V2: Rusty pointed out that unsigned should be used instead.
Signed-off-by: Brian W Hart <hartb@linux.vnet.ibm.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-rw-r--r-- | include/linux/cpumask.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index d08e4d2a9b92..3557ea7b2049 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h | |||
@@ -600,7 +600,7 @@ static inline int cpulist_scnprintf(char *buf, int len, | |||
600 | static inline int cpumask_parse(const char *buf, struct cpumask *dstp) | 600 | static inline int cpumask_parse(const char *buf, struct cpumask *dstp) |
601 | { | 601 | { |
602 | char *nl = strchr(buf, '\n'); | 602 | char *nl = strchr(buf, '\n'); |
603 | int len = nl ? nl - buf : strlen(buf); | 603 | unsigned int len = nl ? (unsigned int)(nl - buf) : strlen(buf); |
604 | 604 | ||
605 | return bitmap_parse(buf, len, cpumask_bits(dstp), nr_cpumask_bits); | 605 | return bitmap_parse(buf, len, cpumask_bits(dstp), nr_cpumask_bits); |
606 | } | 606 | } |