[PATCH] powerpc/8xx: Fix warning in hw_breakpoint_handler()

Subsystems: linux for powerpc (32-bit and 64-bit), the rest

STALE1377d LANDED

Landed in mainline as f66802752156 on 2022-11-24.

3 messages, 3 authors, 2022-11-30 · open the first message on its own page

[PATCH] powerpc/8xx: Fix warning in hw_breakpoint_handler()

From: Russell Currey <hidden>
Date: 2022-10-24 04:15:10

In hw_breakpoint_handler(), ea is set by wp_get_instr_detail() except
for 8xx, leading the variable to be passed uninitialised to
wp_check_constraints().  This is safe as wp_check_constraints() returns
early without using ea, so just set it to make the compiler happy.

Signed-off-by: Russell Currey <redacted>
---
 arch/powerpc/kernel/hw_breakpoint.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/hw_breakpoint.c b/arch/powerpc/kernel/hw_breakpoint.c
index 8db1a15d7acb..e1b4e70c8fd0 100644
--- a/arch/powerpc/kernel/hw_breakpoint.c
+++ b/arch/powerpc/kernel/hw_breakpoint.c
@@ -646,7 +646,7 @@ int hw_breakpoint_handler(struct die_args *args)
 	ppc_inst_t instr = ppc_inst(0);
 	int type = 0;
 	int size = 0;
-	unsigned long ea;
+	unsigned long ea = 0;
 
 	/* Disable breakpoints during exception handling */
 	hw_breakpoint_disable();
-- 
2.37.3

Re: [PATCH] powerpc/8xx: Fix warning in hw_breakpoint_handler()

From: Christophe Leroy <hidden>
Date: 2022-11-03 07:48:34


Le 24/10/2022 à 06:13, Russell Currey a écrit :
In hw_breakpoint_handler(), ea is set by wp_get_instr_detail() except
for 8xx, leading the variable to be passed uninitialised to
wp_check_constraints().  This is safe as wp_check_constraints() returns
early without using ea, so just set it to make the compiler happy.

Signed-off-by: Russell Currey <redacted>
Reviewed-by: Christophe Leroy <redacted>
quoted hunk
---
  arch/powerpc/kernel/hw_breakpoint.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/hw_breakpoint.c b/arch/powerpc/kernel/hw_breakpoint.c
index 8db1a15d7acb..e1b4e70c8fd0 100644
--- a/arch/powerpc/kernel/hw_breakpoint.c
+++ b/arch/powerpc/kernel/hw_breakpoint.c
@@ -646,7 +646,7 @@ int hw_breakpoint_handler(struct die_args *args)
  	ppc_inst_t instr = ppc_inst(0);
  	int type = 0;
  	int size = 0;
-	unsigned long ea;
+	unsigned long ea = 0;
  
  	/* Disable breakpoints during exception handling */
  	hw_breakpoint_disable();

Re: [PATCH] powerpc/8xx: Fix warning in hw_breakpoint_handler()

From: Michael Ellerman <hidden>
Date: 2022-11-30 09:47:58

On Mon, 24 Oct 2022 15:13:46 +1100, Russell Currey wrote:
In hw_breakpoint_handler(), ea is set by wp_get_instr_detail() except
for 8xx, leading the variable to be passed uninitialised to
wp_check_constraints().  This is safe as wp_check_constraints() returns
early without using ea, so just set it to make the compiler happy.
Applied to powerpc/next.

[1/1] powerpc/8xx: Fix warning in hw_breakpoint_handler()
      https://git.kernel.org/powerpc/c/f668027521561d1071ccf54500c82a58a1918b2b

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help