Skip to content

Commit cea092c

Browse files
Brian W Hartrustyrussell
Brian W Hart
authored andcommitted
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 <[email protected]> Signed-off-by: Rusty Russell <[email protected]>
1 parent 5888bcc commit cea092c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/linux/cpumask.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ static inline int cpulist_scnprintf(char *buf, int len,
600600
static inline int cpumask_parse(const char *buf, struct cpumask *dstp)
601601
{
602602
char *nl = strchr(buf, '\n');
603-
int len = nl ? nl - buf : strlen(buf);
603+
unsigned int len = nl ? (unsigned int)(nl - buf) : strlen(buf);
604604

605605
return bitmap_parse(buf, len, cpumask_bits(dstp), nr_cpumask_bits);
606606
}

0 commit comments

Comments
 (0)