flash_sector_t -> struct flash_sector
authorZachary T Welch <zw@superlucidity.net>
Fri, 13 Nov 2009 15:37:54 +0000 (07:37 -0800)
committerZachary T Welch <zw@superlucidity.net>
Fri, 13 Nov 2009 19:58:06 +0000 (11:58 -0800)
Remove misleading typedef and redundant suffix from struct flash_sector.

18 files changed:
src/flash/aduc702x.c
src/flash/at91sam7.c
src/flash/avrf.c
src/flash/cfi.c
src/flash/ecos.c
src/flash/faux.c
src/flash/flash.h
src/flash/lpc2000.c
src/flash/lpc288x.c
src/flash/lpc2900.c
src/flash/ocl.c
src/flash/pic32mx.c
src/flash/stellaris.c
src/flash/stm32x.c
src/flash/str7x.c
src/flash/str9x.c
src/flash/str9xpec.c
src/flash/tms470.c

index 0e862e9b8397d1feacf1b0bc3e614862b2f312c6..61ea36a94003585b447d88403d8ad28e5ee8b6bb 100644 (file)
@@ -85,7 +85,7 @@ static int aduc702x_build_sector_list(struct flash_bank_s *bank)
 
         // sector size is 512
         bank->num_sectors = bank->size / 512;
-        bank->sectors = malloc(sizeof(flash_sector_t) * bank->num_sectors);
+        bank->sectors = malloc(sizeof(struct flash_sector) * bank->num_sectors);
         for (i = 0; i < bank->num_sectors; ++i)
         {
                 bank->sectors[i].offset = offset;
index ede5491321fcc315d6621f35c5f21c77e16964d3..fd84e231d3bbc8b28cd1f4640e5f8221a846f524 100644 (file)
@@ -551,7 +551,7 @@ static int at91sam7_read_part_info(struct flash_bank_s *bank)
                t_bank->num_sectors = sectors_num;
 
                /* allocate sectors */
-               t_bank->sectors = malloc(sectors_num * sizeof(flash_sector_t));
+               t_bank->sectors = malloc(sectors_num * sizeof(struct flash_sector));
                for (sec = 0; sec < sectors_num; sec++)
                {
                        t_bank->sectors[sec].offset = sec * pages_per_sector * page_size;
@@ -804,7 +804,7 @@ FLASH_BANK_COMMAND_HANDLER(at91sam7_flash_bank_command)
                t_bank->num_sectors = num_sectors;
 
                /* allocate sectors */
-               t_bank->sectors = malloc(num_sectors * sizeof(flash_sector_t));
+               t_bank->sectors = malloc(num_sectors * sizeof(struct flash_sector));
                for (sec = 0; sec < num_sectors; sec++)
                {
                        t_bank->sectors[sec].offset = sec * pages_per_sector * page_size;
index 7a7eddd98c1a66a47449e7d19b8c00ef683a2e50..fec21cbd2d66ccfea2d45d842af6da4326edee0c 100644 (file)
@@ -306,7 +306,7 @@ static int avrf_probe(struct flash_bank_s *bank)
                bank->base = 0x00000000;
                bank->size = (avr_info->flash_page_size * avr_info->flash_page_num);
                bank->num_sectors = avr_info->flash_page_num;
-               bank->sectors = malloc(sizeof(flash_sector_t) * avr_info->flash_page_num);
+               bank->sectors = malloc(sizeof(struct flash_sector) * avr_info->flash_page_num);
 
                for (i = 0; i < avr_info->flash_page_num; i++)
                {
index 8c20e478ad2e3a6b6b5e4315173ba17aa8fd9add..a3187fe2752a922b88299434b47a3c04884e1c6a 100644 (file)
@@ -2391,7 +2391,7 @@ static int cfi_probe(struct flash_bank_s *bank)
        {
                /* a device might have only one erase block, spanning the whole device */
                bank->num_sectors = 1;
-               bank->sectors = malloc(sizeof(flash_sector_t));
+               bank->sectors = malloc(sizeof(struct flash_sector));
 
                bank->sectors[sector].offset = 0x0;
                bank->sectors[sector].size = bank->size;
@@ -2408,7 +2408,7 @@ static int cfi_probe(struct flash_bank_s *bank)
                }
 
                bank->num_sectors = num_sectors;
-               bank->sectors = malloc(sizeof(flash_sector_t) * num_sectors);
+               bank->sectors = malloc(sizeof(struct flash_sector) * num_sectors);
 
                for (i = 0; i < cfi_info->num_erase_regions; i++)
                {
index 2154da0990cccb539719f0b3b13c1b32edcdb5c3..b508cb12eb5fa1f82154f6ee5b34eb21c92f94fe 100644 (file)
@@ -130,7 +130,7 @@ FLASH_BANK_COMMAND_HANDLER(ecosflash_flash_bank_command)
        int i = 0;
        uint32_t offset = 0;
        bank->num_sectors = bank->size/sectorSize;
-       bank->sectors = malloc(sizeof(flash_sector_t) * bank->num_sectors);
+       bank->sectors = malloc(sizeof(struct flash_sector) * bank->num_sectors);
        for (i = 0; i < bank->num_sectors; i++)
        {
                bank->sectors[i].offset = offset;
index d0f3f706d86ac48cb0e352c60accc4df2438e5d0..b7622f3b1cdec5aa6a53cfbd8f1ad0e3cb6a51f5 100644 (file)
@@ -66,7 +66,7 @@ FLASH_BANK_COMMAND_HANDLER(faux_flash_bank_command)
        int i = 0;
        uint32_t offset = 0;
        bank->num_sectors = bank->size/sectorSize;
-       bank->sectors = malloc(sizeof(flash_sector_t) * bank->num_sectors);
+       bank->sectors = malloc(sizeof(struct flash_sector) * bank->num_sectors);
        for (i = 0; i < bank->num_sectors; i++)
        {
                bank->sectors[i].offset = offset;
index 7afb13274c2c09a5fc80a136e57569cf45839ba0..d4abcde19c9baa4a86195a0ef71365cbed2911a2 100644 (file)
@@ -38,7 +38,7 @@ struct image_s;
  * within a flash bank.  A single bank typically consists of multiple
  * sectors, each of which can be erased and protected independently.
  */
-typedef struct flash_sector_s
+struct flash_sector
 {
        /// Bus offset from start of the flash chip (in bytes).
        uint32_t offset;
@@ -55,7 +55,7 @@ typedef struct flash_sector_s
         * @c flash_driver_s::protect_check.
         */
        int is_protected;
-} flash_sector_t;
+};
 
 struct flash_bank_s;
 
@@ -259,7 +259,7 @@ typedef struct flash_bank_s
         */
        int num_sectors;
        /// Array of sectors, allocated and initilized by the flash driver
-       flash_sector_t *sectors;
+       struct flash_sector *sectors;
 
        struct flash_bank_s *next; /**< The next flash bank on this chip */
 } flash_bank_t;
index 0481355c5f0185bea148c9d6c2b1b09f930b6bee..308a25cdd9a1049a60af29e067e941c94de9cfac 100644 (file)
@@ -68,7 +68,7 @@ static int lpc2000_build_sector_list(struct flash_bank_s *bank)
                if (bank->size == 128 * 1024)
                {
                        bank->num_sectors = 16;
-                       bank->sectors = malloc(sizeof(flash_sector_t) * 16);
+                       bank->sectors = malloc(sizeof(struct flash_sector) * 16);
                        for (i = 0; i < 16; i++)
                        {
                                bank->sectors[i].offset = offset;
@@ -81,7 +81,7 @@ static int lpc2000_build_sector_list(struct flash_bank_s *bank)
                else if (bank->size == 256 * 1024)
                {
                        bank->num_sectors = 18;
-                       bank->sectors = malloc(sizeof(flash_sector_t) * 18);
+                       bank->sectors = malloc(sizeof(struct flash_sector) * 18);
 
                        for (i = 0; i < 8; i++)
                        {
@@ -152,7 +152,7 @@ static int lpc2000_build_sector_list(struct flash_bank_s *bank)
                                break;
                }
 
-               bank->sectors = malloc(sizeof(flash_sector_t) * bank->num_sectors);
+               bank->sectors = malloc(sizeof(struct flash_sector) * bank->num_sectors);
 
                for (i = 0; i < bank->num_sectors; i++)
                {
@@ -206,7 +206,7 @@ static int lpc2000_build_sector_list(struct flash_bank_s *bank)
                                exit(-1);
                }
 
-               bank->sectors = malloc(sizeof(flash_sector_t) * bank->num_sectors);
+               bank->sectors = malloc(sizeof(struct flash_sector) * bank->num_sectors);
 
                for(i = 0; i < bank->num_sectors; i++)
                {
index 3c3e1e484621d290e569690ff122efc918260924..52d31a8ae5458fb1165a04b112f0971f3e0a2cd4 100644 (file)
@@ -137,7 +137,7 @@ static int lpc288x_read_part_info(struct flash_bank_s *bank)
        /* setup the sector info... */
        offset = bank->base;
        bank->num_sectors = 23;
-       bank->sectors = malloc(sizeof(flash_sector_t) * 23);
+       bank->sectors = malloc(sizeof(struct flash_sector) * 23);
 
        for (i = 0; i < 15; i++)
        {
index 83593792e69be395c5447cf17b8e7073ea21823a..fd265bd7ddeb85fc41aa9a6127a22ab044dc4f77 100644 (file)
@@ -1702,7 +1702,7 @@ static int lpc2900_probe(struct flash_bank_s *bank)
         * the logical flash number are translated into the physical flash numbers
         * of the device.
         */
-       bank->sectors = malloc(sizeof(flash_sector_t) * bank->num_sectors);
+       bank->sectors = malloc(sizeof(struct flash_sector) * bank->num_sectors);
 
        offset = 0;
        for (i = 0; i < bank->num_sectors; i++)
index 63e9282fc1adca48d22afd8938ee06de891f06c9..239f9f5c042ba73c91c719e02cc42ffae3d7618e 100644 (file)
@@ -290,7 +290,7 @@ static int ocl_probe(struct flash_bank_s *bank)
        ocl->buflen = dcc_buffer[0] & 0xffff;
        ocl->bufalign = dcc_buffer[0] >> 16;
 
-       bank->sectors = realloc(bank->sectors, sizeof(flash_sector_t)*bank->num_sectors);
+       bank->sectors = realloc(bank->sectors, sizeof(struct flash_sector)*bank->num_sectors);
        if (bank->num_sectors == 0)
        {
                LOG_ERROR("number of sectors shall be non zero value");
index 1408fe9cc5b3dc6af1ca7a91c0521cb67cf0b3a4..438630a179b9f835b283341e63566f4a74f5e596 100644 (file)
@@ -607,7 +607,7 @@ static int pic32mx_probe(struct flash_bank_s *bank)
        bank->num_sectors = num_pages;
        bank->chip_width = 4;
        bank->bus_width  = 4;
-       bank->sectors = malloc(sizeof(flash_sector_t) * num_pages);
+       bank->sectors = malloc(sizeof(struct flash_sector) * num_pages);
 
        for (i = 0; i < num_pages; i++)
        {
index d66b9a8a880a68697b4fc6ccea9622a2a73521fa..dc35c59eeeef4d1810dce6fa70877ab42588d1f0 100644 (file)
@@ -592,7 +592,7 @@ static int stellaris_read_part_info(struct flash_bank_s *bank)
 
        /* provide this for the benefit of the higher flash driver layers */
        bank->num_sectors = stellaris_info->num_pages;
-       bank->sectors = malloc(sizeof(flash_sector_t) * bank->num_sectors);
+       bank->sectors = malloc(sizeof(struct flash_sector) * bank->num_sectors);
        for (i = 0; i < bank->num_sectors; i++)
        {
                bank->sectors[i].offset = i * stellaris_info->pagesize;
index 41b9008f70495f763fc95c7b7a072dd533a315a7..8725fad63ba1d0012a9f9a5b678f531a7b8c8880 100644 (file)
@@ -756,7 +756,7 @@ static int stm32x_probe(struct flash_bank_s *bank)
        bank->base = 0x08000000;
        bank->size = (num_pages * page_size);
        bank->num_sectors = num_pages;
-       bank->sectors = malloc(sizeof(flash_sector_t) * num_pages);
+       bank->sectors = malloc(sizeof(struct flash_sector) * num_pages);
 
        for (i = 0; i < num_pages; i++)
        {
index 9738180e01f3065cdcd0dcaf51f7a1cd0c5a6ba0..dbb587235d30d7ad44ec7d3c566149235adeddab 100644 (file)
@@ -81,7 +81,7 @@ static int str7x_build_block_list(struct flash_bank_s *bank)
        num_sectors = b0_sectors + b1_sectors;
 
        bank->num_sectors = num_sectors;
-       bank->sectors = malloc(sizeof(flash_sector_t) * num_sectors);
+       bank->sectors = malloc(sizeof(struct flash_sector) * num_sectors);
        str7x_info->sector_bits = malloc(sizeof(uint32_t) * num_sectors);
 
        num_sectors = 0;
index cdee571939881fbc125f2c8d9c687d980942dcfa..caabd993c6b0730dce1ccaab1db2a8885e970792 100644 (file)
@@ -83,7 +83,7 @@ static int str9x_build_block_list(struct flash_bank_s *bank)
        num_sectors = b0_sectors + b1_sectors;
 
        bank->num_sectors = num_sectors;
-       bank->sectors = malloc(sizeof(flash_sector_t) * num_sectors);
+       bank->sectors = malloc(sizeof(struct flash_sector) * num_sectors);
        str9x_info->sector_bits = malloc(sizeof(uint32_t) * num_sectors);
 
        num_sectors = 0;
index 83566df88fd72955c8dc1c066f1cd890098ad4cb..6b85e6a14a593924948f75a7d1fb07a95046dce7 100644 (file)
@@ -205,7 +205,7 @@ static int str9xpec_build_block_list(struct flash_bank_s *bank)
        num_sectors = b0_sectors + b1_sectors;
 
        bank->num_sectors = num_sectors;
-       bank->sectors = malloc(sizeof(flash_sector_t) * num_sectors);
+       bank->sectors = malloc(sizeof(struct flash_sector) * num_sectors);
        str9xpec_info->sector_bits = malloc(sizeof(uint32_t) * num_sectors);
 
        num_sectors = 0;
index d33ccd6793303fbd9ae7cb05d7d1c5c6c1c69860..75b233d94e88a714d86833f217705d6b1d8d0517 100644 (file)
@@ -28,7 +28,7 @@
                       Internal Support, Helpers
    ---------------------------------------------------------------------- */
 
-const flash_sector_t TMS470R1A256_SECTORS[] = {
+const struct flash_sector TMS470R1A256_SECTORS[] = {
        {0x00000000, 0x00002000, -1, -1},
        {0x00002000, 0x00002000, -1, -1},
        {0x00004000, 0x00002000, -1, -1},
@@ -48,7 +48,7 @@ const flash_sector_t TMS470R1A256_SECTORS[] = {
 #define TMS470R1A256_NUM_SECTORS \
        (sizeof(TMS470R1A256_SECTORS)/sizeof(TMS470R1A256_SECTORS[0]))
 
-const flash_sector_t TMS470R1A288_BANK0_SECTORS[] = {
+const struct flash_sector TMS470R1A288_BANK0_SECTORS[] = {
        {0x00000000, 0x00002000, -1, -1},
        {0x00002000, 0x00002000, -1, -1},
        {0x00004000, 0x00002000, -1, -1},
@@ -58,7 +58,7 @@ const flash_sector_t TMS470R1A288_BANK0_SECTORS[] = {
 #define TMS470R1A288_BANK0_NUM_SECTORS \
        (sizeof(TMS470R1A288_BANK0_SECTORS)/sizeof(TMS470R1A288_BANK0_SECTORS[0]))
 
-const flash_sector_t TMS470R1A288_BANK1_SECTORS[] = {
+const struct flash_sector TMS470R1A288_BANK1_SECTORS[] = {
        {0x00040000, 0x00010000, -1, -1},
        {0x00050000, 0x00010000, -1, -1},
        {0x00060000, 0x00010000, -1, -1},
@@ -68,7 +68,7 @@ const flash_sector_t TMS470R1A288_BANK1_SECTORS[] = {
 #define TMS470R1A288_BANK1_NUM_SECTORS \
        (sizeof(TMS470R1A288_BANK1_SECTORS)/sizeof(TMS470R1A288_BANK1_SECTORS[0]))
 
-const flash_sector_t TMS470R1A384_BANK0_SECTORS[] = {
+const struct flash_sector TMS470R1A384_BANK0_SECTORS[] = {
        {0x00000000, 0x00002000, -1, -1},
        {0x00002000, 0x00002000, -1, -1},
        {0x00004000, 0x00004000, -1, -1},
@@ -84,7 +84,7 @@ const flash_sector_t TMS470R1A384_BANK0_SECTORS[] = {
 #define TMS470R1A384_BANK0_NUM_SECTORS \
        (sizeof(TMS470R1A384_BANK0_SECTORS)/sizeof(TMS470R1A384_BANK0_SECTORS[0]))
 
-const flash_sector_t TMS470R1A384_BANK1_SECTORS[] = {
+const struct flash_sector TMS470R1A384_BANK1_SECTORS[] = {
        {0x00020000, 0x00008000, -1, -1},
        {0x00028000, 0x00008000, -1, -1},
        {0x00030000, 0x00008000, -1, -1},
@@ -94,7 +94,7 @@ const flash_sector_t TMS470R1A384_BANK1_SECTORS[] = {
 #define TMS470R1A384_BANK1_NUM_SECTORS \
        (sizeof(TMS470R1A384_BANK1_SECTORS)/sizeof(TMS470R1A384_BANK1_SECTORS[0]))
 
-const flash_sector_t TMS470R1A384_BANK2_SECTORS[] = {
+const struct flash_sector TMS470R1A384_BANK2_SECTORS[] = {
        {0x00040000, 0x00008000, -1, -1},
        {0x00048000, 0x00008000, -1, -1},
        {0x00050000, 0x00008000, -1, -1},