From ff2a1dc61b02c520e97c8bb3846ae550244ac8f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Kijewski?= Date: Fri, 14 Nov 2014 10:52:11 +0100 Subject: [PATCH] core: remove needless test in msg.c `thread.c` initializes a thread with an empty message queue. `cib_put()` will `return -1` for an empty CIB, so there is no need to test if `thread->msg_array != NULL`. --- core/msg.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/core/msg.c b/core/msg.c index aa006cb662..136c4069ef 100644 --- a/core/msg.c +++ b/core/msg.c @@ -41,14 +41,9 @@ static int _msg_send(msg_t *m, kernel_pid_t target_pid, bool block); static int queue_msg(tcb_t *target, const msg_t *m) { - if (target->msg_array == NULL) { - DEBUG("queue_msg(): no message queue present\n"); - return 0; - } - int n = cib_put(&(target->msg_queue)); if (n < 0) { - DEBUG("queue_msg(): message queue is full\n"); + DEBUG("queue_msg(): message queue is full (or there is none)\n"); return 0; }