[PATCH] au1100fb: Delete unnecessary checks before two function calls

SF Markus Elfring
2015-02-05T13:14:54Z

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Thu, 5 Feb 2015 14:10:21 +0100

The functions clk_enable() and clk_disable() test whether their argument
is NULL and then return immediately. Thus the test around the calls
is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/video/fbdev/au1100fb.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/video/fbdev/au1100fb.c b/drivers/video/fbdev/au1100fb.c
index 5956018..47ee023 100644
--- a/drivers/video/fbdev/au1100fb.c
+++ b/drivers/video/fbdev/au1100fb.c
@@ -605,11 +605,8 @@ int au1100fb_drv_suspend(struct platform_device *dev, pm_message_t state)
/* Blank the LCD */
au1100fb_fb_blank(VESA_POWERDOWN, &fbdev->info);

- if (fbdev->lcdclk)
- clk_disable(fbdev->lcdclk);
-
+ clk_disable(fbdev->lcdclk);
memcpy(&fbregs, fbdev->regs, sizeof(struct au1100fb_regs));
-
return 0;
}

@@ -621,13 +618,10 @@ int au1100fb_drv_resume(struct platform_device *dev)
return 0;

memcpy(fbdev->regs, &fbregs, sizeof(struct au1100fb_regs));
-
- if (fbdev->lcdclk)
- clk_enable(fbdev->lcdclk);
+ clk_enable(fbdev->lcdclk);

/* Unblank the LCD */
au1100fb_fb_blank(VESA_NO_BLANKING, &fbdev->info);
-
return 0;
}
#else
--
2.2.2