Commit 63276d45 authored by Stefan Wahren's avatar Stefan Wahren Committed by Greg Kroah-Hartman
Browse files

staging: vchiq_core: introduce service skip



In case there is no service pointer provided, we can skip these polling.
Use a goto to reduce the indentation, which is necessary for the following
patches. Btw fix the brace alignment of the loops.

Signed-off-by: default avatarStefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1618164700-21150-6-git-send-email-stefan.wahren@i2se.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b3582ed4
Loading
Loading
Loading
Loading
+14 −13
Original line number Diff line number Diff line
@@ -538,7 +538,9 @@ request_poll(struct vchiq_state *state, struct vchiq_service *service,
{
	u32 value;

	if (service) {
	if (!service)
		goto skip_service;

	do {
		value = atomic_read(&service->poll_flags);
	} while (atomic_cmpxchg(&service->poll_flags, value,
@@ -548,11 +550,10 @@ request_poll(struct vchiq_state *state, struct vchiq_service *service,
		value = atomic_read(&state->poll_services[
			service->localport>>5]);
	} while (atomic_cmpxchg(
			&state->poll_services[service->localport>>5],
			value, value | BIT(service->localport & 0x1f))
			!= value);
	}
		 &state->poll_services[service->localport>>5], value,
		 value | BIT(service->localport & 0x1f)) != value);

skip_service:
	state->poll_needed = 1;
	wmb();