Commit 38267069 authored by frei tycho's avatar frei tycho Committed by Johan Hedberg
Browse files

net: change controlling expressions in while to Boolean



Use `do { ... } while (false)` instead of `do { ... } while (0)`.

Signed-off-by: default avatarfrei tycho <tfrei@baumer.com>
parent ac8620c7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -490,7 +490,7 @@ static void dbg_update_neighbor_lladdr_raw(uint8_t *new_lladdr,
			net_sprint_ipv6_addr(dst),		\
			net_pkt_iface(pkt),				\
			net_if_get_by_iface(net_pkt_iface(pkt)));	\
	} while (0)
	} while (false)

#define dbg_addr_recv(pkt_str, src, dst, pkt)	\
	dbg_addr("Received", pkt_str, src, dst, pkt)
@@ -508,7 +508,7 @@ static void dbg_update_neighbor_lladdr_raw(uint8_t *new_lladdr,
			net_sprint_ipv6_addr(target),	\
			net_pkt_iface(pkt),				\
			net_if_get_by_iface(net_pkt_iface(pkt)));	\
	} while (0)
	} while (false)

#define dbg_addr_recv_tgt(pkt_str, src, dst, tgt, pkt)		\
	dbg_addr_with_tgt("Received", pkt_str, src, dst, tgt, pkt)
+1 −1
Original line number Diff line number Diff line
@@ -130,7 +130,7 @@ static sys_slist_t timestamp_callbacks;
			net_pkt_iface(pkt));				\
									\
		NET_ASSERT(pkt->frags);					\
	} while (0)
	} while (false)
#else
#define debug_check_packet(...)
#endif /* CONFIG_NET_IF_LOG_LEVEL >= LOG_LEVEL_DBG */
+1 −1
Original line number Diff line number Diff line
@@ -263,7 +263,7 @@ void net_pkt_allocs_foreach(net_pkt_allocs_cb_t cb, void *user_data)
			NET_ERR("**ERROR** frag %p not in use (%s:%s():%d)", \
				frag, __FILE__, __func__, __LINE__);     \
		}                                                       \
	} while (0)
	} while (false)

const char *net_pkt_slab2str(struct k_mem_slab *slab)
{
+1 −1
Original line number Diff line number Diff line
@@ -258,7 +258,7 @@ static int nbr_nexthop_put(struct net_nbr *nbr)
			net_sprint_ipv6_addr(dst),		\
			net_sprint_ipv6_addr(naddr),	\
			route->iface);					\
	} } while (0)
	} } while (false)

/* Route was accessed, so place it in front of the routes list */
static inline void update_route_access(struct net_route_entry *route)
+1 −1
Original line number Diff line number Diff line
@@ -334,7 +334,7 @@ enum tp_type tp_msg_to_type(const char *s)
		type = _type;		\
		goto out;		\
	}				\
} while (0)
} while (false)

	is_tp(s, TP_COMMAND);
	is_tp(s, TP_CONFIG_REQUEST);
Loading