Skip to content

Commit

Permalink
sensors/ina2xx: Handle uninitialized value warning
Browse files Browse the repository at this point in the history
Warning are false positive but code is changed anyway.
  • Loading branch information
kasjer committed May 21, 2024
1 parent 06a5e86 commit 10cdc59
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions hw/drivers/sensors/ina219/src/ina219_shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions hw/drivers/sensors/ina226/src/ina226_shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 10cdc59

Please sign in to comment.