flash: convert 'unsigned' to 'unsigned int'
Conversion done with checkpatch --fix-inplace -types UNSPECIFIED_INT Ignore the cast as they could be better addressed. Fix only minor additional checkpatch issue (spacing and line length). Change-Id: Id808747855a02052f3738e2d232bff4dd99b27f1 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8479 Tested-by: jenkins Reviewed-by: zapb <dev@zapb.de>
This commit is contained in:
@@ -154,15 +154,15 @@ struct sam3_bank_private {
|
||||
struct sam3_chip *chip;
|
||||
/* so we can find the original bank pointer */
|
||||
struct flash_bank *bank;
|
||||
unsigned bank_number;
|
||||
unsigned int bank_number;
|
||||
uint32_t controller_address;
|
||||
uint32_t base_address;
|
||||
uint32_t flash_wait_states;
|
||||
bool present;
|
||||
unsigned size_bytes;
|
||||
unsigned nsectors;
|
||||
unsigned sector_size;
|
||||
unsigned page_size;
|
||||
unsigned int size_bytes;
|
||||
unsigned int nsectors;
|
||||
unsigned int sector_size;
|
||||
unsigned int page_size;
|
||||
};
|
||||
|
||||
struct sam3_chip_details {
|
||||
@@ -176,12 +176,12 @@ struct sam3_chip_details {
|
||||
uint32_t chipid_cidr;
|
||||
const char *name;
|
||||
|
||||
unsigned n_gpnvms;
|
||||
unsigned int n_gpnvms;
|
||||
#define SAM3_N_NVM_BITS 3
|
||||
unsigned gpnvm[SAM3_N_NVM_BITS];
|
||||
unsigned total_flash_size;
|
||||
unsigned total_sram_size;
|
||||
unsigned n_banks;
|
||||
unsigned int gpnvm[SAM3_N_NVM_BITS];
|
||||
unsigned int total_flash_size;
|
||||
unsigned int total_sram_size;
|
||||
unsigned int n_banks;
|
||||
#define SAM3_MAX_FLASH_BANKS 2
|
||||
/* these are "initialized" from the global const data */
|
||||
struct sam3_bank_private bank[SAM3_MAX_FLASH_BANKS];
|
||||
@@ -2029,7 +2029,7 @@ static int efc_get_result(struct sam3_bank_private *private, uint32_t *v)
|
||||
}
|
||||
|
||||
static int efc_start_command(struct sam3_bank_private *private,
|
||||
unsigned command, unsigned argument)
|
||||
unsigned int command, unsigned int argument)
|
||||
{
|
||||
uint32_t n, v;
|
||||
int r;
|
||||
@@ -2124,8 +2124,8 @@ do_retry:
|
||||
* @param status - put command status bits here
|
||||
*/
|
||||
static int efc_perform_command(struct sam3_bank_private *private,
|
||||
unsigned command,
|
||||
unsigned argument,
|
||||
unsigned int command,
|
||||
unsigned int argument,
|
||||
uint32_t *status)
|
||||
{
|
||||
|
||||
@@ -2220,7 +2220,7 @@ static int flashd_erase_entire_bank(struct sam3_bank_private *private)
|
||||
* @param puthere - result stored here.
|
||||
*/
|
||||
/* ------------------------------------------------------------------------------ */
|
||||
static int flashd_get_gpnvm(struct sam3_bank_private *private, unsigned gpnvm, unsigned *puthere)
|
||||
static int flashd_get_gpnvm(struct sam3_bank_private *private, unsigned int gpnvm, unsigned int *puthere)
|
||||
{
|
||||
uint32_t v;
|
||||
int r;
|
||||
@@ -2261,10 +2261,10 @@ static int flashd_get_gpnvm(struct sam3_bank_private *private, unsigned gpnvm, u
|
||||
* @param gpnvm GPNVM index.
|
||||
* @returns 0 if successful; otherwise returns an error code.
|
||||
*/
|
||||
static int flashd_clr_gpnvm(struct sam3_bank_private *private, unsigned gpnvm)
|
||||
static int flashd_clr_gpnvm(struct sam3_bank_private *private, unsigned int gpnvm)
|
||||
{
|
||||
int r;
|
||||
unsigned v;
|
||||
unsigned int v;
|
||||
|
||||
LOG_DEBUG("Here");
|
||||
if (private->bank_number != 0) {
|
||||
@@ -2293,10 +2293,10 @@ static int flashd_clr_gpnvm(struct sam3_bank_private *private, unsigned gpnvm)
|
||||
* @param private info about the bank
|
||||
* @param gpnvm GPNVM index.
|
||||
*/
|
||||
static int flashd_set_gpnvm(struct sam3_bank_private *private, unsigned gpnvm)
|
||||
static int flashd_set_gpnvm(struct sam3_bank_private *private, unsigned int gpnvm)
|
||||
{
|
||||
int r;
|
||||
unsigned v;
|
||||
unsigned int v;
|
||||
|
||||
if (private->bank_number != 0) {
|
||||
LOG_ERROR("GPNVM only works with Bank0");
|
||||
@@ -2346,8 +2346,8 @@ static int flashd_get_lock_bits(struct sam3_bank_private *private, uint32_t *v)
|
||||
*/
|
||||
|
||||
static int flashd_unlock(struct sam3_bank_private *private,
|
||||
unsigned start_sector,
|
||||
unsigned end_sector)
|
||||
unsigned int start_sector,
|
||||
unsigned int end_sector)
|
||||
{
|
||||
int r;
|
||||
uint32_t status;
|
||||
@@ -2376,8 +2376,8 @@ static int flashd_unlock(struct sam3_bank_private *private,
|
||||
* @param end_sector - last sector (inclusive) to lock
|
||||
*/
|
||||
static int flashd_lock(struct sam3_bank_private *private,
|
||||
unsigned start_sector,
|
||||
unsigned end_sector)
|
||||
unsigned int start_sector,
|
||||
unsigned int end_sector)
|
||||
{
|
||||
uint32_t status;
|
||||
uint32_t pg;
|
||||
@@ -2405,8 +2405,8 @@ static int flashd_lock(struct sam3_bank_private *private,
|
||||
static uint32_t sam3_reg_fieldname(struct sam3_chip *chip,
|
||||
const char *regname,
|
||||
uint32_t value,
|
||||
unsigned shift,
|
||||
unsigned width)
|
||||
unsigned int shift,
|
||||
unsigned int width)
|
||||
{
|
||||
uint32_t v;
|
||||
int hwidth, dwidth;
|
||||
@@ -2491,7 +2491,7 @@ static const char *const sramsize[] = {
|
||||
|
||||
};
|
||||
|
||||
static const struct archnames { unsigned value; const char *name; } archnames[] = {
|
||||
static const struct archnames { unsigned int value; const char *name; } archnames[] = {
|
||||
{ 0x19, "AT91SAM9xx Series" },
|
||||
{ 0x29, "AT91SAM9XExx Series" },
|
||||
{ 0x34, "AT91x34 Series" },
|
||||
@@ -2951,7 +2951,7 @@ static int sam3_protect_check(struct flash_bank *bank)
|
||||
{
|
||||
int r;
|
||||
uint32_t v = 0;
|
||||
unsigned x;
|
||||
unsigned int x;
|
||||
struct sam3_bank_private *private;
|
||||
|
||||
LOG_DEBUG("Begin");
|
||||
@@ -3071,7 +3071,7 @@ static int sam3_get_details(struct sam3_bank_private *private)
|
||||
const struct sam3_chip_details *details;
|
||||
struct sam3_chip *chip;
|
||||
struct flash_bank *saved_banks[SAM3_MAX_FLASH_BANKS];
|
||||
unsigned x;
|
||||
unsigned int x;
|
||||
|
||||
LOG_DEBUG("Begin");
|
||||
details = all_sam3_details;
|
||||
@@ -3264,7 +3264,7 @@ static int sam3_protect(struct flash_bank *bank, int set, unsigned int first,
|
||||
|
||||
}
|
||||
|
||||
static int sam3_page_read(struct sam3_bank_private *private, unsigned pagenum, uint8_t *buf)
|
||||
static int sam3_page_read(struct sam3_bank_private *private, unsigned int pagenum, uint8_t *buf)
|
||||
{
|
||||
uint32_t adr;
|
||||
int r;
|
||||
@@ -3283,7 +3283,7 @@ static int sam3_page_read(struct sam3_bank_private *private, unsigned pagenum, u
|
||||
return r;
|
||||
}
|
||||
|
||||
static int sam3_page_write(struct sam3_bank_private *private, unsigned pagenum, const uint8_t *buf)
|
||||
static int sam3_page_write(struct sam3_bank_private *private, unsigned int pagenum, const uint8_t *buf)
|
||||
{
|
||||
uint32_t adr;
|
||||
uint32_t status;
|
||||
@@ -3347,10 +3347,10 @@ static int sam3_write(struct flash_bank *bank,
|
||||
uint32_t count)
|
||||
{
|
||||
int n;
|
||||
unsigned page_cur;
|
||||
unsigned page_end;
|
||||
unsigned int page_cur;
|
||||
unsigned int page_end;
|
||||
int r;
|
||||
unsigned page_offset;
|
||||
unsigned int page_offset;
|
||||
struct sam3_bank_private *private;
|
||||
uint8_t *pagebuffer;
|
||||
|
||||
@@ -3497,7 +3497,7 @@ COMMAND_HANDLER(sam3_handle_info_command)
|
||||
if (!chip)
|
||||
return ERROR_OK;
|
||||
|
||||
unsigned x;
|
||||
unsigned int x;
|
||||
int r;
|
||||
|
||||
/* bank0 must exist before we can do anything */
|
||||
@@ -3549,7 +3549,7 @@ need_define:
|
||||
|
||||
COMMAND_HANDLER(sam3_handle_gpnvm_command)
|
||||
{
|
||||
unsigned x, v;
|
||||
unsigned int x, v;
|
||||
int r, who;
|
||||
struct sam3_chip *chip;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user