From b5043671896b5637c0c33be1efb2a614e69686d1 Mon Sep 17 00:00:00 2001 From: Mohana Datta Yelugoti Date: Tue, 9 Jun 2020 09:55:51 +0000 Subject: [PATCH] ipc: use macro instead of a magic number for timeout period Currently, in the ipc_schedule_process function, when we call schedule_task to schedule an ipc task, we use magic number to indicate the time kernel waits before calling timeout on an IPC. This makes it difficult to search for the timeout period using grep and other utilities. Replacing it with a macro makes it easier to search and change only at one place. Signed-off-by: Mohana Datta Yelugoti --- src/include/sof/drivers/ipc.h | 3 +++ src/ipc/handler.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/include/sof/drivers/ipc.h b/src/include/sof/drivers/ipc.h index 9cd9912ce..b0c180058 100644 --- a/src/include/sof/drivers/ipc.h +++ b/src/include/sof/drivers/ipc.h @@ -47,6 +47,9 @@ struct ipc_msg; #define COMP_TYPE_BUFFER 2 #define COMP_TYPE_PIPELINE 3 +/** \brief Scheduling period for IPC task in microseconds. */ +#define IPC_PERIOD_USEC 100 + /* validates internal non tail structures within IPC command structure */ #define IPC_IS_SIZE_INVALID(object) \ (object).hdr.size == sizeof(object) ? 0 : 1 diff --git a/src/ipc/handler.c b/src/ipc/handler.c index 7c1667544..969828093 100644 --- a/src/ipc/handler.c +++ b/src/ipc/handler.c @@ -1385,7 +1385,7 @@ out: void ipc_schedule_process(struct ipc *ipc) { - schedule_task(&ipc->ipc_task, 0, 100); + schedule_task(&ipc->ipc_task, 0, IPC_PERIOD_USEC); platform_shared_commit(ipc, sizeof(*ipc)); }