提交 8218a303 编写于 作者: A Anshuman Khandual 提交者: Michael Ellerman

powerpc/xmon: Drop the valid variable completely in dump_segments()

The value of 'valid' is always zero when 'esid' is zero, and if 'esid'
is non-zero then the value of 'valid' is irrelevant because we are using
logical or in the if expression.

In fact 'valid' can be dropped completely from dump_segments() by
simply doing the check with SLB_ESID_V directly in the if.
Signed-off-by: NAnshuman Khandual <khandual@linux.vnet.ibm.com>
[mpe: Rewrite change log]
Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
上级 9c61f7a0
...@@ -2730,7 +2730,7 @@ static void xmon_print_symbol(unsigned long address, const char *mid, ...@@ -2730,7 +2730,7 @@ static void xmon_print_symbol(unsigned long address, const char *mid,
void dump_segments(void) void dump_segments(void)
{ {
int i; int i;
unsigned long esid,vsid,valid; unsigned long esid,vsid;
unsigned long llp; unsigned long llp;
printf("SLB contents of cpu 0x%x\n", smp_processor_id()); printf("SLB contents of cpu 0x%x\n", smp_processor_id());
...@@ -2738,10 +2738,9 @@ void dump_segments(void) ...@@ -2738,10 +2738,9 @@ void dump_segments(void)
for (i = 0; i < mmu_slb_size; i++) { for (i = 0; i < mmu_slb_size; i++) {
asm volatile("slbmfee %0,%1" : "=r" (esid) : "r" (i)); asm volatile("slbmfee %0,%1" : "=r" (esid) : "r" (i));
asm volatile("slbmfev %0,%1" : "=r" (vsid) : "r" (i)); asm volatile("slbmfev %0,%1" : "=r" (vsid) : "r" (i));
valid = (esid & SLB_ESID_V); if (esid || vsid) {
if (valid | esid | vsid) {
printf("%02d %016lx %016lx", i, esid, vsid); printf("%02d %016lx %016lx", i, esid, vsid);
if (valid) { if (esid & SLB_ESID_V) {
llp = vsid & SLB_VSID_LLP; llp = vsid & SLB_VSID_LLP;
if (vsid & SLB_VSID_B_1T) { if (vsid & SLB_VSID_B_1T) {
printf(" 1T ESID=%9lx VSID=%13lx LLP:%3lx \n", printf(" 1T ESID=%9lx VSID=%13lx LLP:%3lx \n",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册