shell: rename shadow variables
This renames shadow variables found by -Wshadow. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
parent
b22db9892e
commit
565c5d476e
1 changed files with 9 additions and 9 deletions
|
@ -42,7 +42,7 @@ static int memory_dump(const struct shell *sh, mem_addr_t phys_addr, size_t size
|
|||
size_t data_offset;
|
||||
mm_reg_t addr;
|
||||
const size_t vsize = width / BITS_PER_BYTE;
|
||||
uint8_t data[SHELL_HEXDUMP_BYTES_IN_LINE];
|
||||
uint8_t hex_data[SHELL_HEXDUMP_BYTES_IN_LINE];
|
||||
|
||||
#if defined(CONFIG_MMU) || defined(CONFIG_PCIE)
|
||||
device_map((mm_reg_t *)&addr, phys_addr, size, K_MEM_CACHE_NONE);
|
||||
|
@ -60,7 +60,7 @@ static int memory_dump(const struct shell *sh, mem_addr_t phys_addr, size_t size
|
|||
switch (width) {
|
||||
case 8:
|
||||
value = sys_read8(addr + data_offset);
|
||||
data[data_offset] = value;
|
||||
hex_data[data_offset] = value;
|
||||
break;
|
||||
case 16:
|
||||
value = sys_read16(addr + data_offset);
|
||||
|
@ -68,9 +68,9 @@ static int memory_dump(const struct shell *sh, mem_addr_t phys_addr, size_t size
|
|||
value = __bswap_16(value);
|
||||
}
|
||||
|
||||
data[data_offset] = (uint8_t)value;
|
||||
hex_data[data_offset] = (uint8_t)value;
|
||||
value >>= 8;
|
||||
data[data_offset + 1] = (uint8_t)value;
|
||||
hex_data[data_offset + 1] = (uint8_t)value;
|
||||
break;
|
||||
case 32:
|
||||
value = sys_read32(addr + data_offset);
|
||||
|
@ -78,13 +78,13 @@ static int memory_dump(const struct shell *sh, mem_addr_t phys_addr, size_t size
|
|||
value = __bswap_32(value);
|
||||
}
|
||||
|
||||
data[data_offset] = (uint8_t)value;
|
||||
hex_data[data_offset] = (uint8_t)value;
|
||||
value >>= 8;
|
||||
data[data_offset + 1] = (uint8_t)value;
|
||||
hex_data[data_offset + 1] = (uint8_t)value;
|
||||
value >>= 8;
|
||||
data[data_offset + 2] = (uint8_t)value;
|
||||
hex_data[data_offset + 2] = (uint8_t)value;
|
||||
value >>= 8;
|
||||
data[data_offset + 3] = (uint8_t)value;
|
||||
hex_data[data_offset + 3] = (uint8_t)value;
|
||||
break;
|
||||
default:
|
||||
shell_fprintf(sh, SHELL_NORMAL, "Incorrect data width\n");
|
||||
|
@ -92,7 +92,7 @@ static int memory_dump(const struct shell *sh, mem_addr_t phys_addr, size_t size
|
|||
}
|
||||
}
|
||||
|
||||
shell_hexdump_line(sh, addr, data, MIN(size, SHELL_HEXDUMP_BYTES_IN_LINE));
|
||||
shell_hexdump_line(sh, addr, hex_data, MIN(size, SHELL_HEXDUMP_BYTES_IN_LINE));
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue