]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
kernel: fix integer as NULL pointer warnings
authorHarvey Harrison <harvey.harrison@gmail.com>
Mon, 28 Apr 2008 21:13:19 +0000 (14:13 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 29 Apr 2008 00:29:18 +0000 (17:29 -0700)
kernel/cpuset.c:1268:52: warning: Using plain integer as NULL pointer
kernel/pid_namespace.c:95:24: warning: Using plain integer as NULL pointer

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Reviewed-by: Paul Jackson <pj@sgi.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/cpuset.c
kernel/pid_namespace.c

index 024888bb9814478b718d5de894f0eb5f0b0e1d72..48a976c52cf58a5147d995c79544d2e2b16ab827 100644 (file)
@@ -1265,7 +1265,8 @@ static ssize_t cpuset_common_file_write(struct cgroup *cont,
                return -E2BIG;
 
        /* +1 for nul-terminator */
-       if ((buffer = kmalloc(nbytes + 1, GFP_KERNEL)) == 0)
+       buffer = kmalloc(nbytes + 1, GFP_KERNEL);
+       if (!buffer)
                return -ENOMEM;
 
        if (copy_from_user(buffer, userbuf, nbytes)) {
index 6d792b66d854ff3536e30a1114e35a703be59695..5ca37fa50beb5b4d66b79e9c596943c80d363dfc 100644 (file)
@@ -92,7 +92,7 @@ static struct pid_namespace *create_pid_namespace(int level)
        atomic_set(&ns->pidmap[0].nr_free, BITS_PER_PAGE - 1);
 
        for (i = 1; i < PIDMAP_ENTRIES; i++) {
-               ns->pidmap[i].page = 0;
+               ns->pidmap[i].page = NULL;
                atomic_set(&ns->pidmap[i].nr_free, BITS_PER_PAGE);
        }