38 lines
1.5 KiB
Diff
38 lines
1.5 KiB
Diff
commit 2ae971b87f05c03bd07d0ce41db59cc522625482
|
|
Author: Miroslav Lichvar <mlichvar@redhat.com>
|
|
Date: Wed Nov 8 15:15:28 2023 +0100
|
|
|
|
Avoid -Wmaybe-uninitialized warning
|
|
|
|
This fixes false positives reported by an older gcc:
|
|
|
|
In file included from dpll_mon.c:17:
|
|
dpll_mon.c: In function 'dpll_mon_pin_update':
|
|
print.h:54:17: error: 'pin_state' may be used uninitialized in this function [-Werror=maybe-uninitialized]
|
|
54 | print(l, x); \
|
|
| ^~~~~
|
|
dpll_mon.c:334:33: note: 'pin_state' was declared here
|
|
334 | uint32_t parent_pin_id, pin_state;
|
|
| ^~~~~~~~~
|
|
print.h:54:17: error: 'parent_pin_id' may be used uninitialized in this
|
|
function [-Werror=maybe-uninitialized]
|
|
54 | print(l, x); \
|
|
| ^~~~~
|
|
dpll_mon.c:334:18: note: 'parent_pin_id' was declared here
|
|
334 | uint32_t parent_pin_id, pin_state;
|
|
| ^~~~~~~~~~~~~
|
|
|
|
diff --git a/dpll_mon.c b/dpll_mon.c
|
|
index 3cc26cc..0f0648c 100644
|
|
--- a/dpll_mon.c
|
|
+++ b/dpll_mon.c
|
|
@@ -331,7 +331,7 @@ static void update_muxed_pin(struct dpll_mon *dm, uint32_t pin_id,
|
|
struct nlattr *a, int exist, int notify)
|
|
{
|
|
int parent_pin_id_valid = 0, pin_state_valid = 0, rem;
|
|
- uint32_t parent_pin_id, pin_state;
|
|
+ uint32_t parent_pin_id = 0, pin_state = 0;
|
|
struct dpll_mon_pin *pin, *parent;
|
|
struct nlattr *an;
|
|
|