From 9644491dde64d2d0701e0c09f710f8450fd53a78 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 23 Jun 2022 20:21:17 +0800 Subject: [PATCH] thread: let spdk_thread_create() accept const spdk_cpuset* the underlying spdk_cpuset_copy() takes `const spdk_cpuset*` as the `src` parameter. there is no need to take non-const spdk_cpuset*. hence, in this change, let's relax the requirement of the pointer type. Signed-off-by: Kefu Chai Change-Id: I1f626c7fea45cf7250bf56b891bcba4a0f2a8917 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13443 Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Shuhei Matsumoto Reviewed-by: Konrad Sztyber --- include/spdk/thread.h | 2 +- lib/thread/thread.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/spdk/thread.h b/include/spdk/thread.h index 0158a35d3..eb54db7bb 100644 --- a/include/spdk/thread.h +++ b/include/spdk/thread.h @@ -236,7 +236,7 @@ void spdk_thread_lib_fini(void); * * \return a pointer to the allocated thread on success or NULL on failure.. */ -struct spdk_thread *spdk_thread_create(const char *name, struct spdk_cpuset *cpumask); +struct spdk_thread *spdk_thread_create(const char *name, const struct spdk_cpuset *cpumask); /** * Force the current system thread to act as if executing the given SPDK thread. diff --git a/lib/thread/thread.c b/lib/thread/thread.c index 5d26a3ab0..9e4897763 100644 --- a/lib/thread/thread.c +++ b/lib/thread/thread.c @@ -388,7 +388,7 @@ _free_thread(struct spdk_thread *thread) } struct spdk_thread * -spdk_thread_create(const char *name, struct spdk_cpuset *cpumask) +spdk_thread_create(const char *name, const struct spdk_cpuset *cpumask) { struct spdk_thread *thread; struct spdk_msg *msgs[SPDK_MSG_MEMPOOL_CACHE_SIZE];