From patchwork Thu Feb 5 13:14:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 5784441 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A5AC4BF440 for ; Thu, 5 Feb 2015 13:15:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C4EAE20268 for ; Thu, 5 Feb 2015 13:15:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BA6A120222 for ; Thu, 5 Feb 2015 13:15:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752887AbbBENPC (ORCPT ); Thu, 5 Feb 2015 08:15:02 -0500 Received: from mout.web.de ([212.227.17.12]:62335 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752752AbbBENPB (ORCPT ); Thu, 5 Feb 2015 08:15:01 -0500 Received: from [192.168.1.2] ([92.228.134.1]) by smtp.web.de (mrweb103) with ESMTPSA (Nemesis) id 0Martm-1Y3Kl113U2-00KS3h; Thu, 05 Feb 2015 14:14:57 +0100 Message-ID: <54D36CCE.6050401@users.sourceforge.net> Date: Thu, 05 Feb 2015 14:14:54 +0100 From: SF Markus Elfring User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Jean-Christophe Plagniol-Villard , Tomi Valkeinen , linux-fbdev@vger.kernel.org CC: LKML , kernel-janitors@vger.kernel.org, Julia Lawall Subject: [PATCH] au1100fb: Delete unnecessary checks before two function calls References: <5307CAA2.8060406@users.sourceforge.net> <530A086E.8010901@users.sourceforge.net> <530A72AA.3000601@users.sourceforge.net> <530B5FB6.6010207@users.sourceforge.net> <530C5E18.1020800@users.sourceforge.net> <530CD2C4.4050903@users.sourceforge.net> <530CF8FF.8080600@users.sourceforge.net> <530DD06F.4090703@users.sourceforge.net> <5317A59D.4@users.sourceforge.net> In-Reply-To: <5317A59D.4@users.sourceforge.net> X-Provags-ID: V03:K0:dpEWmXLZAQgI/h2xiSfOUahlcMGEZ7nb/MOiOjzahA7lQT4ObQm UV7jrGWCieQ3dAsqrqz8AMVosNyJip2TAncLTLFwOi4esVlSk4JsCKCHMkmHQnhWojdFv16 q1NvAZRbC0Waey/kdag5BYjCKQc8nzwyIbwzhdlvMTlSfWnmQBt6nFw8+x12bPO25m3qZLq eYvCk1JPnaRilNVlAh5hQ== X-UI-Out-Filterresults: notjunk:1; Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring 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 --- 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