Commit 64336f46 authored by Abramo Bagnara's avatar Abramo Bagnara Committed by Anas Nashif
Browse files

coding guidelines: comply with MISRA C:2012 Rule 13.4



In particular:

- avoid to use assignment expression value

Signed-off-by: default avatarAbramo Bagnara <abramo.bagnara@bugseng.com>
parent 37f14232
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -215,7 +215,7 @@ struct rbnode *z_rb_foreach_next(struct rbtree *tree, struct _rb_foreach *f);
	for (struct _rb_foreach __f = _RB_FOREACH_INIT(tree, node);	   \
			({struct rbnode *n = z_rb_foreach_next((tree), &__f); \
			 (node) = (n != NULL) ? CONTAINER_OF(n, __typeof__(*(node)),   \
					 field) : NULL; }) != NULL;        \
					 field) : NULL; (node); }) != NULL;        \
			 /**/)

/** @} */
+5 −2
Original line number Diff line number Diff line
@@ -75,8 +75,11 @@ int z_impl_k_condvar_broadcast(struct k_condvar *condvar)
	SYS_PORT_TRACING_OBJ_FUNC_ENTER(k_condvar, broadcast, condvar);

	/* wake up any threads that are waiting to write */
	while ((pending_thread = z_unpend_first_thread(&condvar->wait_q)) !=
	       NULL) {
	for (;;) {
		pending_thread = z_unpend_first_thread(&condvar->wait_q);
		if (pending_thread == NULL) {
			break;
		}
		woken++;
		arch_thread_return_value_set(pending_thread, 0);
		z_ready_thread(pending_thread);
+5 −1
Original line number Diff line number Diff line
@@ -325,7 +325,11 @@ void z_impl_k_msgq_purge(struct k_msgq *msgq)
	SYS_PORT_TRACING_OBJ_FUNC(k_msgq, purge, msgq);

	/* wake up any threads that are waiting to write */
	while ((pending_thread = z_unpend_first_thread(&msgq->wait_q)) != NULL) {
	for (;;) {
		pending_thread = z_unpend_first_thread(&msgq->wait_q);
		if (pending_thread == NULL) {
			break;
		}
		arch_thread_return_value_set(pending_thread, -ENOMSG);
		z_ready_thread(pending_thread);
	}
+5 −1
Original line number Diff line number Diff line
@@ -318,7 +318,11 @@ static bool pipe_xfer_prepare(sys_dlist_t *xfer_list,
	sys_dlist_init(xfer_list);
	num_bytes = 0;

	while ((thread = z_waitq_head(wait_q)) != NULL) {
	for (;;) {
		thread = z_waitq_head(wait_q);
		if (thread == NULL) {
			break;
		}
		desc = (struct k_pipe_desc *)thread->base.swap_data;
		num_bytes += desc->bytes_to_xfer;

+10 −2
Original line number Diff line number Diff line
@@ -1081,7 +1081,11 @@ int z_unpend_all(_wait_q_t *wait_q)
	int need_sched = 0;
	struct k_thread *thread;

	while ((thread = z_waitq_head(wait_q)) != NULL) {
	for (;;) {
		thread = z_waitq_head(wait_q);
		if (thread == NULL) {
			break;
		}
		z_unpend_thread(thread);
		z_ready_thread(thread);
		need_sched = 1;
@@ -1466,7 +1470,11 @@ static inline void unpend_all(_wait_q_t *wait_q)
{
	struct k_thread *thread;

	while ((thread = z_waitq_head(wait_q)) != NULL) {
	for (;;) {
		thread = z_waitq_head(wait_q);
		if (thread == NULL) {
			break;
		}
		unpend_thread_no_timeout(thread);
		(void)z_abort_thread_timeout(thread);
		arch_thread_return_value_set(thread, 0);
Loading