Commit 82aa95ee authored by Stefan Wahren's avatar Stefan Wahren Committed by Greg Kroah-Hartman

staging: vchiq_core: Drop unnecessary check in notify_bulks

There is no modification to the vchiq_status before the first if, so drop
this unnecessary check.
Reviewed-by: default avatarNicolas Saenz Julienne <nsaenz@kernel.org>
Signed-off-by: default avatarStefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1619347863-16080-6-git-send-email-stefan.wahren@i2se.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 08f31d01
...@@ -1257,61 +1257,59 @@ notify_bulks(struct vchiq_service *service, struct vchiq_bulk_queue *queue, ...@@ -1257,61 +1257,59 @@ notify_bulks(struct vchiq_service *service, struct vchiq_bulk_queue *queue,
queue->remote_notify = queue->process; queue->remote_notify = queue->process;
if (status == VCHIQ_SUCCESS) { while (queue->remove != queue->remote_notify) {
while (queue->remove != queue->remote_notify) { struct vchiq_bulk *bulk =
struct vchiq_bulk *bulk = &queue->bulks[BULK_INDEX(queue->remove)];
&queue->bulks[BULK_INDEX(queue->remove)];
/* /*
* Only generate callbacks for non-dummy bulk * Only generate callbacks for non-dummy bulk
* requests, and non-terminated services * requests, and non-terminated services
*/ */
if (bulk->data && service->instance) { if (bulk->data && service->instance) {
if (bulk->actual != VCHIQ_BULK_ACTUAL_ABORTED) { if (bulk->actual != VCHIQ_BULK_ACTUAL_ABORTED) {
if (bulk->dir == VCHIQ_BULK_TRANSMIT) { if (bulk->dir == VCHIQ_BULK_TRANSMIT) {
VCHIQ_SERVICE_STATS_INC(service, VCHIQ_SERVICE_STATS_INC(service,
bulk_tx_count); bulk_tx_count);
VCHIQ_SERVICE_STATS_ADD(service, VCHIQ_SERVICE_STATS_ADD(service,
bulk_tx_bytes, bulk_tx_bytes,
bulk->actual); bulk->actual);
} else {
VCHIQ_SERVICE_STATS_INC(service,
bulk_rx_count);
VCHIQ_SERVICE_STATS_ADD(service,
bulk_rx_bytes,
bulk->actual);
}
} else { } else {
VCHIQ_SERVICE_STATS_INC(service, VCHIQ_SERVICE_STATS_INC(service,
bulk_aborted_count); bulk_rx_count);
VCHIQ_SERVICE_STATS_ADD(service,
bulk_rx_bytes,
bulk->actual);
} }
if (bulk->mode == VCHIQ_BULK_MODE_BLOCKING) { } else {
struct bulk_waiter *waiter; VCHIQ_SERVICE_STATS_INC(service,
bulk_aborted_count);
spin_lock(&bulk_waiter_spinlock); }
waiter = bulk->userdata; if (bulk->mode == VCHIQ_BULK_MODE_BLOCKING) {
if (waiter) { struct bulk_waiter *waiter;
waiter->actual = bulk->actual;
complete(&waiter->event); spin_lock(&bulk_waiter_spinlock);
} waiter = bulk->userdata;
spin_unlock(&bulk_waiter_spinlock); if (waiter) {
} else if (bulk->mode == waiter->actual = bulk->actual;
VCHIQ_BULK_MODE_CALLBACK) { complete(&waiter->event);
enum vchiq_reason reason =
get_bulk_reason(bulk);
status = make_service_callback(service,
reason, NULL, bulk->userdata);
if (status == VCHIQ_RETRY)
break;
} }
spin_unlock(&bulk_waiter_spinlock);
} else if (bulk->mode ==
VCHIQ_BULK_MODE_CALLBACK) {
enum vchiq_reason reason =
get_bulk_reason(bulk);
status = make_service_callback(service,
reason, NULL, bulk->userdata);
if (status == VCHIQ_RETRY)
break;
} }
queue->remove++;
complete(&service->bulk_remove_event);
} }
if (!retry_poll)
status = VCHIQ_SUCCESS; queue->remove++;
complete(&service->bulk_remove_event);
} }
if (!retry_poll)
status = VCHIQ_SUCCESS;
if (status == VCHIQ_RETRY) if (status == VCHIQ_RETRY)
request_poll(service->state, service, request_poll(service->state, service,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment