summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMarek Vasut <marex@denx.de>2014-09-16 20:26:07 +0200
committerMarek Vasut <marex@denx.de>2014-10-06 17:31:41 +0200
commit5561a841487fa246ebc6df17bed8eabfa33f3557 (patch)
treef5384d6e285e260c24e98df2836b85f5fe45adba /drivers
parent0ae16cbb40a2881f6dfbe00fcb023ee7b548bc5c (diff)
downloadu-boot-imx-5561a841487fa246ebc6df17bed8eabfa33f3557.zip
u-boot-imx-5561a841487fa246ebc6df17bed8eabfa33f3557.tar.gz
u-boot-imx-5561a841487fa246ebc6df17bed8eabfa33f3557.tar.bz2
fpga: altera: Clean up altera_validate function
Boldly go, where no programmer has gone before and just clean up the indentation mayhem. No functional change. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Chin Liang See <clsee@altera.com> Cc: Dinh Nguyen <dinguyen@altera.com> Cc: Albert Aribaud <albert.u.boot@aribaud.net> Cc: Tom Rini <trini@ti.com> Cc: Wolfgang Denk <wd@denx.de> Cc: Pavel Machek <pavel@denx.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/fpga/altera.c43
1 files changed, 21 insertions, 22 deletions
diff --git a/drivers/fpga/altera.c b/drivers/fpga/altera.c
index ed3f0c8..6394afe 100644
--- a/drivers/fpga/altera.c
+++ b/drivers/fpga/altera.c
@@ -195,32 +195,31 @@ int altera_info( Altera_desc *desc )
/* ------------------------------------------------------------------------- */
-static int altera_validate (Altera_desc * desc, const char *fn)
+static int altera_validate(Altera_desc *desc, const char *fn)
{
- int ret_val = false;
-
- if (desc) {
- if ((desc->family > min_altera_type) &&
- (desc->family < max_altera_type)) {
- if ((desc->iface > min_altera_iface_type) &&
- (desc->iface < max_altera_iface_type)) {
- if (desc->size) {
- ret_val = true;
- } else {
- printf("%s: NULL part size\n", fn);
- }
- } else {
- printf("%s: Invalid Interface type, %d\n",
- fn, desc->iface);
- }
- } else {
- printf("%s: Invalid family type, %d\n", fn, desc->family);
- }
- } else {
+ if (!desc) {
printf("%s: NULL descriptor!\n", fn);
+ return false;
}
- return ret_val;
+ 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;
}
/* ------------------------------------------------------------------------- */