From patchwork Sat Nov 5 15:13:07 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfgang Denk X-Patchwork-Id: 123873 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id D6168B6FF5 for ; Sun, 6 Nov 2011 02:16:10 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4E761298F8; Sat, 5 Nov 2011 16:15:15 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Np97BA05zdal; Sat, 5 Nov 2011 16:15:15 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 442EE295CC; Sat, 5 Nov 2011 16:13:54 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D6CF129116 for ; Sat, 5 Nov 2011 16:13:33 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Gva3lmdid5td for ; Sat, 5 Nov 2011 16:13:33 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) by theia.denx.de (Postfix) with ESMTP id D9DB629107 for ; Sat, 5 Nov 2011 16:13:26 +0100 (CET) Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 011D01C02EEC; Sat, 5 Nov 2011 16:13:23 +0100 (CET) X-Auth-Info: hu3WFGWWJnk5PhVcRSqV1w4SR56M2gsjCqYNSGlIyU8= Received: from diddl.denx.de (host-80-81-18-216.customer.m-online.net [80.81.18.216]) by smtp-auth.mnet-online.de (Postfix) with ESMTPA id 4B49D1C001BD; Sat, 5 Nov 2011 16:13:23 +0100 (CET) Received: from gemini.denx.de (gemini.denx.de [10.0.0.2]) by diddl.denx.de (Postfix) with ESMTP id 396C9C8CD262; Sat, 5 Nov 2011 16:13:23 +0100 (CET) Received: by gemini.denx.de (Postfix, from userid 500) id 2C7FE166C86A; Sat, 5 Nov 2011 16:13:23 +0100 (CET) From: Wolfgang Denk To: u-boot@lists.denx.de Date: Sat, 5 Nov 2011 16:13:07 +0100 Message-Id: <1320505999-9770-11-git-send-email-wd@denx.de> X-Mailer: git-send-email 1.7.6.4 In-Reply-To: <1320505999-9770-1-git-send-email-wd@denx.de> References: <1320458160-23136-1-git-send-email-wd@denx.de> <1320505999-9770-1-git-send-email-wd@denx.de> Cc: Oliver Brown Subject: [U-Boot] [PATCH 10/22] board/gw8260/flash.c: minimal CodingStyle cleanup X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Really minimal and local, just good enough to make checkpatch not complain about the changes in the following commit. Signed-off-by: Wolfgang Denk Cc: Oliver Brown --- board/gw8260/flash.c | 75 ++++++++++++++++++++++++-------------------------- 1 files changed, 36 insertions(+), 39 deletions(-) diff --git a/board/gw8260/flash.c b/board/gw8260/flash.c index 6035f69..c1c26ea 100644 --- a/board/gw8260/flash.c +++ b/board/gw8260/flash.c @@ -63,54 +63,51 @@ static int write_word (flash_info_t *info, ulong dest, ulong data); /* functions */ /*********************************************************************/ -/*********************************************************************/ -/* NAME: flash_init() - initializes flash banks */ -/* */ -/* DESCRIPTION: */ -/* This function initializes the flash bank(s). */ -/* */ -/* RETURNS: */ -/* The size in bytes of the flash */ -/* */ -/* RESTRICTIONS/LIMITATIONS: */ -/* */ -/* */ -/*********************************************************************/ -unsigned long flash_init (void) +/* + * NAME: flash_init() - initializes flash banks + * + * DESCRIPTION: + * This function initializes the flash bank(s). + * + * RETURNS: + * The size in bytes of the flash + * + * RESTRICTIONS/LIMITATIONS: + * + * + */ +unsigned long flash_init(void) { - unsigned long size; - int i; - - /* Init: no FLASHes known */ - for (i=0; i= CONFIG_SYS_FLASH0_BASE - flash_protect(FLAG_PROTECT_SET, - CONFIG_SYS_MONITOR_BASE, - CONFIG_SYS_MONITOR_BASE+monitor_flash_len-1, - &flash_info[0]); + flash_protect(FLAG_PROTECT_SET, + CONFIG_SYS_MONITOR_BASE, + CONFIG_SYS_MONITOR_BASE + monitor_flash_len - 1, + &flash_info[0]); #endif #if defined(CONFIG_ENV_IS_IN_FLASH) && defined(CONFIG_ENV_ADDR) -# ifndef CONFIG_ENV_SIZE -# define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE -# endif - flash_protect(FLAG_PROTECT_SET, - CONFIG_ENV_ADDR, - CONFIG_ENV_ADDR + CONFIG_ENV_SIZE - 1, - &flash_info[0]); +#ifndef CONFIG_ENV_SIZE +#define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE +#endif + flash_protect(FLAG_PROTECT_SET, + CONFIG_ENV_ADDR, + CONFIG_ENV_ADDR + CONFIG_ENV_SIZE - 1, &flash_info[0]); #endif - return (CONFIG_SYS_FLASH0_SIZE * 1024 * 1024); /*size*/ + return CONFIG_SYS_FLASH0_SIZE * 1024 * 1024; /*size */ } /*********************************************************************/