Skip to content

Commit

Permalink
Fixed unused variable and function warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
Juha Heiskanen committed Jan 19, 2021
1 parent 4096c1a commit 5106b1d
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 15 deletions.
6 changes: 3 additions & 3 deletions source/6LoWPAN/Thread/thread_test_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ int_fast8_t arm_nwk_6lowpan_thread_test_add_neighbour(
const uint8_t *id_mask,
const uint8_t *route_data)
{
#ifdef HAVE_THREAD
#ifdef HAVE_THREAD_ROUTER
protocol_interface_info_entry_t *cur;
cur = protocol_stack_interface_info_get_by_id(interface_id);
if (!cur) {
Expand All @@ -94,7 +94,7 @@ int_fast8_t arm_nwk_6lowpan_thread_test_remove_neighbour(
int8_t interface_id,
uint16_t neighbour_short_addr)
{
#ifdef HAVE_THREAD
#ifdef HAVE_THREAD_ROUTER
protocol_interface_info_entry_t *cur;
cur = protocol_stack_interface_info_get_by_id(interface_id);
if (!cur) {
Expand Down Expand Up @@ -1220,7 +1220,7 @@ int8_t thread_test_initial_slaac_iid_set(int8_t interface_id, uint8_t *iid)

int8_t thread_test_router_id_request_send(int8_t interface_id, uint8_t status)
{
#ifdef HAVE_THREAD
#ifdef HAVE_THREAD_ROUTER
protocol_interface_info_entry_t *cur;

cur = protocol_stack_interface_info_get_by_id(interface_id);
Expand Down
1 change: 1 addition & 0 deletions source/RPL/rpl_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ static void rpl_control_etx_change_callback(int8_t nwk_id, uint16_t previous_et
if (!cur || !cur->rpl_domain) {
return;
}
(void) attribute_index;
// ETX is "better" if now lower, or previous was "unknown" and new isn't infinite
bool better = current_etx < previous_etx || (previous_etx == 0 && current_etx != 0xffff);

Expand Down
4 changes: 4 additions & 0 deletions source/Security/Common/security_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ void tls_server_hash_copy(uint8_t *ptr, tls_msg_t *tmp_msg, sec_suite_t *suite)
tls_build_server_hello_msg(ptr, suite->tls_session);
tls_handshake_copy(tmp_msg, t_heap);
tr_debug("Pana server S-Hello,Cert hash");
#else
(void) ptr;
(void) tmp_msg;
(void) suite;
#endif
}
#endif
Expand Down
2 changes: 2 additions & 0 deletions source/Security/PANA/pana_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -1721,6 +1721,8 @@ static void pana_client_authentication_fail(sec_suite_t *suite)
int8_t pana_server_nvm_callback_set(pana_server_update_cb *update_cb, pana_server_session_get_cb *nvm_get, pana_server_session_get_by_id_cb *nvm_session_get, uint8_t *nvm_static_buffer)
{
(void)update_cb;
(void)nvm_get;
(void)nvm_session_get;
(void)nvm_static_buffer;
return -1;
}
Expand Down
13 changes: 9 additions & 4 deletions source/Security/TLS/tls_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ static uint8_t tls_parse_server_key_exchange(uint8_t *ptr, uint16_t len, sec_sui

static uint8_t *tls_set_client_key_excange(uint8_t *ptr, sec_suite_t *tls_suite);
static uint8_t tls_parse_server_hello(uint8_t *ptr, sec_suite_t *tls_suite);
#ifdef PANA_SERVER_API
static uint8_t tls_parse_client_hello(uint8_t *ptr, uint16_t len, sec_suite_t *tls_suite);
#endif
static tls_psk_key_t *tls_get_key(uint16_t key_id);

tls_session_t *amr_tls_session_allocate(void)
Expand Down Expand Up @@ -171,7 +173,7 @@ void tls_finnish_copy(uint8_t *ptr, tls_heap_t *heap_ptr)

}

uint8_t tls_parse_client_hello(uint8_t *ptr, uint16_t len, sec_suite_t *tls_suite)
static uint8_t tls_parse_client_hello(uint8_t *ptr, uint16_t len, sec_suite_t *tls_suite)
{
uint8_t ret_val = 0, i = 0;
uint16_t tls_version;
Expand Down Expand Up @@ -548,6 +550,7 @@ uint8_t tls_parse_server_key_exchange(uint8_t *ptr, uint16_t len, sec_suite_t *t
return 0;
}

#ifdef ECC
static uint8_t tls_parse_client_key_exchange(uint8_t *ptr, uint16_t len, sec_suite_t *tls_suite)
{
(void)len;
Expand All @@ -567,6 +570,7 @@ static uint8_t tls_parse_client_key_exchange(uint8_t *ptr, uint16_t len, sec_sui

return 0;
}
#endif


void tls_read_certi_signature(tls_heap_t *theap, uint8_t certificate)
Expand All @@ -589,8 +593,8 @@ void tls_read_certi_signature(tls_heap_t *theap, uint8_t certificate)

}


uint8_t tls_parse_certificate_verify(uint8_t *ptr, uint16_t len, sec_suite_t *tls_suite)
#ifdef ECC
static uint8_t tls_parse_certificate_verify(uint8_t *ptr, uint16_t len, sec_suite_t *tls_suite)
{
(void)len;
uint16_t sig_algh, sig_len;
Expand Down Expand Up @@ -653,7 +657,7 @@ uint8_t tls_parse_certificate_verify(uint8_t *ptr, uint16_t len, sec_suite_t *tl
}
return 1;
}

#endif

tls_ecc_heap_t *ecc_allocate_ram(void)
{
Expand Down Expand Up @@ -1690,6 +1694,7 @@ buffer_t *tls_server_up(buffer_t *buf, sec_suite_t *tls_suite)
buf = tls_certificate_buffer_store(buf, certi_rx, tls_suite);
}
#else
(void)tls_suite;
if (buf) {
buf = buffer_free(buf);
}
Expand Down
6 changes: 3 additions & 3 deletions source/Service_Libs/nd_proxy/nd_proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ bool nd_proxy_upstream_route_onlink(int8_t downstream_id, uint8_t *address);
NS_DUMMY_DEFINITIONS_OK

#define nd_proxy_downstream_interface_register(interface_id, nd_proxy_req, bridge_state_update) -1
#define nd_proxy_downstream_interface_unregister(interface_id) -1
#define nd_proxy_upstream_interface_register(interface_id, route_validation_req) -1
#define nd_proxy_upstream_interface_unregister(interface_id) -1
#define nd_proxy_downstream_interface_unregister(interface_id) (-1)
#define nd_proxy_upstream_interface_register(interface_id, route_validation_req) (-1)
#define nd_proxy_upstream_interface_unregister(interface_id) (-1)
#define nd_proxy_enabled_for_downstream(interface_id) false
#define nd_proxy_enabled_for_upstream(interface_id) false
#define nd_proxy_target_address_validation(upstream_id, address) false
Expand Down
10 changes: 5 additions & 5 deletions source/libNET/src/ns_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -1072,7 +1072,7 @@ int8_t arm_network_certificate_revocation_list_remove(const arm_cert_revocation_
*/
int8_t arm_network_key_get(int8_t interface_id, ns_keys_t *key)
{
#ifndef PANA
#ifndef PANA_SERVER
(void)interface_id;
(void)key;
#endif
Expand All @@ -1081,7 +1081,7 @@ int8_t arm_network_key_get(int8_t interface_id, ns_keys_t *key)

int8_t arm_pana_server_library_init(int8_t interface_id, net_tls_cipher_e cipher_mode, const uint8_t *key_material, uint32_t time_period_before_activate_key)
{
#ifndef PANA
#ifndef PANA_SERVER
(void)interface_id;
(void)cipher_mode;
(void)key_material;
Expand All @@ -1092,15 +1092,15 @@ int8_t arm_pana_server_library_init(int8_t interface_id, net_tls_cipher_e cipher

int8_t arm_pana_activate_new_key(int8_t interface_id)
{
#ifndef PANA
#ifndef PANA_SERVER
(void)interface_id;
#endif
return pana_server_trig_new_key(interface_id);
}

int8_t arm_pana_server_key_update(int8_t interface_id, const uint8_t *network_key_material)
{
#ifndef PANA
#ifndef PANA_SERVER
(void)interface_id;
(void)network_key_material;
#endif
Expand Down Expand Up @@ -1199,7 +1199,7 @@ int8_t arm_6lowpan_bootsrap_set_for_selected_interface(int8_t interface_id)
int8_t arm_nwk_interface_configure_6lowpan_bootstrap_set(int8_t interface_id, net_6lowpan_mode_e bootstrap_mode, net_6lowpan_mode_extension_e net_6lowpan_mode_extension)
{
int8_t ret_val;

(void)bootstrap_mode;
ret_val = arm_6lowpan_bootsrap_set_for_selected_interface(interface_id);

if (ret_val == 0) {
Expand Down

0 comments on commit 5106b1d

Please sign in to comment.