2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-26 14:14:01 +08:00

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>
This commit is contained in:
Brian W Hart 2014-05-14 10:33:45 +09:30 committed by Rusty Russell
parent 5888bcc5d2
commit cea092c948

View File

@ -600,7 +600,7 @@ static inline int cpulist_scnprintf(char *buf, int len,
static inline int cpumask_parse(const char *buf, struct cpumask *dstp) static inline int cpumask_parse(const char *buf, struct cpumask *dstp)
{ {
char *nl = strchr(buf, '\n'); char *nl = strchr(buf, '\n');
int len = nl ? nl - buf : strlen(buf); unsigned int len = nl ? (unsigned int)(nl - buf) : strlen(buf);
return bitmap_parse(buf, len, cpumask_bits(dstp), nr_cpumask_bits); return bitmap_parse(buf, len, cpumask_bits(dstp), nr_cpumask_bits);
} }