mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
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`.
This commit is contained in:
parent
2b0d49c8b1
commit
ff2a1dc61b
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user