Skip to content

Commit

Permalink
gnrc: add parenthesis around conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
Yonezawa-T2 committed Dec 10, 2015
1 parent 069012c commit 0981896
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions sys/net/gnrc/network_layer/ipv6/nc/gnrc_ipv6_nc.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ void gnrc_ipv6_nc_remove(kernel_pid_t iface, const ipv6_addr_t *ipv6_addr)

gnrc_ipv6_netif_t *if_entry = gnrc_ipv6_netif_get(iface);

if (if_entry != NULL &&
if_entry->rtr_adv_msg.content.ptr == (char *) entry) {
if ((if_entry != NULL) &&
(if_entry->rtr_adv_msg.content.ptr == (char *) entry)) {
// cancel timer set by gnrc_ndp_rtr_sol_handle
xtimer_remove(&if_entry->rtr_adv_timer);
}
Expand Down
7 changes: 4 additions & 3 deletions sys/net/gnrc/network_layer/sixlowpan/nd/gnrc_sixlowpan_nd.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,11 @@ kernel_pid_t gnrc_sixlowpan_nd_next_hop_l2addr(uint8_t *l2addr, uint8_t *l2addr_
if (nc_entry != NULL) {
gnrc_ipv6_netif_t *ipv6_if = gnrc_ipv6_netif_get(nc_entry->iface);
/* and interface is not 6LoWPAN */
if (!(ipv6_if == NULL || ipv6_if->flags & GNRC_IPV6_NETIF_FLAGS_SIXLOWPAN) ||
if (!((ipv6_if == NULL) ||
(ipv6_if->flags & GNRC_IPV6_NETIF_FLAGS_SIXLOWPAN)) ||
/* or entry is registered */
(gnrc_ipv6_nc_get_type(nc_entry) == GNRC_IPV6_NC_TYPE_REGISTERED)) {
next_hop = dst;
(gnrc_ipv6_nc_get_type(nc_entry) == GNRC_IPV6_NC_TYPE_REGISTERED)) {
next_hop = dst;
}
}
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ static void _add_prefix(kernel_pid_t iface, gnrc_sixlowpan_nd_router_abr_t *abr,

prf_ent = _get_free_prefix(ipv6_iface, &pi_opt->prefix, pi_opt->prefix_len);

if (prf_ent != NULL && prf_ent->iface == NULL) {
if ((prf_ent != NULL) && (prf_ent->iface == NULL)) {
prf_ent->iface = ipv6_iface;
prf_ent->prefix = container_of(prefix, gnrc_ipv6_netif_addr_t, addr);
LL_PREPEND(abr->prfs, prf_ent);
Expand Down

0 comments on commit 0981896

Please sign in to comment.