From: ChunyouTang <tangchunyou@163.com>
To: gustavoars@kernel.org, sam@ravnborg.org
Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org,
linux-kernel@vger.kernel.org, tangchunyou@yulong.com
Subject: [PATCH v2] drivers/video/fbdev:modify 'if (addrp == NULL)' to 'if (!addr)
Date: Thu, 18 Mar 2021 11:16:36 +0800 [thread overview]
Message-ID: <20210318031636.552-1-tangchunyou@163.com> (raw)
From: tangchunyou <tangchunyou@yulong.com>
modify 'if (addrp == NULL)' to 'if (!addr)
Signed-off-by: tangchunyou <tangchunyou@yulong.com>
---
drivers/video/fbdev/offb.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/video/fbdev/offb.c b/drivers/video/fbdev/offb.c
index cd1042f..52d86e3 100644
--- a/drivers/video/fbdev/offb.c
+++ b/drivers/video/fbdev/offb.c
@@ -305,9 +305,9 @@ static void __iomem *offb_map_reg(struct device_node *np, int index,
unsigned int flags;
addrp = of_get_pci_address(np, index, &asize, &flags);
- if (addrp == NULL)
+ if (!addrp)
addrp = of_get_address(np, index, &asize, &flags);
- if (addrp == NULL)
+ if (!addrp)
return NULL;
if ((flags & (IORESOURCE_IO | IORESOURCE_MEM)) == 0)
return NULL;
@@ -412,7 +412,7 @@ static void __init offb_init_fb(const char *name,
info = framebuffer_alloc(sizeof(u32) * 16, NULL);
- if (info == NULL) {
+ if (!info) {
release_mem_region(res_start, res_size);
return;
}
@@ -555,25 +555,25 @@ static void __init offb_init_nodriver(struct device_node *dp, int no_real_node)
#endif
pp = of_get_property(dp, "linux,bootx-depth", &len);
- if (pp == NULL)
+ if (!pp)
pp = of_get_property(dp, "depth", &len);
if (pp && len == sizeof(u32))
depth = be32_to_cpup(pp);
pp = of_get_property(dp, "linux,bootx-width", &len);
- if (pp == NULL)
+ if (!pp)
pp = of_get_property(dp, "width", &len);
if (pp && len == sizeof(u32))
width = be32_to_cpup(pp);
pp = of_get_property(dp, "linux,bootx-height", &len);
- if (pp == NULL)
+ if (!pp)
pp = of_get_property(dp, "height", &len);
if (pp && len == sizeof(u32))
height = be32_to_cpup(pp);
pp = of_get_property(dp, "linux,bootx-linebytes", &len);
- if (pp == NULL)
+ if (!pp)
pp = of_get_property(dp, "linebytes", &len);
if (pp && len == sizeof(u32) && (*pp != 0xffffffffu))
pitch = be32_to_cpup(pp);
@@ -593,7 +593,7 @@ static void __init offb_init_nodriver(struct device_node *dp, int no_real_node)
* the "address" property. If none match, we pick the biggest
*/
up = of_get_property(dp, "linux,bootx-addr", &len);
- if (up == NULL)
+ if (!up)
up = of_get_property(dp, "address", &len);
if (up && len == sizeof(u32))
addr_prop = *up;
--
1.9.1
reply other threads:[~2021-03-18 3:18 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20210318031636.552-1-tangchunyou@163.com \
--to=tangchunyou@163.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=gustavoars@kernel.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sam@ravnborg.org \
--cc=tangchunyou@yulong.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).