lib: remove redundant check for null

Statement "cont = dropped_item != NULL" first checks if "dropped_item"
returns null or not null, then assigns to "cont".
If "dropped_item" is null then "cont = 0",
if "dropped_item" is not null then "cont = 1".

As a result in line below no need to check "dropped_item" again
It is enough to check state of the "cont" variable,
to be sure what returned "dropped_item".

Found as a coding guideline violation (MISRA R4.1) by static
coding scanning tool.

Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
This commit is contained in:
Maksim Masalski 2021-05-26 15:45:55 +08:00 committed by Kumar Gala
commit 7711435347

View file

@ -212,7 +212,7 @@ void mpsc_pbuf_put_word(struct mpsc_pbuf_buffer *buffer,
k_spin_unlock(&buffer->lock, key);
if (cont && dropped_item && valid_drop) {
if (cont && valid_drop) {
/* Notify about item being dropped. */
buffer->notify_drop(buffer, dropped_item);
}