Skip to content

Commit

Permalink
staging: vchiq_core: introduce defines for close_recvd
Browse files Browse the repository at this point in the history
Use descriptive defines instead of a number with a comment.

Signed-off-by: Stefan Wahren <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
lategoodbye authored and gregkh committed May 19, 2021
1 parent 4c51210 commit 5c56a44
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
#define SRVTRACE_ENABLED(srv, lev) \
(((srv) && (srv)->trace) || (vchiq_core_msg_log_level >= (lev)))

#define NO_CLOSE_RECVD 0
#define CLOSE_RECVD 1

struct vchiq_open_payload {
int fourcc;
int client_id;
Expand Down Expand Up @@ -1348,7 +1351,7 @@ poll_services_of_group(struct vchiq_state *state, int group)
*/
service->public_fourcc = VCHIQ_FOURCC_INVALID;

if (vchiq_close_service_internal(service, 0/*!close_recvd*/) !=
if (vchiq_close_service_internal(service, NO_CLOSE_RECVD) !=
VCHIQ_SUCCESS) {
request_poll(state, service, VCHIQ_POLL_REMOVE);
} else if (service_flags & BIT(VCHIQ_POLL_TERMINATE)) {
Expand All @@ -1357,7 +1360,7 @@ poll_services_of_group(struct vchiq_state *state, int group)
state->id, service->localport,
service->remoteport);
if (vchiq_close_service_internal(
service, 0/*!close_recvd*/) !=
service, NO_CLOSE_RECVD) !=
VCHIQ_SUCCESS)
request_poll(state, service,
VCHIQ_POLL_TERMINATE);
Expand Down Expand Up @@ -1683,7 +1686,7 @@ parse_message(struct vchiq_state *state, struct vchiq_header *header)
mark_service_closing_internal(service, 1);

if (vchiq_close_service_internal(service,
1/*close_recvd*/) == VCHIQ_RETRY)
CLOSE_RECVD) == VCHIQ_RETRY)
goto bail_not_ready;

vchiq_log_info(vchiq_core_log_level,
Expand Down Expand Up @@ -2976,8 +2979,7 @@ vchiq_close_service(unsigned int handle)
mark_service_closing(service);

if (current == service->state->slot_handler_thread) {
status = vchiq_close_service_internal(service,
0/*!close_recvd*/);
status = vchiq_close_service_internal(service, NO_CLOSE_RECVD);
WARN_ON(status == VCHIQ_RETRY);
} else {
/* Mark the service for termination by the slot handler */
Expand Down Expand Up @@ -3041,8 +3043,7 @@ vchiq_remove_service(unsigned int handle)
*/
service->public_fourcc = VCHIQ_FOURCC_INVALID;

status = vchiq_close_service_internal(service,
0/*!close_recvd*/);
status = vchiq_close_service_internal(service, NO_CLOSE_RECVD);
WARN_ON(status == VCHIQ_RETRY);
} else {
/* Mark the service for removal by the slot handler */
Expand Down

0 comments on commit 5c56a44

Please sign in to comment.