[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20210318031636.552-1-tangchunyou@163.com>
Date: Thu, 18 Mar 2021 11:16:36 +0800
From: ChunyouTang <tangchunyou@....com>
To: gustavoars@...nel.org, sam@...nborg.org
Cc: dri-devel@...ts.freedesktop.org, linux-fbdev@...r.kernel.org,
linux-kernel@...r.kernel.org, tangchunyou@...ong.com
Subject: [PATCH v2] drivers/video/fbdev:modify 'if (addrp == NULL)' to 'if (!addr)
From: tangchunyou <tangchunyou@...ong.com>
modify 'if (addrp == NULL)' to 'if (!addr)
Signed-off-by: tangchunyou <tangchunyou@...ong.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
Powered by blists - more mailing lists