From 6aef91e2cb91f2c22904eb139cab83d9375b73d7 Mon Sep 17 00:00:00 2001 From: Jerzy Kasenberg Date: Sat, 18 May 2024 17:08:47 +0200 Subject: [PATCH] sensors/ina2xx: Handle uninitialized value warning Warning are false positive but code is changed anyway. --- hw/drivers/sensors/ina219/src/ina219_shell.c | 8 ++++---- hw/drivers/sensors/ina226/src/ina226_shell.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/hw/drivers/sensors/ina219/src/ina219_shell.c b/hw/drivers/sensors/ina219/src/ina219_shell.c index 89732b0624..e6ea4c2a65 100644 --- a/hw/drivers/sensors/ina219/src/ina219_shell.c +++ b/hw/drivers/sensors/ina219/src/ina219_shell.c @@ -79,7 +79,7 @@ static int ina219_shell_cmd_fs(int argc, char **argv) { int rc = -1; - long long val; + long long val = 0; if (argc == 3) { val = parse_ll_bounds(argv[2], 0, 1, &rc); @@ -96,7 +96,7 @@ static int ina219_shell_cmd_soft_avg(int argc, char **argv) { int rc = -1; - long long val; + long long val = 0; if (argc == 3) { val = parse_ll_bounds(argv[2], 1, 100, &rc); @@ -113,7 +113,7 @@ static int ina219_shell_cmd_smod(int argc, char **argv) { int rc = -1; - long long val; + long long val = 0; if (argc == 3) { val = parse_ll_bounds(argv[2], 0, 7, &rc); @@ -130,7 +130,7 @@ static int ina219_shell_cmd_vmod(int argc, char **argv) { int rc = -1; - long long val; + long long val = 0; if (argc == 3) { val = parse_ll_bounds(argv[2], 0, 15, &rc); diff --git a/hw/drivers/sensors/ina226/src/ina226_shell.c b/hw/drivers/sensors/ina226/src/ina226_shell.c index 72ff909389..3ecf8c6480 100644 --- a/hw/drivers/sensors/ina226/src/ina226_shell.c +++ b/hw/drivers/sensors/ina226/src/ina226_shell.c @@ -82,7 +82,7 @@ static int ina226_shell_cmd_avg(int argc, char **argv) { int rc = -1; - long long val; + long long val = 0; if (argc == 3) { val = parse_ll_bounds(argv[2], 0, 7, &rc); @@ -99,7 +99,7 @@ static int ina226_shell_cmd_soft_avg(int argc, char **argv) { int rc = -1; - long long val; + long long val = 0; if (argc == 3) { val = parse_ll_bounds(argv[2], 1, 100, &rc); @@ -116,7 +116,7 @@ static int ina226_shell_cmd_sct(int argc, char **argv) { int rc = -1; - long long val; + long long val = 0; if (argc == 3) { val = parse_ll_bounds(argv[2], 0, 7, &rc); @@ -133,7 +133,7 @@ static int ina226_shell_cmd_vct(int argc, char **argv) { int rc = -1; - long long val; + long long val = 0; if (argc == 3) { val = parse_ll_bounds(argv[2], 0, 7, &rc);