From patchwork Thu May 5 16:32:36 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 757672 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p45GUKeL021696 for ; Thu, 5 May 2011 16:32:44 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755382Ab1EEQco (ORCPT ); Thu, 5 May 2011 12:32:44 -0400 Received: from moutng.kundenserver.de ([212.227.126.186]:59101 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755361Ab1EEQcn (ORCPT ); Thu, 5 May 2011 12:32:43 -0400 Received: from axis700.grange (pD9EB90E6.dip0.t-ipconnect.de [217.235.144.230]) by mrelayeu.kundenserver.de (node=mrbap2) with ESMTP (Nemesis) id 0Mfjsa-1Q5qHh1NfI-00Nojv; Thu, 05 May 2011 18:32:38 +0200 Received: by axis700.grange (Postfix, from userid 1000) id 02CC6189B89; Thu, 5 May 2011 18:32:36 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by axis700.grange (Postfix) with ESMTP id ECE25189B88; Thu, 5 May 2011 18:32:36 +0200 (CEST) Date: Thu, 5 May 2011 18:32:36 +0200 (CEST) From: Guennadi Liakhovetski X-X-Sender: lyakh@axis700.grange To: linux-sh@vger.kernel.org cc: linux-fbdev@vger.kernel.org, Magnus Damm Subject: [PATCH] fbdev: sh_mobile_lcdc: reduce scope of a variable Message-ID: MIME-Version: 1.0 X-Provags-ID: V02:K0:uOjv69oa8uVdc9Lx78tZ2E3KlLTqsNOlCL32zwmmnKN NQbffIACRqXT53sIK4tnRPAXTmP08MMgOCxISfH0/KZ3Y5J3zk wLde7sNzx76I96tqPoBBrR+l37IhQ3uT75T4gKNfsZXJlb/kWq HlQ4dQXUMgfvwINCSfBW3zFUC4oET8bAfU5VzZc81DL66EoDkR VUKu0qFEbjk00D1U4IHjJ5CXojHf3pse5ycTar4pjo= Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Thu, 05 May 2011 16:32:45 +0000 (UTC) The "ret" variable in sh_mobile_lcdc_start() is only used at one location, move its definition to the inner-most scope. Signed-off-by: Guennadi Liakhovetski --- drivers/video/sh_mobile_lcdcfb.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c index 9bcc61b..466834c 100644 --- a/drivers/video/sh_mobile_lcdcfb.c +++ b/drivers/video/sh_mobile_lcdcfb.c @@ -469,7 +469,6 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv) int bpp = 0; unsigned long ldddsr; int k, m; - int ret = 0; /* enable clocks before accessing the hardware */ for (k = 0; k < ARRAY_SIZE(priv->ch); k++) { @@ -538,11 +537,12 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv) lcdc_write_chan(ch, LDPMR, 0); board_cfg = &ch->cfg.board_cfg; - if (board_cfg->setup_sys) - ret = board_cfg->setup_sys(board_cfg->board_data, ch, - &sh_mobile_lcdc_sys_bus_ops); - if (ret) - return ret; + if (board_cfg->setup_sys) { + int ret = board_cfg->setup_sys(board_cfg->board_data, + ch, &sh_mobile_lcdc_sys_bus_ops); + if (ret) + return ret; + } } /* word and long word swap */