disas/microblaze: Fix warnings caused by missing 'static' attribute
Warnings from the Sparse static analysis tool: disas/microblaze.c:289:3: warning: symbol 'opcodes' was not declared. Should it be static? disas/microblaze.c:570:6: warning: symbol 'register_prefix' was not declared. Should it be static? disas/microblaze.c:571:6: warning: symbol 'special_register_prefix' was not declared. Should it be static? disas/microblaze.c:572:6: warning: symbol 'fsl_register_prefix' was not declared. Should it be static? disas/microblaze.c:573:6: warning: symbol 'pvr_register_prefix' was not declared. Should it be static? Remove the unused variable special_register_prefix. The variable pvr_register_prefix was unused, too, but can be used. Add also 'const' where possible. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
parent
35ff079813
commit
52b831de00
@ -275,7 +275,7 @@ enum microblaze_instr_type {
|
|||||||
|
|
||||||
#define MAX_OPCODES 280
|
#define MAX_OPCODES 280
|
||||||
|
|
||||||
struct op_code_struct {
|
static struct op_code_struct {
|
||||||
const char *name;
|
const char *name;
|
||||||
short inst_type; /* registers and immediate values involved */
|
short inst_type; /* registers and immediate values involved */
|
||||||
short inst_offset_type; /* immediate vals offset from PC? (= 1 for branches) */
|
short inst_offset_type; /* immediate vals offset from PC? (= 1 for branches) */
|
||||||
@ -567,10 +567,9 @@ struct op_code_struct {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* prefix for register names */
|
/* prefix for register names */
|
||||||
char register_prefix[] = "r";
|
static const char register_prefix[] = "r";
|
||||||
char special_register_prefix[] = "spr";
|
static const char fsl_register_prefix[] = "rfsl";
|
||||||
char fsl_register_prefix[] = "rfsl";
|
static const char pvr_register_prefix[] = "rpvr";
|
||||||
char pvr_register_prefix[] = "rpvr";
|
|
||||||
|
|
||||||
|
|
||||||
/* #defines for valid immediate range */
|
/* #defines for valid immediate range */
|
||||||
@ -738,7 +737,9 @@ get_field_special (long instr, struct op_code_struct * op)
|
|||||||
default :
|
default :
|
||||||
{
|
{
|
||||||
if ( ((((instr & IMM_MASK) >> IMM_LOW) ^ op->immval_mask) & 0xE000) == REG_PVR_MASK) {
|
if ( ((((instr & IMM_MASK) >> IMM_LOW) ^ op->immval_mask) & 0xE000) == REG_PVR_MASK) {
|
||||||
sprintf(tmpstr, "%spvr%d", register_prefix, (unsigned short)(((instr & IMM_MASK) >> IMM_LOW) ^ op->immval_mask) ^ REG_PVR_MASK);
|
sprintf(tmpstr, "%s%u", pvr_register_prefix,
|
||||||
|
(unsigned short)(((instr & IMM_MASK) >> IMM_LOW) ^
|
||||||
|
op->immval_mask) ^ REG_PVR_MASK);
|
||||||
return(strdup(tmpstr));
|
return(strdup(tmpstr));
|
||||||
} else {
|
} else {
|
||||||
strcpy(spr, "pc");
|
strcpy(spr, "pc");
|
||||||
|
Loading…
Reference in New Issue
Block a user