In ppc_dump_irq(), use the return value of read_string() to decide the status,
instead of checking the buffer.

Also remove the unused variable offset in get_ppc_frame().

Signed-off-by: Suzuki K. Poulose <[email protected]>
---

 ppc.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/ppc.c b/ppc.c
index 509a41b..2a10fac 100755
--- a/ppc.c
+++ b/ppc.c
@@ -1221,7 +1221,6 @@ get_ppc_frame(struct bt_info *bt, ulong *getpc, ulong 
*getsp)
 {
        ulong ip;
        ulong sp;
-       ulong offset;
        ulong *stack;
        ulong task;
        struct ppc_pt_regs regs;
@@ -1286,6 +1285,7 @@ static void ppc_dump_irq(int irq)
         int level, others;
         ulong action, ctl, value;
        char typename[32];
+       int len;
 
         dm = &datatype_member;
 
@@ -1314,9 +1314,9 @@ static void ppc_dump_irq(int irq)
                /* typename */
                readmem(ctl + OFFSET(hw_interrupt_type_typename), KVADDR, &addr,
                        sizeof(ulong), "typename pointer", FAULT_ON_ERROR);
-               read_string(addr, typename, 32);
+               len = read_string(addr, typename, 32);
                
-               if(typename)
+               if(len)
                        fprintf(fp, "         typename: %08lx  \"%s\"\n", 
                                addr, typename);
                
@@ -1428,9 +1428,9 @@ static void ppc_dump_irq(int irq)
                /* name */
                readmem(action + OFFSET(irqaction_name), KVADDR, &addr,
                        sizeof(ulong), "action name", FAULT_ON_ERROR);
-               read_string(addr, typename, 32);
+               len = read_string(addr, typename, 32);
                
-               if(typename)
+               if(len)
                        fprintf(fp, "             name: %08lx  \"%s\"\n", 
                                addr, typename);
 

--
Crash-utility mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/crash-utility

Reply via email to