diff mbox series

libpdbg: Initialize to avoid build errors with -O3

Message ID 20180808091740.3917435-1-amitay@ozlabs.org
State Accepted
Headers show
Series libpdbg: Initialize to avoid build errors with -O3 | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success master/apply_patch Successfully applied
snowpatch_ozlabs/build-multiarch success Test build-multiarch on branch master

Commit Message

Amitay Isaacs Aug. 8, 2018, 9:17 a.m. UTC
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
---
 libpdbg/chip.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Alistair Popple Aug. 13, 2018, 5:20 a.m. UTC | #1
Thanks Amitay!

- Alistair

On Wednesday, 8 August 2018 7:17:40 PM AEST Amitay Isaacs wrote:
> Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
> ---
>  libpdbg/chip.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libpdbg/chip.c b/libpdbg/chip.c
> index 079592c..3cf33ec 100644
> --- a/libpdbg/chip.c
> +++ b/libpdbg/chip.c
> @@ -325,7 +325,7 @@ int ram_state_thread(struct pdbg_target *thread, struct thread_regs *regs)
>  {
>  	struct thread_regs _regs;
>  	struct thread *t;
> -	uint64_t value;
> +	uint64_t value = 0;
>  	int i;
>  
>  	if (!regs)
> @@ -362,7 +362,7 @@ int ram_state_thread(struct pdbg_target *thread, struct thread_regs *regs)
>  
>  	regs->cr = 0;
>  	for (i = 0; i < 8; i++) {
> -		uint64_t cr;
> +		uint64_t cr = 0;
>  		ram_getcr(thread, i, &cr);
>  		regs->cr |= cr;
>  	}
>
diff mbox series

Patch

diff --git a/libpdbg/chip.c b/libpdbg/chip.c
index 079592c..3cf33ec 100644
--- a/libpdbg/chip.c
+++ b/libpdbg/chip.c
@@ -325,7 +325,7 @@  int ram_state_thread(struct pdbg_target *thread, struct thread_regs *regs)
 {
 	struct thread_regs _regs;
 	struct thread *t;
-	uint64_t value;
+	uint64_t value = 0;
 	int i;
 
 	if (!regs)
@@ -362,7 +362,7 @@  int ram_state_thread(struct pdbg_target *thread, struct thread_regs *regs)
 
 	regs->cr = 0;
 	for (i = 0; i < 8; i++) {
-		uint64_t cr;
+		uint64_t cr = 0;
 		ram_getcr(thread, i, &cr);
 		regs->cr |= cr;
 	}