From patchwork Sun Sep 21 13:12:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 391677 X-Patchwork-Delegate: marek.vasut@gmail.com 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 76D051400BE for ; Sun, 21 Sep 2014 23:13:41 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2ABB9A745B; Sun, 21 Sep 2014 15:13:40 +0200 (CEST) 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 3YrgaKcwPuJy; Sun, 21 Sep 2014 15:13:39 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id F20CCA745F; Sun, 21 Sep 2014 15:13:04 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 84F6A4B68B for ; Sun, 21 Sep 2014 15:12:48 +0200 (CEST) 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 ESQwdaHY3F2W for ; Sun, 21 Sep 2014 15:12:46 +0200 (CEST) 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.10]) by theia.denx.de (Postfix) with ESMTPS id BC6C74B615 for ; Sun, 21 Sep 2014 15:12:44 +0200 (CEST) Received: from mail.nefkom.net (unknown [192.168.8.184]) by mail-out.m-online.net (Postfix) with ESMTP id 3j18Mw1nZjz3hlq4; Sun, 21 Sep 2014 15:12:44 +0200 (CEST) X-Auth-Info: fCBhP9kF5ut2mVUeLd7jsguBT9ScdEDGM5RzI6Yv5Ms= Received: from chi.lan (host-82-135-33-74.customer.m-online.net [82.135.33.74]) by smtp-auth.mnet-online.de (Postfix) with ESMTPA id 3j18Mv4Tx2zvhTZ; Sun, 21 Sep 2014 15:12:43 +0200 (CEST) From: Marek Vasut To: u-boot@lists.denx.de Date: Sun, 21 Sep 2014 15:12:11 +0200 Message-Id: <1411305152-11690-3-git-send-email-marex@denx.de> X-Mailer: git-send-email 2.0.0 In-Reply-To: <1411305152-11690-1-git-send-email-marex@denx.de> References: <1411304339-11348-1-git-send-email-marex@denx.de> <1411305152-11690-1-git-send-email-marex@denx.de> Cc: Marek Vasut , Pavel Machek , Chin Liang See , Tom Rini , sr@denx.de, Dinh Nguyen Subject: [U-Boot] [PATCH 30/51] fpga: altera: Move altera_validate to the top X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 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 Move the function to the top of the file to avoid forward declaration. No functional change. Signed-off-by: Marek Vasut Cc: Chin Liang See Cc: Dinh Nguyen Cc: Albert Aribaud Cc: Tom Rini Cc: Wolfgang Denk Cc: Pavel Machek --- drivers/fpga/altera.c | 58 +++++++++++++++++++++++---------------------------- 1 file changed, 26 insertions(+), 32 deletions(-) diff --git a/drivers/fpga/altera.c b/drivers/fpga/altera.c index b0f323f..9e9df50 100644 --- a/drivers/fpga/altera.c +++ b/drivers/fpga/altera.c @@ -19,7 +19,32 @@ #define FPGA_DEBUG 0 /* Local Static Functions */ -static int altera_validate (Altera_desc * desc, const char *fn); +static int altera_validate(Altera_desc *desc, const char *fn) +{ + if (!desc) { + printf("%s: NULL descriptor!\n", fn); + return false; + } + + if ((desc->family < min_altera_type) || + (desc->family > max_altera_type)) { + printf("%s: Invalid family type, %d\n", fn, desc->family); + return false; + } + + if ((desc->iface < min_altera_iface_type) || + (desc->iface > max_altera_iface_type)) { + printf("%s: Invalid Interface type, %d\n", fn, desc->iface); + return false; + } + + if (!desc->size) { + printf("%s: NULL part size\n", fn); + return false; + } + + return true; +} /* ------------------------------------------------------------------------- */ int altera_load(Altera_desc *desc, const void *buf, size_t bsize) @@ -194,34 +219,3 @@ int altera_info(Altera_desc *desc) return ret_val; } - -/* ------------------------------------------------------------------------- */ - -static int altera_validate(Altera_desc *desc, const char *fn) -{ - if (!desc) { - printf("%s: NULL descriptor!\n", fn); - return false; - } - - if ((desc->family < min_altera_type) || - (desc->family > max_altera_type)) { - printf("%s: Invalid family type, %d\n", fn, desc->family); - return false; - } - - if ((desc->iface < min_altera_iface_type) || - (desc->iface > max_altera_iface_type)) { - printf("%s: Invalid Interface type, %d\n", fn, desc->iface); - return false; - } - - if (!desc->size) { - printf("%s: NULL part size\n", fn); - return false; - } - - return true; -} - -/* ------------------------------------------------------------------------- */