Commit 11070017 authored by Marcelo Diop-Gonzalez's avatar Marcelo Diop-Gonzalez Committed by Greg Kroah-Hartman

staging: vc04_services: remove unneeded parentheses

there are extra parentheses around many conditional statements
that make things a little harder to read
Signed-off-by: default avatarMarcelo Diop-Gonzalez <marcgonzalez@google.com>
Link: https://lore.kernel.org/r/41511abf64f73af62f21f8e0c7457edc289af905.1581532523.git.marcgonzalez@google.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 147eda29
...@@ -138,8 +138,8 @@ find_service_by_handle(unsigned int handle) ...@@ -138,8 +138,8 @@ find_service_by_handle(unsigned int handle)
spin_lock(&service_spinlock); spin_lock(&service_spinlock);
service = handle_to_service(handle); service = handle_to_service(handle);
if (service && (service->srvstate != VCHIQ_SRVSTATE_FREE) && if (service && service->srvstate != VCHIQ_SRVSTATE_FREE &&
(service->handle == handle)) { service->handle == handle) {
WARN_ON(service->ref_count == 0); WARN_ON(service->ref_count == 0);
service->ref_count++; service->ref_count++;
} else } else
...@@ -161,7 +161,7 @@ find_service_by_port(struct vchiq_state *state, int localport) ...@@ -161,7 +161,7 @@ find_service_by_port(struct vchiq_state *state, int localport)
if ((unsigned int)localport <= VCHIQ_PORT_MAX) { if ((unsigned int)localport <= VCHIQ_PORT_MAX) {
spin_lock(&service_spinlock); spin_lock(&service_spinlock);
service = state->services[localport]; service = state->services[localport];
if (service && (service->srvstate != VCHIQ_SRVSTATE_FREE)) { if (service && service->srvstate != VCHIQ_SRVSTATE_FREE) {
WARN_ON(service->ref_count == 0); WARN_ON(service->ref_count == 0);
service->ref_count++; service->ref_count++;
} else } else
...@@ -184,9 +184,9 @@ find_service_for_instance(struct vchiq_instance *instance, ...@@ -184,9 +184,9 @@ find_service_for_instance(struct vchiq_instance *instance,
spin_lock(&service_spinlock); spin_lock(&service_spinlock);
service = handle_to_service(handle); service = handle_to_service(handle);
if (service && (service->srvstate != VCHIQ_SRVSTATE_FREE) && if (service && service->srvstate != VCHIQ_SRVSTATE_FREE &&
(service->handle == handle) && service->handle == handle &&
(service->instance == instance)) { service->instance == instance) {
WARN_ON(service->ref_count == 0); WARN_ON(service->ref_count == 0);
service->ref_count++; service->ref_count++;
} else } else
...@@ -209,10 +209,10 @@ find_closed_service_for_instance(struct vchiq_instance *instance, ...@@ -209,10 +209,10 @@ find_closed_service_for_instance(struct vchiq_instance *instance,
spin_lock(&service_spinlock); spin_lock(&service_spinlock);
service = handle_to_service(handle); service = handle_to_service(handle);
if (service && if (service &&
((service->srvstate == VCHIQ_SRVSTATE_FREE) || (service->srvstate == VCHIQ_SRVSTATE_FREE ||
(service->srvstate == VCHIQ_SRVSTATE_CLOSED)) && service->srvstate == VCHIQ_SRVSTATE_CLOSED) &&
(service->handle == handle) && service->handle == handle &&
(service->instance == instance)) { service->instance == instance) {
WARN_ON(service->ref_count == 0); WARN_ON(service->ref_count == 0);
service->ref_count++; service->ref_count++;
} else } else
...@@ -237,8 +237,8 @@ next_service_by_instance(struct vchiq_state *state, struct vchiq_instance *insta ...@@ -237,8 +237,8 @@ next_service_by_instance(struct vchiq_state *state, struct vchiq_instance *insta
while (idx < state->unused_service) { while (idx < state->unused_service) {
struct vchiq_service *srv = state->services[idx++]; struct vchiq_service *srv = state->services[idx++];
if (srv && (srv->srvstate != VCHIQ_SRVSTATE_FREE) && if (srv && srv->srvstate != VCHIQ_SRVSTATE_FREE &&
(srv->instance == instance)) { srv->instance == instance) {
service = srv; service = srv;
WARN_ON(service->ref_count == 0); WARN_ON(service->ref_count == 0);
service->ref_count++; service->ref_count++;
...@@ -464,10 +464,10 @@ get_listening_service(struct vchiq_state *state, int fourcc) ...@@ -464,10 +464,10 @@ get_listening_service(struct vchiq_state *state, int fourcc)
struct vchiq_service *service = state->services[i]; struct vchiq_service *service = state->services[i];
if (service && if (service &&
(service->public_fourcc == fourcc) && service->public_fourcc == fourcc &&
((service->srvstate == VCHIQ_SRVSTATE_LISTENING) || (service->srvstate == VCHIQ_SRVSTATE_LISTENING ||
((service->srvstate == VCHIQ_SRVSTATE_OPEN) && (service->srvstate == VCHIQ_SRVSTATE_OPEN &&
(service->remoteport == VCHIQ_PORT_FREE)))) { service->remoteport == VCHIQ_PORT_FREE))) {
lock_service(service); lock_service(service);
return service; return service;
} }
...@@ -485,8 +485,8 @@ get_connected_service(struct vchiq_state *state, unsigned int port) ...@@ -485,8 +485,8 @@ get_connected_service(struct vchiq_state *state, unsigned int port)
for (i = 0; i < state->unused_service; i++) { for (i = 0; i < state->unused_service; i++) {
struct vchiq_service *service = state->services[i]; struct vchiq_service *service = state->services[i];
if (service && (service->srvstate == VCHIQ_SRVSTATE_OPEN) if (service && service->srvstate == VCHIQ_SRVSTATE_OPEN &&
&& (service->remoteport == port)) { service->remoteport == port) {
lock_service(service); lock_service(service);
return service; return 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