Duane Ellis: fix warnings
[fw/openocd] / src / flash / flash.c
index 16c2633b18edfdc32d24459aafe67de495c65bf7..71d054f5051bde8f4056a8bbc2b932424d66d65e 100644 (file)
@@ -2,6 +2,9 @@
  *   Copyright (C) 2005 by Dominic Rath                                    *
  *   Dominic.Rath@gmx.de                                                   *
  *                                                                         *
+ *   Copyright (C) 2007,2008 Ã˜yvind Harboe                                      *
+ *   oyvind.harboe@zylin.com                                               *
+ *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   it under the terms of the GNU General Public License as published by  *
  *   the Free Software Foundation; either version 2 of the License, or     *
@@ -141,12 +144,12 @@ int flash_register_commands(struct command_context_s *cmd_ctx)
 
 static int jim_flash_banks(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 {
+       flash_bank_t *p;
+       
        if (argc != 1) {
                Jim_WrongNumArgs(interp, 1, argv, "no arguments to flash_banks command");
                return JIM_ERR;
        }
-       flash_bank_t *p;
-       int i = 0;
 
        if (!flash_banks)
        {
@@ -158,7 +161,6 @@ static int jim_flash_banks(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
        {
                Jim_Obj *elem=Jim_NewListObj(interp, NULL, 0);
                
-
                Jim_ListAppendElement(interp, elem, Jim_NewStringObj(interp, "name", -1));
                Jim_ListAppendElement(interp, elem, Jim_NewStringObj(interp, p->driver->name, -1));
                Jim_ListAppendElement(interp, elem, Jim_NewStringObj(interp, "base", -1));
@@ -178,12 +180,11 @@ static int jim_flash_banks(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
        return JIM_OK;
 }
 
-
 int flash_init_drivers(struct command_context_s *cmd_ctx)
 {
        if (flash_banks)
        {
-               register_jim(cmd_ctx, "openocd_flash_banks", jim_flash_banks, "return information about the flash banks");
+               register_jim(cmd_ctx, "ocd_flash_banks", jim_flash_banks, "return information about the flash banks");
                
                register_command(cmd_ctx, flash_cmd, "info", handle_flash_info_command, COMMAND_EXEC,
                                                 "print info about flash bank <num>");
@@ -232,7 +233,7 @@ flash_bank_t *get_flash_bank_by_num_noprobe(int num)
        return NULL;
 }
 
-int flash_get_bank_count()
+int flash_get_bank_count(void)
 {
        flash_bank_t *p;
        int i = 0;