From 35adde55d2f04d323eea61cb8ea32df7f26a408d Mon Sep 17 00:00:00 2001
From: smlng <s@mlng.net>
Date: Tue, 20 Dec 2016 15:48:54 +0100
Subject: [PATCH] cppcheck: cpu/cc2538 reduce scope of variables

---
 cpu/cc2538/radio/cc2538_rf_netdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cpu/cc2538/radio/cc2538_rf_netdev.c b/cpu/cc2538/radio/cc2538_rf_netdev.c
index 3eca36ee55..449f064a63 100644
--- a/cpu/cc2538/radio/cc2538_rf_netdev.c
+++ b/cpu/cc2538/radio/cc2538_rf_netdev.c
@@ -295,8 +295,6 @@ static int _send(netdev2_t *netdev, const struct iovec *vector, unsigned count)
 
 static int _recv(netdev2_t *netdev, void *buf, size_t len, void *info)
 {
-    uint8_t corr_val;
-    int8_t rssi_val;
     size_t pkt_len;
 
     if (buf == NULL) {
@@ -335,6 +333,8 @@ static int _recv(netdev2_t *netdev, void *buf, size_t len, void *info)
     rfcore_read_fifo(buf, pkt_len);
 
     if (info != NULL && RFCORE->XREG_RSSISTATbits.RSSI_VALID) {
+        uint8_t corr_val;
+        int8_t rssi_val;
         netdev2_ieee802154_rx_info_t *radio_info = info;
         rssi_val = rfcore_read_byte() + CC2538_RSSI_OFFSET;
 
-- 
GitLab