Skip to contentSkip to conversation

ACPI, APEI, EINJ, cleanup 0 vs NULL confusion

PATCH In review Dan Carpenter 2 participants 2 messages Jan 20, 2012 – Jan 21, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ACPI, APEI, EINJ, cleanup 0 vs NULL confusion

This function is returning pointers. Sparse complains here:
drivers/acpi/apei/einj.c:262:32: warning:
Using plain integer as NULL pointer

drivers/acpi/apei/einj.c +3 -3
index bb20b03..c89b0e5 100644
@@ -259,15 +259,15 @@ static void *einj_get_parameter_address(void)
 
 		v4param = ioremap(paddrv4, sizeof(*v4param));
 		if (!v4param)
-			return 0;
+			return NULL;
 		if (readq(&v4param->reserved1) || readq(&v4param->reserved2)) {
 			iounmap(v4param);
-			return 0;
+			return NULL;
 		}
 		return v4param;
 	}
 
-	return 0;
+	return NULL;
 }
 
 /* do sanity check to trigger table */