Skip to content
This repository was archived by the owner on May 23, 2023. It is now read-only.

Commit ff72d95

Browse files
author
Jarkko Paso
authored
Merge pull request ARMmbed#1629 from ARMmbed/cppcheck_fixes
Cppcheck fixes
2 parents cab9849 + 85f1345 commit ff72d95

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

source/MAC/IEEE802_15_4/mac_mcps_sap.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,10 @@ void mcps_sap_data_req_handler(protocol_interface_rf_mac_setup_s *rf_mac_setup ,
154154

155155
static bool mac_ie_vector_length_validate(ns_ie_iovec_t *ie_vector, uint16_t iov_length, uint16_t *length_out)
156156
{
157-
*length_out = 0;
157+
if (length_out) {
158+
*length_out = 0;
159+
}
160+
158161
if (!iov_length) {
159162
return true;
160163
}

source/Service_Libs/fhss/fhss_configuration_interface.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ int ns_fhss_delete(fhss_api_t *fhss_api)
9090
return -1;
9191
}
9292
ns_dyn_mem_free(fhss_api);
93-
fhss_api = NULL;
9493
return 0;
9594
}
9695

source/Service_Libs/fhss/fhss_ws.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,9 @@ fhss_structure_t *fhss_ws_enable(fhss_api_t *fhss_api, const fhss_ws_configurati
7777

7878
static int32_t fhss_ws_calc_bc_channel(fhss_structure_t *fhss_structure)
7979
{
80-
int32_t next_channel;
81-
82-
if (fhss_structure->ws->fhss_configuration.ws_channel_function == WS_FIXED_CHANNEL) {
80+
int32_t next_channel = fhss_structure->rx_channel;
8381

84-
} else if (fhss_structure->ws->fhss_configuration.ws_channel_function == WS_TR51CF) {
82+
if (fhss_structure->ws->fhss_configuration.ws_channel_function == WS_TR51CF) {
8583
next_channel = tr51_get_bc_channel_index(fhss_structure->ws->bc_slot, fhss_structure->ws->fhss_configuration.bsi, fhss_structure->number_of_channels, NULL, 0);
8684
if (++fhss_structure->ws->bc_slot == fhss_structure->number_of_channels) {
8785
fhss_structure->ws->bc_slot = 0;

0 commit comments

Comments
 (0)