ACPI, APEI, EINJ, cleanup 0 vs NULL confusion
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 20 Jan 2012 07:57:14 +0000 (10:57 +0300)
committerLen Brown <len.brown@intel.com>
Tue, 24 Jan 2012 00:38:52 +0000 (19:38 -0500)
This function is returning pointers.  Sparse complains here:
drivers/acpi/apei/einj.c:262:32: warning:
Using plain integer as NULL pointer

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Huang Ying <ying.huang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/acpi/apei/einj.c

index bb20b03ddc394c5ab35061e89cde7799d6239235..c89b0e5a2293c8bd3ac01fa7c70bc8de4e1077c9 100644 (file)
@@ -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 */