fpga: altera: Clean up altera_validate function
authorMarek Vasut <marex@denx.de>
Tue, 16 Sep 2014 18:26:07 +0000 (20:26 +0200)
committerMarek Vasut <marex@denx.de>
Mon, 6 Oct 2014 15:31:41 +0000 (17:31 +0200)
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>
drivers/fpga/altera.c

index ed3f0c882f77f2b1c09b85f46238b48e356e7fb8..6394afe095a7ce5994d275969be406b909620033 100644 (file)
@@ -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;
 }
 
 /* ------------------------------------------------------------------------- */