Skip to content

Commit a5be64a

Browse files
author
Arto Kinnunen
authored
Follow Mbed OS coding style (#1941)
1 parent 6298cef commit a5be64a

32 files changed

+135
-139
lines changed

source/6LoWPAN/Thread/thread_extension_bbr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1223,7 +1223,7 @@ int8_t thread_extension_bbr_init(int8_t interface_id, int8_t backbone_interface_
12231223
this->delay_timer = THREAD_BBR_DUA_REGISTRATION_DELAY;
12241224
this->pbbr_started = false;
12251225
memcpy(this->pbbr_multicast_address, ADDR_LINK_LOCAL_ALL_ROUTERS, 16);
1226-
this->pbbr_port = THREAD_BBR_BACKBONE_PORT;
1226+
this->pbbr_port = THREAD_BBR_BACKBONE_PORT;
12271227
memset(this->registrar_address, 0, 16);
12281228
memcpy(this->tri_address, ADDR_LINK_LOCAL_ALL_ROUTERS, 16);
12291229
this->tri_port = THREAD_BBR_BACKBONE_PORT;

source/6LoWPAN/Thread/thread_extension_bootstrap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ static int thread_joiner_application_simple_enroll_response_cb(int8_t service_id
258258

259259
protocol_interface_info_entry_t *cur = protocol_stack_interface_info_get_by_id(thread_extension_bootstrap_find_id_by_service(service_id));
260260

261-
tr_debug("Simple enrollment received len:%d - %s",response_ptr->payload_len,trace_array(response_ptr->payload_ptr, response_ptr->payload_len));
261+
tr_debug("Simple enrollment received len:%d - %s", response_ptr->payload_len, trace_array(response_ptr->payload_ptr, response_ptr->payload_len));
262262

263263
if (!cur || !cur->thread_info || !response_ptr) {
264264
return -1;

source/6LoWPAN/Thread/thread_management_server.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1624,8 +1624,8 @@ bool thread_management_server_source_address_check(int8_t interface_id, uint8_t
16241624
// Source address is ML64 TODO this should check that destination address is ALOC or RLOC CoaP Service does not support
16251625
} else {
16261626
tr_deep("Message out of thread network; ML prefix: %s, src addr: %s",
1627-
trace_ipv6_prefix(linkConfiguration->mesh_local_ula_prefix, 64),
1628-
trace_ipv6(source_address));
1627+
trace_ipv6_prefix(linkConfiguration->mesh_local_ula_prefix, 64),
1628+
trace_ipv6(source_address));
16291629
return false;
16301630
}
16311631

source/6LoWPAN/Thread/thread_router_bootstrap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,7 +1407,7 @@ static void thread_address_registration_tlv_parse(uint8_t *ptr, uint16_t data_le
14071407
//Register GP --> 16
14081408
int retVal = thread_nd_address_registration(cur, tempIPv6Address, mac16, cur->mac_parameters->pan_id, mac64, &new_neighbour_created);
14091409
thread_extension_address_registration(cur, tempIPv6Address, mac64, new_neighbour_created, retVal == -2);
1410-
(void) retVal;
1410+
(void) retVal;
14111411
} else {
14121412
tr_debug("No Context %u", ctxId);
14131413
}
@@ -1428,7 +1428,7 @@ static void thread_address_registration_tlv_parse(uint8_t *ptr, uint16_t data_le
14281428
//Register GP --> 16
14291429
int retVal = thread_nd_address_registration(cur, ptr, mac16, cur->mac_parameters->pan_id, mac64, &new_neighbour_created);
14301430
thread_extension_address_registration(cur, ptr, mac64, new_neighbour_created, retVal == -2);
1431-
(void) retVal;
1431+
(void) retVal;
14321432
}
14331433

14341434
ptr += 16;

source/6LoWPAN/ws/ws_bootstrap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1184,7 +1184,7 @@ static void ws_bootstrap_neighbor_table_clean(struct protocol_interface_info_ent
11841184
{
11851185
uint8_t ll_target[16];
11861186

1187-
if (mac_neighbor_info(interface)->neighbour_list_size <= mac_neighbor_info(interface)->list_total_size - WS_NON_CHILD_NEIGHBOUR_COUNT ) {
1187+
if (mac_neighbor_info(interface)->neighbour_list_size <= mac_neighbor_info(interface)->list_total_size - WS_NON_CHILD_NEIGHBOUR_COUNT) {
11881188
// Enough neighbor entries
11891189
return;
11901190
}

source/6LoWPAN/ws/ws_eapol_auth_relay.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ static void ws_eapol_auth_relay_socket_cb(void *cb)
145145
ns_address_t src_addr;
146146

147147
if (socket_recvfrom(cb_data->socket_id, socket_pdu, cb_data->d_len, 0, &src_addr) != cb_data->d_len) {
148-
ns_dyn_mem_free(socket_pdu);
149-
return;
148+
ns_dyn_mem_free(socket_pdu);
149+
return;
150150
}
151151

152152
// Message from source port 10254 (KMP service) -> to IP relay on node or on authenticator
@@ -163,13 +163,13 @@ static void ws_eapol_auth_relay_socket_cb(void *cb)
163163
ptr += 8;
164164
uint16_t data_len = cb_data->d_len - 26;
165165
ws_eapol_relay_lib_send_to_relay(eapol_auth_relay->socket_id, eui_64, &relay_ip_addr,
166-
ptr, data_len);
166+
ptr, data_len);
167167
ns_dyn_mem_free(socket_pdu);
168-
// Other source port (either 10253 or node relay source port) -> to KMP service
168+
// Other source port (either 10253 or node relay source port) -> to KMP service
169169
} else {
170170
uint8_t *ptr = socket_pdu;
171171
ws_eapol_auth_relay_send_to_kmp(eapol_auth_relay, ptr, src_addr.address, src_addr.identifier,
172-
ptr + 8, cb_data->d_len - 8);
172+
ptr + 8, cb_data->d_len - 8);
173173
ns_dyn_mem_free(socket_pdu);
174174
}
175175
}
@@ -195,7 +195,7 @@ static int8_t ws_eapol_auth_relay_send_to_kmp(eapol_auth_relay_t *eapol_auth_rel
195195
memcpy(ptr, eui_64, 8);
196196
msg_iov[0].iov_base = temp_array;
197197
msg_iov[0].iov_len = 26;
198-
msg_iov[1].iov_base = (void*)data;
198+
msg_iov[1].iov_base = (void *)data;
199199
msg_iov[1].iov_len = data_len;
200200
socket_sendmsg(eapol_auth_relay->socket_id, &msghdr, NS_MSG_LEGACY0);
201201
return 0;

source/6LoWPAN/ws/ws_eapol_pdu.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ int8_t ws_eapol_pdu_delete(protocol_interface_info_entry_t *interface_ptr)
128128
int8_t ws_eapol_pdu_cb_register(protocol_interface_info_entry_t *interface_ptr, const eapol_pdu_recv_cb_data_t *cb_data)
129129
{
130130
if (!interface_ptr || !cb_data) {
131-
return -1;
131+
return -1;
132132
}
133133

134134
eapol_pdu_data_t *eapol_pdu_data = ws_eapol_pdu_data_get(interface_ptr);
@@ -160,7 +160,7 @@ int8_t ws_eapol_pdu_cb_register(protocol_interface_info_entry_t *interface_ptr,
160160
int8_t ws_eapol_pdu_cb_unregister(protocol_interface_info_entry_t *interface_ptr, const eapol_pdu_recv_cb_data_t *cb_data)
161161
{
162162
if (!interface_ptr || !cb_data) {
163-
return -1;
163+
return -1;
164164
}
165165

166166
eapol_pdu_data_t *eapol_pdu_data = ws_eapol_pdu_data_get(interface_ptr);
@@ -193,7 +193,7 @@ int8_t ws_eapol_pdu_send_to_mpx(protocol_interface_info_entry_t *interface_ptr,
193193

194194
eapol_pdu_msdu_t *msdu_entry = ns_dyn_mem_temporary_alloc(sizeof(eapol_pdu_msdu_t));
195195
if (!msdu_entry) {
196-
return -1;
196+
return -1;
197197
}
198198
msdu_entry->data_ptr = data;
199199
msdu_entry->buffer = buffer;
@@ -240,12 +240,12 @@ int8_t ws_eapol_pdu_mpx_register(protocol_interface_info_entry_t *interface_ptr,
240240
eapol_pdu_data->mpx_user_id = mpx_user_id;
241241

242242
if (eapol_pdu_data->mpx_api) {
243-
eapol_pdu_data->mpx_api->mpx_user_registration(eapol_pdu_data->mpx_api, ws_eapol_pdu_mpx_data_confirm, ws_eapol_pdu_mpx_data_indication, eapol_pdu_data->mpx_user_id);
243+
eapol_pdu_data->mpx_api->mpx_user_registration(eapol_pdu_data->mpx_api, ws_eapol_pdu_mpx_data_confirm, ws_eapol_pdu_mpx_data_indication, eapol_pdu_data->mpx_user_id);
244244
}
245245
return 0;
246246
}
247247

248-
static void ws_eapol_pdu_mpx_data_confirm(const mpx_api_t* api, const struct mcps_data_conf_s *data)
248+
static void ws_eapol_pdu_mpx_data_confirm(const mpx_api_t *api, const struct mcps_data_conf_s *data)
249249
{
250250
eapol_pdu_data_t *eapol_pdu_data = NULL;
251251

@@ -261,19 +261,19 @@ static void ws_eapol_pdu_mpx_data_confirm(const mpx_api_t* api, const struct mcp
261261
}
262262

263263
ns_list_foreach(eapol_pdu_msdu_t, msdu, &eapol_pdu_data->msdu_list) {
264-
if (msdu->handle == data->msduHandle) {
265-
ns_dyn_mem_free(msdu->buffer);
266-
ns_list_remove(&eapol_pdu_data->msdu_list, msdu);
267-
ns_dyn_mem_free(msdu);
268-
return;
269-
}
264+
if (msdu->handle == data->msduHandle) {
265+
ns_dyn_mem_free(msdu->buffer);
266+
ns_list_remove(&eapol_pdu_data->msdu_list, msdu);
267+
ns_dyn_mem_free(msdu);
268+
return;
269+
}
270270
}
271271
}
272272

273273
static void ws_eapol_pdu_mpx_data_indication(const mpx_api_t *api, const struct mcps_data_ind_s *data)
274274
{
275275
if (!data || !data->msduLength || !data->msdu_ptr) {
276-
return;
276+
return;
277277
}
278278

279279
eapol_pdu_data_t *eapol_pdu_data = NULL;

source/6LoWPAN/ws/ws_eapol_relay.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@ static void ws_eapol_relay_socket_cb(void *cb)
178178
ns_address_t src_addr;
179179

180180
if (socket_recvfrom(cb_data->socket_id, socket_pdu, cb_data->d_len, 0, &src_addr) != cb_data->d_len) {
181-
ns_dyn_mem_free(socket_pdu);
182-
return;
181+
ns_dyn_mem_free(socket_pdu);
182+
return;
183183
}
184184

185185
//First 8 byte is EUID64 and rsr payload

source/6LoWPAN/ws/ws_eapol_relay_lib.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ int8_t ws_eapol_relay_lib_send_to_relay(const uint8_t socket_id, const uint8_t *
4141
msghdr.msg_iovlen = 2;
4242
msghdr.msg_control = NULL;
4343
msghdr.msg_controllen = 0;
44-
msg_iov[0].iov_base = (void*)eui_64;
44+
msg_iov[0].iov_base = (void *)eui_64;
4545
msg_iov[0].iov_len = 8;
46-
msg_iov[1].iov_base = (void*)data;
46+
msg_iov[1].iov_base = (void *)data;
4747
msg_iov[1].iov_len = data_len;
4848
socket_sendmsg(socket_id, &msghdr, NS_MSG_LEGACY0);
4949
return 0;

source/6LoWPAN/ws/ws_pae_auth.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -225,12 +225,12 @@ static int8_t ws_pae_auth_event_send(kmp_service_t *service, void *data)
225225
}
226226

227227
arm_event_s event = {
228-
.receiver = tasklet_id,
229-
.sender = 0,
230-
.event_id = pae_auth->interface_ptr->id,
231-
.data_ptr = data,
232-
.event_type = PAE_TASKLET_EVENT,
233-
.priority = ARM_LIB_LOW_PRIORITY_EVENT,
228+
.receiver = tasklet_id,
229+
.sender = 0,
230+
.event_id = pae_auth->interface_ptr->id,
231+
.data_ptr = data,
232+
.event_type = PAE_TASKLET_EVENT,
233+
.priority = ARM_LIB_LOW_PRIORITY_EVENT,
234234
};
235235

236236
if (eventOS_event_send(&event) != 0) {
@@ -347,7 +347,7 @@ static void ws_pae_auth_kmp_service_addr_get(kmp_service_t *service, kmp_api_t *
347347
#endif
348348

349349
// For now fixed since not yet support for EA-IE in supplicants
350-
uint8_t addr[8] = {0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08};
350+
uint8_t addr[8] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08};
351351
kmp_address_eui_64_set(local_addr, addr);
352352

353353
// Get supplicant address
@@ -417,10 +417,10 @@ static kmp_api_t *ws_pae_auth_kmp_incoming_ind(kmp_service_t *service, kmp_type_
417417
}
418418

419419
kmp_api_cb_register(kmp,
420-
ws_pae_auth_kmp_api_create_confirm,
421-
ws_pae_auth_kmp_api_create_indication,
422-
ws_pae_auth_kmp_api_finished_indication,
423-
ws_pae_auth_kmp_api_finished);
420+
ws_pae_auth_kmp_api_create_confirm,
421+
ws_pae_auth_kmp_api_create_indication,
422+
ws_pae_auth_kmp_api_finished_indication,
423+
ws_pae_auth_kmp_api_finished);
424424

425425
if (kmp_api_start(kmp) < 0) {
426426
ws_pae_lib_kmp_list_delete(&supp_entry->kmp_list, kmp);
@@ -508,10 +508,10 @@ static void ws_pae_auth_kmp_api_finished_indication(kmp_api_t *kmp, kmp_result_e
508508
}
509509

510510
kmp_api_cb_register(new_kmp,
511-
ws_pae_auth_kmp_api_create_confirm,
512-
ws_pae_auth_kmp_api_create_indication,
513-
ws_pae_auth_kmp_api_finished_indication,
514-
ws_pae_auth_kmp_api_finished);
511+
ws_pae_auth_kmp_api_create_confirm,
512+
ws_pae_auth_kmp_api_create_indication,
513+
ws_pae_auth_kmp_api_finished_indication,
514+
ws_pae_auth_kmp_api_finished);
515515

516516
if (kmp_api_start(new_kmp) < 0) {
517517
ws_pae_lib_kmp_list_delete(&supp_entry->kmp_list, new_kmp);

source/6LoWPAN/ws/ws_pae_lib.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ kmp_entry_t *ws_pae_lib_kmp_list_add(kmp_list_t *kmp_list, kmp_api_t *kmp)
4848

4949
entry = ns_dyn_mem_alloc(sizeof(kmp_entry_t));
5050
if (!entry) {
51-
return NULL;
51+
return NULL;
5252
}
5353
entry->kmp = kmp;
5454
entry->timer_running = false;
@@ -150,7 +150,7 @@ supp_entry_t *ws_pae_lib_supp_list_add(supp_list_t *supp_list, const kmp_addr_t
150150
supp_entry_t *entry = ns_dyn_mem_alloc(sizeof(supp_entry_t));
151151

152152
if (!entry) {
153-
return NULL;
153+
return NULL;
154154
}
155155

156156
ws_pae_lib_supp_init(entry);

source/6LoWPAN/ws/ws_pae_supp.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,10 @@ static int8_t ws_pae_supp_initial_key_send(pae_supp_t *pae_supp)
165165
kmp_api_data_set(kmp, kmp_entry);
166166

167167
kmp_api_cb_register(kmp,
168-
ws_pae_supp_kmp_api_create_confirm,
169-
ws_pae_supp_kmp_api_create_indication,
170-
ws_pae_supp_kmp_api_finished_indication,
171-
ws_pae_supp_kmp_api_finished);
168+
ws_pae_supp_kmp_api_create_confirm,
169+
ws_pae_supp_kmp_api_create_indication,
170+
ws_pae_supp_kmp_api_finished_indication,
171+
ws_pae_supp_kmp_api_finished);
172172

173173
if (kmp_api_start(kmp) < 0) {
174174
ws_pae_lib_kmp_list_delete(&pae_supp->entry.kmp_list, kmp);
@@ -343,12 +343,12 @@ static int8_t ws_pae_supp_event_send(kmp_service_t *service, void *data)
343343
}
344344

345345
arm_event_s event = {
346-
.receiver = tasklet_id,
347-
.sender = 0,
348-
.event_id = pae_supp->interface_ptr->id,
349-
.data_ptr = data,
350-
.event_type = PAE_TASKLET_EVENT,
351-
.priority = ARM_LIB_LOW_PRIORITY_EVENT,
346+
.receiver = tasklet_id,
347+
.sender = 0,
348+
.event_id = pae_supp->interface_ptr->id,
349+
.data_ptr = data,
350+
.event_type = PAE_TASKLET_EVENT,
351+
.priority = ARM_LIB_LOW_PRIORITY_EVENT,
352352
};
353353

354354
if (eventOS_event_send(&event) != 0) {
@@ -521,7 +521,7 @@ static void ws_pae_supp_kmp_service_addr_get(kmp_service_t *service, kmp_api_t *
521521
#endif
522522

523523
// For now fixed since not yet support for EA-IE
524-
uint8_t addr[8] = {0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08};
524+
uint8_t addr[8] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08};
525525
kmp_address_eui_64_set(remote_addr, addr);
526526
}
527527

source/DHCPv6_client/dhcpv6_client_service.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ typedef struct {
4040
uint8_t sol_max_rc;
4141
uint8_t libDhcp_instance;
4242
int8_t interface;
43-
bool renew_uses_solicit:1;
43+
bool renew_uses_solicit: 1;
4444
} dhcp_client_class_t;
4545

4646
static dhcp_client_class_t dhcp_client;

source/MAC/IEEE802_15_4/mac_mlme.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -652,8 +652,8 @@ static int8_t mac_mlme_set_ack_wait_duration(protocol_interface_rf_mac_setup_s *
652652
return -1;
653653
}
654654
// MAC timer uses 50us resolution
655-
rf_mac_setup->mac_ack_wait_duration = ack_wait_time_us/50;
656-
tr_debug("Set macAckWaitDuration: %uus", rf_mac_setup->mac_ack_wait_duration*50);
655+
rf_mac_setup->mac_ack_wait_duration = ack_wait_time_us / 50;
656+
tr_debug("Set macAckWaitDuration: %uus", rf_mac_setup->mac_ack_wait_duration * 50);
657657

658658
return 0;
659659
}

source/RPL/rpl_control.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ bool rpl_control_is_dodag_parent(protocol_interface_info_entry_t *interface, con
231231
{
232232
// go through instances and parents and check if they match the address.
233233
ns_list_foreach(struct rpl_instance, instance, &interface->rpl_domain->instances) {
234-
if (rpl_instance_address_is_parent(instance, ll_addr)){
234+
if (rpl_instance_address_is_parent(instance, ll_addr)) {
235235
return true;
236236
}
237237
}

source/Security/PANA/pana_eap_header.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@
5252
*
5353
*/
5454

55-
typedef struct eap_header{
55+
typedef struct eap_header {
5656
uint16_t length;
5757
uint8_t eap_code;
5858
uint8_t id_seq;
5959
uint8_t type;
6060
uint8_t *data_ptr;
6161
} eap_header_t;
6262

63-
typedef struct eap_tls_header{
63+
typedef struct eap_tls_header {
6464
uint8_t *data_ptr;
6565
uint8_t eap_tls_flags;
6666
uint16_t tls_frame_length;

0 commit comments

Comments
 (0)