cpusched: Fix compiler warnings
authorTobias Klauser <tklauser@distanz.ch>
Sun, 11 Aug 2013 13:33:11 +0000 (11 15:33 +0200)
committerTobias Klauser <tklauser@distanz.ch>
Sun, 11 Aug 2013 13:33:11 +0000 (11 15:33 +0200)
Fix the following compiler warnings that occur when building with "-W
-Wall -Wextra":

cpusched.c: In function ‘get_appropriate_cpu’:
cpusched.c:28:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
cpusched.c:29:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
cpusched.c

index cc75be7..2b4260b 100644 (file)
@@ -20,10 +20,10 @@ static unsigned int *cpu_work_map = NULL;
 static unsigned int cpu_len = 0;
 static struct rwlock map_lock;
 
-static int get_appropriate_cpu(void)
+static unsigned int get_appropriate_cpu(void)
 {
-       int i, cpu = 0;
-       int work = INT_MAX;
+       unsigned int i, cpu = 0;
+       unsigned int work = UINT_MAX;
 
        for (i = 0; i < cpu_len; ++i) {
                if (cpu_work_map[i] < work) {