From patchwork Thu Jun 9 04:28:36 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 863152 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p594SeDt025321 for ; Thu, 9 Jun 2011 04:28:40 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750914Ab1FIE2j (ORCPT ); Thu, 9 Jun 2011 00:28:39 -0400 Received: from relmlor3.renesas.com ([210.160.252.173]:45422 "EHLO relmlor3.renesas.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750852Ab1FIE2j (ORCPT ); Thu, 9 Jun 2011 00:28:39 -0400 Received: from relmlir4.idc.renesas.com ([10.200.68.154]) by relmlor3.idc.renesas.com ( SJSMS) with ESMTP id <0LMI001HI9RPTL80@relmlor3.idc.renesas.com>; Thu, 09 Jun 2011 13:28:37 +0900 (JST) Received: from relmlac3.idc.renesas.com ([10.200.69.23]) by relmlir4.idc.renesas.com ( SJSMS) with ESMTP id <0LMI00JSH9ROXCB0@relmlir4.idc.renesas.com>; Thu, 09 Jun 2011 13:28:37 +0900 (JST) Received: by relmlac3.idc.renesas.com (Postfix, from userid 0) id D27E818071; Thu, 09 Jun 2011 13:28:36 +0900 (JST) Received: from relmlac3.idc.renesas.com (localhost [127.0.0.1]) by relmlac3.idc.renesas.com (Postfix) with ESMTP id A000518077; Thu, 09 Jun 2011 13:28:36 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac3.idc.renesas.com with ESMTP id PAA24811; Thu, 09 Jun 2011 13:28:36 +0900 Date: Thu, 09 Jun 2011 13:28:36 +0900 X-IronPort-AV: E=Sophos; i="4.65,340,1304262000"; d="scan'208"; a="31151731" Received: from unknown (HELO PG10870.renesas.com) ([172.30.8.159]) by relmlii1.idc.renesas.com with ESMTP; Thu, 09 Jun 2011 13:28:36 +0900 Message-id: From: Kuninori Morimoto To: Guennadi Liakhovetski Cc: linux-sh@vger.kernel.org, linux-fbdev@vger.kernel.org, Magnus Damm Subject: Re: [PATCH] fbdev: sh_mobile_lcdc: reduce scope of a variable In-reply-to: References: User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.7 (=?ISO-2022-JP-2?B?U2FuahskKEQrVxsoQg==?=) APEL/10.6 Emacs/23.2 (i386-mingw-nt5.1.2600) MULE/6.0 (HANACHIRUSATO) MIME-version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-type: text/plain; charset=US-ASCII 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 (demeter1.kernel.org [140.211.167.41]); Thu, 09 Jun 2011 04:28:56 +0000 (UTC) Dear Paul, Guennadi I cannot compile on current paul/master. below patch seems breaks compile. "ret" is still needed. Can you revert it or apply attached patch ? At Thu, 05 May 2011 18:32:36 +0200 (CEST), Guennadi wrote: > > 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 */ > -- > 1.7.2.5 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-sh" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html --- drivers/video/sh_mobile_lcdcfb.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c index 404c03b..d0a03ef 100644 --- a/drivers/video/sh_mobile_lcdcfb.c +++ b/drivers/video/sh_mobile_lcdcfb.c @@ -617,6 +617,7 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv) unsigned long icb_addr_y, icb_addr_c; int icb_pitch; int pf; + int ret; cfg = ch->cfg.meram_cfg; mdev = priv->meram_dev;