Some functions use the wrong code style and generate checkpatch errors.
Fix these.
Signed-off-by: Simon Glass <sjg@chromium.org>
flash_info_t flash_info[CONFIG_SYS_MAX_FLASH_BANKS];
static u32 pagesize;
-unsigned long flash_init (void)
+unsigned long flash_init(void)
{
at91_eefc_t *eefc = (at91_eefc_t *) ATMEL_BASE_EEFC;
at91_dbu_t *dbu = (at91_dbu_t *) ATMEL_BASE_DBGU;
return size;
}
-void flash_print_info (flash_info_t *info)
+void flash_print_info(flash_info_t *info)
{
int i;
& (AT91_EEFC_FSR_FCMDE | AT91_EEFC_FSR_FLOCKE);
}
-int flash_erase (flash_info_t *info, int s_first, int s_last)
+int flash_erase(flash_info_t *info, int s_first, int s_last)
{
debug("erase first=%d last=%d\n", s_first, s_last);
puts("this flash does not need and support erasing!\n");
* 1 - write timeout
*/
-int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt)
+int write_buff(flash_info_t *info, uchar *src, ulong addr, ulong cnt)
{
u32 pagenum;
u32 *src32, *dst32;
flash_info_t flash_info[CONFIG_SYS_MAX_FLASH_BANKS];
-void flash_print_info (flash_info_t * info)
+void flash_print_info(flash_info_t *info)
{
int i;
}
-unsigned long flash_init (void)
+unsigned long flash_init(void)
{
int i, j;
ulong size = 0;
size += flash_info[i].size;
}
- flash_protect (FLAG_PROTECT_SET,
- CONFIG_SYS_FLASH_BASE,
- CONFIG_SYS_FLASH_BASE + 0x3ffff, &flash_info[0]);
+ flash_protect(FLAG_PROTECT_SET,
+ CONFIG_SYS_FLASH_BASE,
+ CONFIG_SYS_FLASH_BASE + 0x3ffff, &flash_info[0]);
return size;
}
#define TMO 4
-int flash_erase (flash_info_t * info, int s_first, int s_last)
+int flash_erase(flash_info_t *info, int s_first, int s_last)
{
ulong result;
int iflag, cflag, prot, sect;
return rc;
}
-static int write_word (flash_info_t * info, ulong dest, ulong data)
+static int write_word(flash_info_t *info, ulong dest, ulong data)
{
volatile u16 *addr = (volatile u16 *) dest;
ulong result;
}
-int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt)
+int write_buff(flash_info_t *info, uchar *src, ulong addr, ulong cnt)
{
ulong wp, data;
int rc;
/*
* Re-do flash protection upon new addresses
*/
- flash_protect (FLAG_PROTECT_CLEAR,
- gd->bd->bi_flashstart, 0xffffffff,
- &flash_info[CONFIG_SYS_MAX_FLASH_BANKS - 1]);
+ flash_protect(FLAG_PROTECT_CLEAR,
+ gd->bd->bi_flashstart, 0xffffffff,
+ &flash_info[CONFIG_SYS_MAX_FLASH_BANKS - 1]);
/* Monitor protection ON by default */
- flash_protect (FLAG_PROTECT_SET,
- CONFIG_SYS_MONITOR_BASE, CONFIG_SYS_MONITOR_BASE + monitor_flash_len - 1,
- &flash_info[CONFIG_SYS_MAX_FLASH_BANKS - 1]);
+ flash_protect(FLAG_PROTECT_SET,
+ CONFIG_SYS_MONITOR_BASE, CONFIG_SYS_MONITOR_BASE +
+ monitor_flash_len - 1,
+ &flash_info[CONFIG_SYS_MAX_FLASH_BANKS - 1]);
/* Environment protection ON by default */
- flash_protect (FLAG_PROTECT_SET,
- CONFIG_ENV_ADDR,
- CONFIG_ENV_ADDR + CONFIG_ENV_SECT_SIZE - 1,
- &flash_info[CONFIG_SYS_MAX_FLASH_BANKS - 1]);
+ flash_protect(FLAG_PROTECT_SET,
+ CONFIG_ENV_ADDR,
+ CONFIG_ENV_ADDR + CONFIG_ENV_SECT_SIZE - 1,
+ &flash_info[CONFIG_SYS_MAX_FLASH_BANKS - 1]);
/* Redundant environment protection ON by default */
- flash_protect (FLAG_PROTECT_SET,
- CONFIG_ENV_ADDR_REDUND,
- CONFIG_ENV_ADDR_REDUND + CONFIG_ENV_SECT_SIZE - 1,
+ flash_protect(FLAG_PROTECT_SET,
+ CONFIG_ENV_ADDR_REDUND,
+ CONFIG_ENV_ADDR_REDUND + CONFIG_ENV_SECT_SIZE - 1,
&flash_info[CONFIG_SYS_MAX_FLASH_BANKS - 1]);
}
/*
* Take *addr in Flash and adjust it to fall on the end of its sector
*/
-int flash_sect_roundb (ulong *addr)
+int flash_sect_roundb(ulong *addr)
{
flash_info_t *info;
ulong bank, sector_end_addr;
for (bank=0; bank <CONFIG_SYS_MAX_FLASH_BANKS; ++bank) {
printf ("\nBank # %ld: ", bank+1);
- flash_print_info (&flash_info[bank]);
+ flash_print_info(&flash_info[bank]);
}
return 0;
}
return 1;
}
printf ("\nBank # %ld: ", bank);
- flash_print_info (&flash_info[bank-1]);
+ flash_print_info(&flash_info[bank - 1]);
#endif /* CONFIG_MTD_NOR_FLASH */
return 0;
}
for (bank=1; bank<=CONFIG_SYS_MAX_FLASH_BANKS; ++bank) {
printf ("Erase Flash Bank # %ld ", bank);
info = &flash_info[bank-1];
- rcode = flash_erase (info, 0, info->sector_count-1);
+ rcode = flash_erase(info, 0, info->sector_count - 1);
}
return rcode;
}
}
printf ("Erase Flash Bank # %ld ", bank);
info = &flash_info[bank-1];
- rcode = flash_erase (info, 0, info->sector_count-1);
+ rcode = flash_erase(info, 0, info->sector_count - 1);
return rcode;
}
}
#ifdef CONFIG_MTD_NOR_FLASH
-int flash_sect_erase (ulong addr_first, ulong addr_last)
+int flash_sect_erase(ulong addr_first, ulong addr_last)
{
flash_info_t *info;
ulong bank;
info->start[0] + info->size - 1:
info->start[s_last[bank]+1] - 1,
bank+1);
- rcode = flash_erase (info, s_first[bank], s_last[bank]);
+ rcode = flash_erase(info, s_first[bank],
+ s_last[bank]);
}
}
if (rcode == 0)
p ? "" : "Un", argv[1],
bank, addr_first, addr_last);
- rcode = flash_sect_protect (p, addr_first, addr_last);
+ rcode = flash_sect_protect(p, addr_first,
+ addr_last);
return rcode;
}
if (addr_first >= addr_last)
return CMD_RET_USAGE;
- rcode = flash_sect_protect (p, addr_first, addr_last);
+ rcode = flash_sect_protect(p, addr_first, addr_last);
#endif /* CONFIG_MTD_NOR_FLASH */
return rcode;
}
#ifdef CONFIG_MTD_NOR_FLASH
-int flash_sect_protect (int p, ulong addr_first, ulong addr_last)
+int flash_sect_protect(int p, ulong addr_first, ulong addr_last)
{
flash_info_t *info;
ulong bank;
* If necessary you have to map the second bank at lower addresses.
*/
void
-flash_protect (int flag, ulong from, ulong to, flash_info_t *info)
+flash_protect(int flag, ulong from, ulong to, flash_info_t *info)
{
ulong b_end;
short s_end;
*/
flash_info_t *
-addr2info (ulong addr)
+addr2info(ulong addr)
{
flash_info_t *info;
int i;
* (only some targets require alignment)
*/
int
-flash_write (char *src, ulong addr, ulong cnt)
+flash_write(char *src, ulong addr, ulong cnt)
{
int i;
ulong end = addr + cnt - 1;
- flash_info_t *info_first = addr2info (addr);
- flash_info_t *info_last = addr2info (end );
+ flash_info_t *info_first = addr2info(addr);
+ flash_info_t *info_last = addr2info(end);
flash_info_t *info;
__maybe_unused char *src_orig = src;
__maybe_unused char *addr_orig = (char *)addr;
/* Prototypes */
-extern unsigned long flash_init (void);
-extern void flash_print_info (flash_info_t *);
-extern int flash_erase (flash_info_t *, int, int);
-extern int flash_sect_erase (ulong addr_first, ulong addr_last);
-extern int flash_sect_protect (int flag, ulong addr_first, ulong addr_last);
-extern int flash_sect_roundb (ulong *addr);
-extern unsigned long flash_sector_size(flash_info_t *info, flash_sect_t sect);
-extern void flash_set_verbose(uint);
+unsigned long flash_init(void);
+void flash_print_info(flash_info_t *info);
+int flash_erase(flash_info_t *info, int s_first, int s_last);
+int flash_sect_erase(ulong addr_first, ulong addr_last);
+int flash_sect_protect(int flag, ulong addr_first, ulong addr_last);
+int flash_sect_roundb(ulong *addr);
+unsigned long flash_sector_size(flash_info_t *info, flash_sect_t sect);
+void flash_set_verbose(uint v);
/* common/flash.c */
-extern void flash_protect (int flag, ulong from, ulong to, flash_info_t *info);
-extern int flash_write (char *, ulong, ulong);
-extern flash_info_t *addr2info (ulong);
-extern int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt);
+void flash_protect(int flag, ulong from, ulong to, flash_info_t *info);
+int flash_write(char *src, ulong addr, ulong cnt);
+flash_info_t *addr2info(ulong addr);
+int write_buff(flash_info_t *info, uchar *src, ulong addr, ulong cnt);
/* drivers/mtd/cfi_mtd.c */
#ifdef CONFIG_FLASH_CFI_MTD