flash_sector_t -> struct flash_sector

Remove misleading typedef and redundant suffix from struct flash_sector.
This commit is contained in:
Zachary T Welch 2009-11-13 07:37:54 -08:00
parent 98d7ed8523
commit fb59ec739a
18 changed files with 30 additions and 30 deletions

View 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;

View 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;

View 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++)
{

View 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++)
{

View 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;

View 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;

View 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;

View 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++)
{

View 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++)
{

View 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++)

View 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");

View 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++)
{

View 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;

View 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++)
{

View 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;

View 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;

View 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;

View 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},