diff options
author | Stefan Wahren <stefan.wahren@i2se.com> | 2021-06-03 17:49:59 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-06-04 15:10:02 +0200 |
commit | 75f0a4f2c1f7c59c921756210914419232e7684d (patch) | |
tree | 47f80fed98934c8a476c0ec9d8ffa5d2cf8a9bec /drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c | |
parent | 86aee79ed49c8513faefe3b5a0d1324663e640cf (diff) | |
download | linux-75f0a4f2c1f7c59c921756210914419232e7684d.tar.bz2 |
staging: vchiq_core: simplify WARN_ON conditions
During a recent review Dan Carpenter noticed a double negation in a WARN_ON.
But a quick search revealed more unnecessary complex WARN_ON conditions.
This change should simplify them.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1622735405-9980-11-git-send-email-stefan.wahren@i2se.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c')
-rw-r--r-- | drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c index 99624cab0841..2e1b21801121 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c @@ -924,7 +924,7 @@ queue_message(struct vchiq_state *state, struct vchiq_service *service, stride = calc_stride(size); - WARN_ON(!(stride <= VCHIQ_SLOT_SIZE)); + WARN_ON(stride > VCHIQ_SLOT_SIZE); if (!(flags & QMFLAGS_NO_MUTEX_LOCK) && mutex_lock_killable(&state->slot_mutex)) @@ -1480,8 +1480,8 @@ abort_outstanding_bulks(struct vchiq_service *service, service->state->id, service->localport, is_tx ? 't' : 'r', queue->local_insert, queue->remote_insert, queue->process); - WARN_ON(!((int)(queue->local_insert - queue->process) >= 0)); - WARN_ON(!((int)(queue->remote_insert - queue->process) >= 0)); + WARN_ON((int)(queue->local_insert - queue->process) < 0); + WARN_ON((int)(queue->remote_insert - queue->process) < 0); while ((queue->process != queue->local_insert) || (queue->process != queue->remote_insert)) { @@ -1729,7 +1729,7 @@ parse_message(struct vchiq_state *state, struct vchiq_header *header) switch (type) { case VCHIQ_MSG_OPEN: - WARN_ON(!(VCHIQ_MSG_DSTPORT(msgid) == 0)); + WARN_ON(VCHIQ_MSG_DSTPORT(msgid)); if (!parse_open(state, header)) goto bail_not_ready; break; @@ -1756,7 +1756,7 @@ parse_message(struct vchiq_state *state, struct vchiq_header *header) } break; case VCHIQ_MSG_CLOSE: - WARN_ON(size != 0); /* There should be no data */ + WARN_ON(size); /* There should be no data */ vchiq_log_info(vchiq_core_log_level, "%d: prs CLOSE@%pK (%d->%d)", @@ -1958,7 +1958,7 @@ parse_rx_slots(struct vchiq_state *state) if (!state->rx_data) { int rx_index; - WARN_ON(!((state->rx_pos & VCHIQ_SLOT_MASK) == 0)); + WARN_ON(state->rx_pos & VCHIQ_SLOT_MASK); rx_index = remote->slot_queue[ SLOT_QUEUE_INDEX_FROM_POS_MASKED(state->rx_pos)]; state->rx_data = (char *)SLOT_DATA_FROM_INDEX(state, |