From patchwork Sun Mar 22 23:15:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michel von Czettritz X-Patchwork-Id: 6068171 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 A442CBF90F for ; Sun, 22 Mar 2015 23:15:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C97C32022D for ; Sun, 22 Mar 2015 23:15:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 027CF20220 for ; Sun, 22 Mar 2015 23:15:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752019AbbCVXPU (ORCPT ); Sun, 22 Mar 2015 19:15:20 -0400 Received: from mail-wg0-f44.google.com ([74.125.82.44]:35111 "EHLO mail-wg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751954AbbCVXPT (ORCPT ); Sun, 22 Mar 2015 19:15:19 -0400 Received: by wgdm6 with SMTP id m6so132726068wgd.2; Sun, 22 Mar 2015 16:15:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=AZS2V7dbeNWNH/a8lJmpzkYmQFjkfBnYYuzmfrWBISA=; b=gjKFXTZhDbkw8zGhSKBq8Pjqf5oLyXy9l14XrTuk1HR+DmeLiT7MlVVTRkNUltS2K7 L0+WyEfQZlYeb6lSRqPSDMXgNVvzcPG7rchlSOwx5W0SdXbHX0J3O0TSAQ9mUlxpkeLv 6KeYql+XxBOAKHAYyXLPb8sl+lEuRsDPCcXHffgv9LxunjTwsV+2uaZgu7Jyo3EUN2Sf /ItPFTFCJ+3s+X4RdcMz7R5cb4kZ63IVFdQAx2Qm1Ef8UhqzrxA8w0jgqefK3LkkduiV OFJjQZhryiEeM+y/bTyPMceT1Rbnydy+TOcOZvHLls46ROoDpSS910sSef05ZLGQR+Nq zHAw== X-Received: by 10.194.200.8 with SMTP id jo8mr148176448wjc.64.1427066118418; Sun, 22 Mar 2015 16:15:18 -0700 (PDT) Received: from x230-arch (port-92-203-13-101.dynamic.qsc.de. [92.203.13.101]) by mx.google.com with ESMTPSA id ei8sm8563895wib.10.2015.03.22.16.15.17 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 22 Mar 2015 16:15:17 -0700 (PDT) Date: Mon, 23 Mar 2015 00:15:16 +0100 From: Michel von Czettritz To: sudipm.mukherjee@gmail.com Cc: teddy.wang@siliconmotion.com, kernel-janitors@vger.kernel.org, gregkh@linuxfoundation.org, linux-fbdev@vger.kernel.org Subject: [PATCH 13/13] staging: sm750: move assignment out of if cond Message-ID: <20150322231516.GA17336@x230-arch.club.entropia.de> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) 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.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, 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 This patch moves the assignments from the if conditions to the line before the condition. The 3 occurrence are return values and the checks for errors. Signed-off-by: Michel von Czettritz --- drivers/staging/sm750fb/sm750.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c index c250882..a4a7fed 100644 --- a/drivers/staging/sm750fb/sm750.c +++ b/drivers/staging/sm750fb/sm750.c @@ -474,7 +474,8 @@ static int lynxfb_resume(struct pci_dev *pdev) console_lock(); - if ((ret = pci_set_power_state(pdev, PCI_D0)) != 0) { + ret = pci_set_power_state(pdev, PCI_D0); + if (ret != 0) { pr_err("error:%d occured in pci_set_power_state\n", ret); return ret; } @@ -482,7 +483,8 @@ static int lynxfb_resume(struct pci_dev *pdev) if (pdev->dev.power.power_state.event != PM_EVENT_FREEZE) { pci_restore_state(pdev); - if ((ret = pci_enable_device(pdev)) != 0) { + ret = pci_enable_device(pdev); + if (ret != 0) { pr_err("error:%d occured in pci_enable_device\n", ret); return ret; } @@ -971,7 +973,8 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index) info->cmap.red, info->cmap.green, info->cmap.blue, info->cmap.transp); - if ((ret = fb_alloc_cmap(&info->cmap, 256, 0)) < 0) { + ret = fb_alloc_cmap(&info->cmap, 256, 0); + if (ret < 0) { pr_err("Could not allcate memory for cmap.\n"); goto exit; }