mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-24 14:03:55 +01:00
gnrc/rpl/dodag: ret void for gnrc_rpl_instance_remove
`gnrc_rpl_instance_remove` can't fail, so it was already always returning `true`.
This commit is contained in:
parent
5139847376
commit
b025edc726
@ -80,11 +80,8 @@ bool gnrc_rpl_instance_remove_by_id(uint8_t instance_id);
|
||||
* @brief Remove a RPL instance with the pointer @p inst.
|
||||
*
|
||||
* @param[in] inst Pointer to the RPL instance to remove.
|
||||
*
|
||||
* @return true, on success.
|
||||
* @return false, otherwise.
|
||||
*/
|
||||
bool gnrc_rpl_instance_remove(gnrc_rpl_instance_t *inst);
|
||||
void gnrc_rpl_instance_remove(gnrc_rpl_instance_t *inst);
|
||||
|
||||
/**
|
||||
* @brief Get the RPL instance with the id @p instance_id.
|
||||
|
||||
@ -115,13 +115,14 @@ bool gnrc_rpl_instance_remove_by_id(uint8_t instance_id)
|
||||
{
|
||||
for(uint8_t i = 0; i < GNRC_RPL_INSTANCES_NUMOF; ++i) {
|
||||
if (gnrc_rpl_instances[i].id == instance_id) {
|
||||
return gnrc_rpl_instance_remove(&gnrc_rpl_instances[i]);
|
||||
gnrc_rpl_instance_remove(&gnrc_rpl_instances[i]);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool gnrc_rpl_instance_remove(gnrc_rpl_instance_t *inst)
|
||||
void gnrc_rpl_instance_remove(gnrc_rpl_instance_t *inst)
|
||||
{
|
||||
gnrc_rpl_dodag_t *dodag = &inst->dodag;
|
||||
#ifdef MODULE_GNRC_RPL_P2P
|
||||
@ -132,7 +133,6 @@ bool gnrc_rpl_instance_remove(gnrc_rpl_instance_t *inst)
|
||||
evtimer_del(&gnrc_rpl_evtimer, (evtimer_event_t *)&dodag->dao_event);
|
||||
evtimer_del(&gnrc_rpl_evtimer, (evtimer_event_t *)&inst->cleanup_event);
|
||||
memset(inst, 0, sizeof(gnrc_rpl_instance_t));
|
||||
return true;
|
||||
}
|
||||
|
||||
gnrc_rpl_instance_t *gnrc_rpl_instance_get(uint8_t instance_id)
|
||||
|
||||
@ -106,10 +106,7 @@ int _gnrc_rpl_instance_remove(char *arg1)
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (gnrc_rpl_instance_remove(inst) == false) {
|
||||
printf("error: could not remove instance (%d)\n", instance_id);
|
||||
return 1;
|
||||
}
|
||||
gnrc_rpl_instance_remove(inst);
|
||||
|
||||
printf("success: removed instance (%d)\n", instance_id);
|
||||
return 0;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user