From: Dan Carpenter <dan.carpenter@oracle.com>
To: Len Brown <lenb@kernel.org>
Cc: Huang Ying <ying.huang@intel.com>,
Tony Luck <tony.luck@intel.com>,
linux-acpi@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] ACPI, APEI, EINJ, cleanup 0 vs NULL confusion
Date: Fri, 20 Jan 2012 10:57:14 +0300 [thread overview]
Message-ID: <20120120075714.GD2295@elgon.mountain> (raw)
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>
diff --git a/drivers/acpi/apei/einj.c b/drivers/acpi/apei/einj.c
index bb20b03..c89b0e5 100644
--- a/drivers/acpi/apei/einj.c
+++ b/drivers/acpi/apei/einj.c
@@ -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 */
next reply other threads:[~2012-01-20 7:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-20 7:57 Dan Carpenter [this message]
2012-01-21 0:12 ` [patch] ACPI, APEI, EINJ, cleanup 0 vs NULL confusion Huang Ying
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120120075714.GD2295@elgon.mountain \
--to=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=tony.luck@intel.com \
--cc=ying.huang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).