hexagon: fix warning comparing pointer to 0
Fix the following coccicheck warning:
./arch/hexagon/kernel/traps.c:138:6-7: WARNING comparing pointer to 0
Signed-off-by Atul Raut <[email protected]>
--- arch/hexagon/kernel/traps.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/hexagon/kernel/traps.c +2 -2
@@ -80,7 +80,7 @@ static void do_show_stack(struct task_struct *task, unsigned long *fp,int kstack_depth_to_print =24 ;unsigned long offset, size;const char *name =NULL ; -unsigned long *newfp; +unsigned long *newfp =NULL ;unsigned long low, high;char tmpstr[128 ];char *modname;
@@ -135,7 +135,7 @@ static void do_show_stack(struct task_struct *task, unsigned long *fp, }/* Attempt to continue past exception. */ -if (0 == newfp) { +if (!newfp) {struct pt_regs *regs = (struct pt_regs *) (((void *)fp) +8 );
Signature · 1 line
2.34.1
Brian Cain
Acked-byQuoted 46 lines
-----Original Message-----
From: Atul Raut <[email protected]>
Sent: Wednesday, August 9, 2023 1:52 PM
To: Brian Cain <[email protected]>
Cc: [email protected]; linux-kernel- [email protected]
Subject: hexagon: fix warning comparing pointer to 0WARNING: This email originated from outside of Qualcomm. Please be wary of any links or attachments, and do not enable macros.
Fix the following coccicheck warning:
./arch/hexagon/kernel/traps.c:138:6-7: WARNING comparing pointer to 0Signed-off-by Atul Raut <[email protected]>--- arch/hexagon/kernel/traps.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)arch/hexagon/kernel/traps.c +1
-1@@ -80,7 +80,7 @@ static void do_show_stack(struct task_struct *task,unsigned long *fp, int kstack_depth_to_print = 24;unsigned long offset, size;const char *name =NULL ; -unsigned long *newfp; +unsigned long *newfp =NULL ;unsigned long low, high;char tmpstr[128 ];char *modname;arch/hexagon/kernel/traps.c +1
-2@@ -135,7 +135,7 @@ static void do_show_stack(struct task_struct *task, unsigned long *fp, }/* Attempt to continue past exception. */ -if (0 == newfp) { +if (!newfp) {struct pt_regs *regs = (struct pt_regs *) (((void *)fp) +8 ); --
Quoted 1 line
2.34.1
Acked-by Brian Cain <[email protected]>