flash: declare local symbols as static

Functions and variables that are not used outside the file should
be declared as static.

Change-Id: I52d46ed6d4c9b98a7152eb23274c836416f409a3
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5893
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
This commit is contained in:
Antonio Borneo 2020-10-28 23:27:02 +01:00
parent 5bb0f6befb
commit 21bc36c4d7
9 changed files with 19 additions and 15 deletions

View File

@ -860,7 +860,7 @@ static int validate_target_state(struct nand_device *nand)
return ERROR_OK;
}
int ecc_status_v1(struct nand_device *nand)
static int ecc_status_v1(struct nand_device *nand)
{
struct mxc_nf_controller *mxc_nf_info = nand->controller_priv;
struct target *target = nand->target;
@ -886,7 +886,7 @@ int ecc_status_v1(struct nand_device *nand)
return ERROR_OK;
}
int ecc_status_v2(struct nand_device *nand)
static int ecc_status_v2(struct nand_device *nand)
{
struct mxc_nf_controller *mxc_nf_info = nand->controller_priv;
struct target *target = nand->target;

View File

@ -3099,7 +3099,7 @@ FLASH_BANK_COMMAND_HANDLER(sam3_flash_bank_command)
* is owned by this bank. This simplification works only for one shot
* deallocation like current flash_free_all_banks()
*/
void sam3_free_driver_priv(struct flash_bank *bank)
static void sam3_free_driver_priv(struct flash_bank *bank)
{
struct sam3_chip *chip = all_sam3_chips;
while (chip) {

View File

@ -43,7 +43,7 @@ struct flash_ctrl_priv_data {
char *part_name;
};
const struct flash_ctrl_priv_data flash_priv_data_1 = {
static const struct flash_ctrl_priv_data flash_priv_data_1 = {
.die_id_reg = 0x4090001C,
.jtag_idcode_reg = 0x40900028,
.flash_base = 0x10040000,
@ -53,7 +53,7 @@ const struct flash_ctrl_priv_data flash_priv_data_1 = {
.part_name = "BLUENRG-1",
};
const struct flash_ctrl_priv_data flash_priv_data_2 = {
static const struct flash_ctrl_priv_data flash_priv_data_2 = {
.die_id_reg = 0x4090001C,
.jtag_idcode_reg = 0x40900028,
.flash_base = 0x10040000,
@ -63,7 +63,7 @@ const struct flash_ctrl_priv_data flash_priv_data_2 = {
.part_name = "BLUENRG-2",
};
const struct flash_ctrl_priv_data flash_priv_data_lp = {
static const struct flash_ctrl_priv_data flash_priv_data_lp = {
.die_id_reg = 0x40000000,
.jtag_idcode_reg = 0x40000004,
.flash_base = 0x10040000,
@ -79,7 +79,11 @@ struct bluenrgx_flash_bank {
const struct flash_ctrl_priv_data *flash_ptr;
};
const struct flash_ctrl_priv_data *flash_ctrl[] = {&flash_priv_data_1, &flash_priv_data_2, &flash_priv_data_lp};
static const struct flash_ctrl_priv_data *flash_ctrl[] = {
&flash_priv_data_1,
&flash_priv_data_2,
&flash_priv_data_lp
};
/* flash_bank bluenrg-x 0 0 0 0 <target#> */
FLASH_BANK_COMMAND_HANDLER(bluenrgx_flash_bank_command)

View File

@ -434,7 +434,7 @@ static int kinetis_ke_prepare_flash(struct flash_bank *bank)
return ERROR_OK;
}
int kinetis_ke_stop_watchdog(struct target *target)
static int kinetis_ke_stop_watchdog(struct target *target)
{
struct working_area *watchdog_algorithm;
struct armv7m_algorithm armv7m_info;

View File

@ -761,7 +761,7 @@ static int mrvlqspi_flash_write(struct flash_bank *bank, const uint8_t *buffer,
return retval;
}
int mrvlqspi_flash_read(struct flash_bank *bank, uint8_t *buffer,
static int mrvlqspi_flash_read(struct flash_bank *bank, uint8_t *buffer,
uint32_t offset, uint32_t count)
{
struct target *target = bank->target;
@ -914,7 +914,7 @@ static int mrvlqspi_flash_erase_check(struct flash_bank *bank)
return ERROR_OK;
}
int mrvlqspi_get_info(struct flash_bank *bank, char *buf, int buf_size)
static int mrvlqspi_get_info(struct flash_bank *bank, char *buf, int buf_size)
{
struct mrvlqspi_flash_bank *mrvlqspi_info = bank->driver_priv;

View File

@ -139,7 +139,7 @@ struct psoc4_chip_family {
uint32_t flags;
};
const struct psoc4_chip_family psoc4_families[] = {
static const struct psoc4_chip_family psoc4_families[] = {
{ 0x93, "PSoC4100/4200", .flags = PSOC4_FAMILY_FLAG_LEGACY },
{ 0x9A, "PSoC4000", .flags = 0 },
{ 0x9E, "PSoC/PRoC BLE (119E)", .flags = 0 },

View File

@ -908,7 +908,7 @@ COMMAND_HANDLER(psoc6_handle_mass_erase_command)
* @param target current target
* @return ERROR_OK in case of success, ERROR_XXX code otherwise
*************************************************************************************************/
int handle_reset_halt(struct target *target)
static int handle_reset_halt(struct target *target)
{
int hr;
uint32_t reset_addr;

View File

@ -30,7 +30,7 @@
* Implements Tcl commands used to access NOR flash facilities.
*/
COMMAND_HELPER(flash_command_get_bank_maybe_probe, unsigned name_index,
static COMMAND_HELPER(flash_command_get_bank_maybe_probe, unsigned name_index,
struct flash_bank **bank, bool do_probe)
{
const char *name = CMD_ARGV[name_index];

View File

@ -45,7 +45,7 @@
#define ID_XCF32P 0x05059093
#define ID_MEANINGFUL_MASK 0x0FFFFFFF
const char *xcf_name_list[] = {
static const char * const xcf_name_list[] = {
"XCF08P",
"XCF16P",
"XCF32P",
@ -399,7 +399,7 @@ static void flip_u8(uint8_t *out, const uint8_t *in, int len)
* Function presumes need of bit reversing if it can not exactly detects
* the opposite.
*/
bool need_bit_reverse(const uint8_t *buffer)
static bool need_bit_reverse(const uint8_t *buffer)
{
const size_t L = 20;
uint8_t reference[L];