Skip to contentSkip to conversation

- [14/15] - remove defconfig ptr comparisons to 0 - kernel

PATCH New Joe Perches 1 participant 1 message Nov 14, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 - [14/15] - remove defconfig ptr comparisons to 0 - kernel

Remove defconfig ptr comparison to 0

Remove sparse warning: Using plain integer as NULL pointer

---

kernel/futex.c +1 -1
index 9dc591a..ea119d3 100644
@@ -276,7 +276,7 @@ static int get_futex_key(u32 __user *uaddr, struct rw_semaphore *fshared,
  */
 static void get_futex_key_refs(union futex_key *key)
 {
-	if (key->both.ptr == 0)
+	if (!key->both.ptr)
 		return;
 	switch (key->both.offset & (FUT_OFF_INODE|FUT_OFF_MMSHARED)) {
 		case FUT_OFF_INODE:
kernel/pid.c +1 -1
index d1db36b..1b3f842 100644
@@ -563,7 +563,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);
 	}