mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-05 15:49:42 -04:00
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: Nicolas Saenz Julienne <nsaenz@kernel.org> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Link: https://lore.kernel.org/r/1619347863-16080-6-git-send-email-stefan.wahren@i2se.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
08f31d0196
commit
82aa95ee2d
@@ -1257,61 +1257,59 @@ notify_bulks(struct vchiq_service *service, struct vchiq_bulk_queue *queue,
|
||||
|
||||
queue->remote_notify = queue->process;
|
||||
|
||||
if (status == VCHIQ_SUCCESS) {
|
||||
while (queue->remove != queue->remote_notify) {
|
||||
struct vchiq_bulk *bulk =
|
||||
&queue->bulks[BULK_INDEX(queue->remove)];
|
||||
while (queue->remove != queue->remote_notify) {
|
||||
struct vchiq_bulk *bulk =
|
||||
&queue->bulks[BULK_INDEX(queue->remove)];
|
||||
|
||||
/*
|
||||
* Only generate callbacks for non-dummy bulk
|
||||
* requests, and non-terminated services
|
||||
*/
|
||||
if (bulk->data && service->instance) {
|
||||
if (bulk->actual != VCHIQ_BULK_ACTUAL_ABORTED) {
|
||||
if (bulk->dir == VCHIQ_BULK_TRANSMIT) {
|
||||
VCHIQ_SERVICE_STATS_INC(service,
|
||||
bulk_tx_count);
|
||||
VCHIQ_SERVICE_STATS_ADD(service,
|
||||
bulk_tx_bytes,
|
||||
bulk->actual);
|
||||
} else {
|
||||
VCHIQ_SERVICE_STATS_INC(service,
|
||||
bulk_rx_count);
|
||||
VCHIQ_SERVICE_STATS_ADD(service,
|
||||
bulk_rx_bytes,
|
||||
bulk->actual);
|
||||
}
|
||||
/*
|
||||
* Only generate callbacks for non-dummy bulk
|
||||
* requests, and non-terminated services
|
||||
*/
|
||||
if (bulk->data && service->instance) {
|
||||
if (bulk->actual != VCHIQ_BULK_ACTUAL_ABORTED) {
|
||||
if (bulk->dir == VCHIQ_BULK_TRANSMIT) {
|
||||
VCHIQ_SERVICE_STATS_INC(service,
|
||||
bulk_tx_count);
|
||||
VCHIQ_SERVICE_STATS_ADD(service,
|
||||
bulk_tx_bytes,
|
||||
bulk->actual);
|
||||
} else {
|
||||
VCHIQ_SERVICE_STATS_INC(service,
|
||||
bulk_aborted_count);
|
||||
}
|
||||
if (bulk->mode == VCHIQ_BULK_MODE_BLOCKING) {
|
||||
struct bulk_waiter *waiter;
|
||||
|
||||
spin_lock(&bulk_waiter_spinlock);
|
||||
waiter = bulk->userdata;
|
||||
if (waiter) {
|
||||
waiter->actual = bulk->actual;
|
||||
complete(&waiter->event);
|
||||
}
|
||||
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;
|
||||
bulk_rx_count);
|
||||
VCHIQ_SERVICE_STATS_ADD(service,
|
||||
bulk_rx_bytes,
|
||||
bulk->actual);
|
||||
}
|
||||
} else {
|
||||
VCHIQ_SERVICE_STATS_INC(service,
|
||||
bulk_aborted_count);
|
||||
}
|
||||
if (bulk->mode == VCHIQ_BULK_MODE_BLOCKING) {
|
||||
struct bulk_waiter *waiter;
|
||||
|
||||
queue->remove++;
|
||||
complete(&service->bulk_remove_event);
|
||||
spin_lock(&bulk_waiter_spinlock);
|
||||
waiter = bulk->userdata;
|
||||
if (waiter) {
|
||||
waiter->actual = bulk->actual;
|
||||
complete(&waiter->event);
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
if (!retry_poll)
|
||||
status = VCHIQ_SUCCESS;
|
||||
|
||||
queue->remove++;
|
||||
complete(&service->bulk_remove_event);
|
||||
}
|
||||
if (!retry_poll)
|
||||
status = VCHIQ_SUCCESS;
|
||||
|
||||
if (status == VCHIQ_RETRY)
|
||||
request_poll(service->state, service,
|
||||
|
||||
Reference in New Issue
Block a user