warnings: use more 'const' for char *
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
This commit is contained in:
parent
8f93c0a3fe
commit
4f9a9b8eba
|
@ -34,7 +34,7 @@ struct mflash_gpio_num
|
|||
|
||||
struct mflash_gpio_drv
|
||||
{
|
||||
char *name;
|
||||
const char *name;
|
||||
int (*set_gpio_to_output) (struct mflash_gpio_num gpio);
|
||||
int (*set_gpio_output_val) (struct mflash_gpio_num gpio, uint8_t val);
|
||||
};
|
||||
|
|
|
@ -59,7 +59,7 @@ struct nand_ecclayout {
|
|||
|
||||
struct nand_device
|
||||
{
|
||||
char *name;
|
||||
const char *name;
|
||||
struct nand_flash_controller *controller;
|
||||
void *controller_priv;
|
||||
struct nand_manufacturer *manufacturer;
|
||||
|
@ -91,12 +91,12 @@ enum
|
|||
struct nand_manufacturer
|
||||
{
|
||||
int id;
|
||||
char *name;
|
||||
const char *name;
|
||||
};
|
||||
|
||||
struct nand_info
|
||||
{
|
||||
char *name;
|
||||
const char *name;
|
||||
int id;
|
||||
int page_size;
|
||||
int chip_size;
|
||||
|
|
|
@ -35,7 +35,7 @@ struct nand_device;
|
|||
struct nand_flash_controller
|
||||
{
|
||||
/** Driver name that is used to select it from configuration files. */
|
||||
char *name;
|
||||
const char *name;
|
||||
|
||||
const struct command_registration *commands;
|
||||
|
||||
|
|
|
@ -125,7 +125,7 @@ struct at91sam7_flash_bank
|
|||
uint16_t cidr_nvpsiz2;
|
||||
uint16_t cidr_eproc;
|
||||
uint16_t cidr_version;
|
||||
char *target_name;
|
||||
const char *target_name;
|
||||
|
||||
/* flash auto-detection */
|
||||
uint8_t flash_autodetection;
|
||||
|
|
|
@ -74,7 +74,7 @@ struct flash_sector
|
|||
*/
|
||||
struct flash_bank
|
||||
{
|
||||
char *name;
|
||||
const char *name;
|
||||
|
||||
struct target *target; /**< Target to which this bank belongs. */
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ struct flash_driver
|
|||
* Gives a human-readable name of this flash driver,
|
||||
* This field is used to select and initialize the driver.
|
||||
*/
|
||||
char *name;
|
||||
const char *name;
|
||||
|
||||
/**
|
||||
* An array of driver-specific commands to register. When called
|
||||
|
|
|
@ -91,7 +91,7 @@ struct lpc288x_flash_bank
|
|||
|
||||
/* chip id register */
|
||||
uint32_t cidr;
|
||||
char * target_name;
|
||||
const char * target_name;
|
||||
uint32_t cclk;
|
||||
|
||||
uint32_t sector_size_break;
|
||||
|
|
|
@ -99,7 +99,7 @@ struct pic32mx_flash_bank
|
|||
|
||||
static const struct pic32mx_devs_s {
|
||||
uint8_t devid;
|
||||
char *name;
|
||||
const char *name;
|
||||
} pic32mx_devs[] = {
|
||||
{0x38, "360F512L"},
|
||||
{0x34, "360F256L"},
|
||||
|
|
|
@ -100,7 +100,7 @@ struct stellaris_flash_bank
|
|||
uint32_t dc0;
|
||||
uint32_t dc1;
|
||||
|
||||
char * target_name;
|
||||
const char * target_name;
|
||||
|
||||
uint32_t sramsiz;
|
||||
uint32_t flshsz;
|
||||
|
@ -125,7 +125,7 @@ struct stellaris_flash_bank
|
|||
|
||||
static struct {
|
||||
uint32_t partno;
|
||||
char *partname;
|
||||
const char *partname;
|
||||
} StellarisParts[] =
|
||||
{
|
||||
{0x0001,"LM3S101"},
|
||||
|
|
|
@ -38,7 +38,7 @@ struct tms470_flash_bank
|
|||
uint32_t technology_family;
|
||||
uint32_t rom_flash;
|
||||
uint32_t part_number;
|
||||
char * part_name;
|
||||
const char * part_name;
|
||||
|
||||
};
|
||||
|
||||
|
@ -129,7 +129,7 @@ static int tms470_read_part_info(struct flash_bank *bank)
|
|||
uint32_t technology_family;
|
||||
uint32_t rom_flash;
|
||||
uint32_t part_number;
|
||||
char *part_name;
|
||||
const char *part_name;
|
||||
|
||||
/* we shall not rely on the caller in this test, this function allocates memory,
|
||||
thus and executing the code more than once may cause memory leak */
|
||||
|
|
|
@ -29,7 +29,7 @@ int main(int argc, char **argv)
|
|||
{
|
||||
int c;
|
||||
unsigned int n;
|
||||
char *name;
|
||||
const char *name;
|
||||
|
||||
if (argc == 1) {
|
||||
fprintf(stderr, "bin2char <varname>\n");
|
||||
|
|
|
@ -310,7 +310,7 @@ static void command_free(struct command *c)
|
|||
}
|
||||
|
||||
if (c->name)
|
||||
free(c->name);
|
||||
free((void *)c->name);
|
||||
if (c->help)
|
||||
free((void*)c->help);
|
||||
if (c->usage)
|
||||
|
|
|
@ -173,7 +173,7 @@ typedef __COMMAND_HANDLER((*command_handler_t));
|
|||
|
||||
struct command
|
||||
{
|
||||
char *name;
|
||||
const char *name;
|
||||
const char *help;
|
||||
const char *usage;
|
||||
struct command *parent;
|
||||
|
|
|
@ -29,7 +29,7 @@ struct pld_device;
|
|||
|
||||
struct pld_driver
|
||||
{
|
||||
char *name;
|
||||
const char *name;
|
||||
__PLD_DEVICE_COMMAND((*pld_device_command));
|
||||
const struct command_registration *commands;
|
||||
int (*load)(struct pld_device *pld_device, const char *filename);
|
||||
|
|
|
@ -306,7 +306,7 @@ static int remove_services(void)
|
|||
struct service *next = c->next;
|
||||
|
||||
if (c->name)
|
||||
free(c->name);
|
||||
free((void *)c->name);
|
||||
|
||||
if (c->type == CONNECTION_PIPE)
|
||||
{
|
||||
|
|
|
@ -57,7 +57,7 @@ typedef int (*connection_closed_handler_t)(struct connection *connection);
|
|||
|
||||
struct service
|
||||
{
|
||||
char *name;
|
||||
const char *name;
|
||||
enum connection_type type;
|
||||
const char *port;
|
||||
unsigned short portnumber;
|
||||
|
|
|
@ -37,7 +37,7 @@ struct mem_param
|
|||
|
||||
struct reg_param
|
||||
{
|
||||
char *reg_name;
|
||||
const char *reg_name;
|
||||
uint32_t size;
|
||||
uint8_t *value;
|
||||
enum param_direction direction;
|
||||
|
|
|
@ -60,7 +60,7 @@ enum arm9tdmi_vector_bit
|
|||
};
|
||||
|
||||
static const struct arm9tdmi_vector {
|
||||
char *name;
|
||||
const char *name;
|
||||
uint32_t value;
|
||||
} arm9tdmi_vectors[] = {
|
||||
{"reset", ARM9TDMI_RESET_VECTOR},
|
||||
|
|
|
@ -2354,7 +2354,7 @@ static int evaluate_add_sp_pc_thumb(uint16_t opcode,
|
|||
uint8_t Rd = (opcode >> 8) & 0x7;
|
||||
uint8_t Rn;
|
||||
uint32_t SP = opcode & (1 << 11);
|
||||
char *reg_name;
|
||||
const char *reg_name;
|
||||
|
||||
instruction->type = ARM_ADD;
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ struct reg armv7m_gdb_dummy_cpsr_reg =
|
|||
*/
|
||||
static const struct {
|
||||
unsigned id;
|
||||
char *name;
|
||||
const char *name;
|
||||
unsigned bits;
|
||||
} armv7m_regs[] = {
|
||||
{ ARMV7M_R0, "r0", 32 },
|
||||
|
|
|
@ -173,7 +173,7 @@ static int dsp563xx_jtag_sendinstr(struct jtag_tap *tap, uint8_t * ir_in, uint8_
|
|||
static const struct
|
||||
{
|
||||
unsigned id;
|
||||
char *name;
|
||||
const char *name;
|
||||
unsigned bits;
|
||||
uint32_t r_cmd;
|
||||
uint32_t w_cmd;
|
||||
|
|
|
@ -53,7 +53,7 @@ struct dsp563xx_common
|
|||
struct dsp563xx_core_reg
|
||||
{
|
||||
uint32_t num;
|
||||
char *name;
|
||||
const char *name;
|
||||
uint32_t size;
|
||||
uint32_t r_cmd;
|
||||
uint32_t w_cmd;
|
||||
|
|
|
@ -139,7 +139,7 @@ struct etm_context;
|
|||
|
||||
struct etm_capture_driver
|
||||
{
|
||||
char *name;
|
||||
const char *name;
|
||||
const struct command_registration *commands;
|
||||
int (*init)(struct etm_context *etm_ctx);
|
||||
trace_status_t (*status)(struct etm_context *etm_ctx);
|
||||
|
|
|
@ -27,7 +27,7 @@ struct target;
|
|||
|
||||
struct reg
|
||||
{
|
||||
char *name;
|
||||
const char *name;
|
||||
void *value;
|
||||
bool dirty;
|
||||
bool valid;
|
||||
|
@ -38,7 +38,7 @@ struct reg
|
|||
|
||||
struct reg_cache
|
||||
{
|
||||
char *name;
|
||||
const char *name;
|
||||
struct reg_cache *next;
|
||||
struct reg *reg_list;
|
||||
unsigned num_regs;
|
||||
|
|
|
@ -42,7 +42,7 @@ struct target_type
|
|||
* Name of this type of target. Do @b not access this
|
||||
* field directly, use target_type_name() instead.
|
||||
*/
|
||||
char *name;
|
||||
const char *name;
|
||||
|
||||
/* poll current target status */
|
||||
int (*poll)(struct target *target);
|
||||
|
|
Loading…
Reference in New Issue