linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] drivers/video/fbdev:modify 'if (addrp == NULL)' to 'if (!addr)
@ 2021-03-18  3:16 ChunyouTang
  0 siblings, 0 replies; only message in thread
From: ChunyouTang @ 2021-03-18  3:16 UTC (permalink / raw)
  To: gustavoars, sam; +Cc: dri-devel, linux-fbdev, linux-kernel, tangchunyou

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



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-03-18  3:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-18  3:16 [PATCH v2] drivers/video/fbdev:modify 'if (addrp == NULL)' to 'if (!addr) ChunyouTang

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).