Audit and eliminate redundant #include directives in src/flash sources.
[openocd.git] / src / flash / stellaris.c
index bf268b5867b7ee518e660d4718c52eec69a7970a..38ded4f1ae4bebaee3ec91f25616dc268719cffc 100644 (file)
 #include "config.h"
 #endif
 
-#include "replacements.h"
-
 #include "stellaris.h"
-#include "cortex_m3.h"
-
-#include "flash.h"
-#include "target.h"
-#include "log.h"
+#include "armv7m.h"
 #include "binarybuffer.h"
-#include "types.h"
 
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
 
 #define DID0_VER(did0) ((did0>>28)&0x07)
 static int stellaris_register_commands(struct command_context_s *cmd_ctx);
@@ -59,7 +49,6 @@ static u32 stellaris_get_flash_status(flash_bank_t *bank);
 static void stellaris_set_flash_mode(flash_bank_t *bank,int mode);
 //static u32 stellaris_wait_status_busy(flash_bank_t *bank, u32 waitbits, int timeout);
 
-static int stellaris_read_part_info(struct flash_bank_s *bank);
 static int stellaris_handle_mass_erase_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
 static int stellaris_mass_erase(struct flash_bank_s *bank);
 
@@ -570,12 +559,12 @@ static int stellaris_erase(struct flash_bank_s *bank, int first, int last)
                return ERROR_FLASH_OPERATION_FAILED;
        }       
        
-       if ((first < 0) || (last < first) || (last >= stellaris_info->num_pages))
+       if ((first < 0) || (last < first) || (last >= (int)stellaris_info->num_pages))
        {
                return ERROR_FLASH_SECTOR_INVALID;
        }
        
-       if ((first == 0) && (last == (stellaris_info->num_pages-1)))
+       if ((first == 0) && (last == ((int)stellaris_info->num_pages-1)))
        {
                return stellaris_mass_erase(bank);
        }
@@ -821,7 +810,7 @@ static int stellaris_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u3
        u32 words_remaining = (count / 4);
        u32 bytes_remaining = (count & 0x00000003);
        u32 bytes_written = 0;
-       u32 retval;
+       int retval;
        
        if (bank->target->state != TARGET_HALTED)
        {

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)