fixeria has uploaded this change for review.

View Change

firmware/apps/rssi: fix -Wmaybe-uninitialized in handle_pm()

In this function we have the following condition:

if (pm_mode == PM_IDLE && (mode == MODE_MAIN || mode == MODE_SPECTRUM))

so the 'mode' can be either MODE_MAIN or MODE_SPECTRUM. Still,
GCC throws false-positive warnings that 'a' and 'e' may be used
uninitialized in handle_pm().

Let's eliminate these warnings by using 'if-else' statement.

Change-Id: I86d241c41d4de135f4cd79f56f7fdd18696b7890
---
M src/target/firmware/apps/rssi/main.c
1 file changed, 1 insertion(+), 2 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/71/27871/1
diff --git a/src/target/firmware/apps/rssi/main.c b/src/target/firmware/apps/rssi/main.c
index 9a3f87c..94ecc3b 100644
--- a/src/target/firmware/apps/rssi/main.c
+++ b/src/target/firmware/apps/rssi/main.c
@@ -920,8 +920,7 @@
a |= ARFCN_UPLINK;
e = a;
pm_mode = PM_SENT;
- }
- if (mode == MODE_SPECTRUM) {
+ } else { /* mode == MODE_SPECTRUM */
if (pcs && arfcn >= PCS_MIN && arfcn <= PCS_MAX) {
a = PCS_MIN | ARFCN_PCS;
e = PCS_MAX | ARFCN_PCS;

To view, visit change 27871. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I86d241c41d4de135f4cd79f56f7fdd18696b7890
Gerrit-Change-Number: 27871
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de>
Gerrit-MessageType: newchange