From 01fd8804dfa69ea30161d35ddf67efe8e514171f Mon Sep 17 00:00:00 2001 From: Kimmo Vaisanen Date: Thu, 29 Mar 2018 11:49:09 +0300 Subject: [PATCH] Fix Coverity warning Fixed Coverity warning "stored value is overwritten before it can be used". --- features/lorawan/lorastack/mac/LoRaMac.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/features/lorawan/lorastack/mac/LoRaMac.cpp b/features/lorawan/lorastack/mac/LoRaMac.cpp index 013ea0c899..72fdf5330c 100644 --- a/features/lorawan/lorastack/mac/LoRaMac.cpp +++ b/features/lorawan/lorastack/mac/LoRaMac.cpp @@ -1102,7 +1102,6 @@ lorawan_status_t LoRaMac::schedule_tx(void) { lorawan_time_t dutyCycleTimeOff = 0; channel_selection_params_t nextChan; - lorawan_status_t status = LORAWAN_STATUS_PARAMETER_INVALID; if (_params.sys_params.max_duty_cycle == 255) { return LORAWAN_STATUS_DEVICE_OFF; @@ -1121,9 +1120,10 @@ lorawan_status_t LoRaMac::schedule_tx(void) nextChan.joined = _is_nwk_joined; nextChan.last_aggregate_tx_time = _params.timers.aggregated_last_tx_time; - status = _lora_phy.set_next_channel(&nextChan, &_params.channel, - &dutyCycleTimeOff, - &_params.timers.aggregated_timeoff); + lorawan_status_t status = _lora_phy.set_next_channel(&nextChan, + &_params.channel, + &dutyCycleTimeOff, + &_params.timers.aggregated_timeoff); switch (status) { case LORAWAN_STATUS_NO_CHANNEL_FOUND: case LORAWAN_STATUS_NO_FREE_CHANNEL_FOUND: