[API-NEXT,v1,1/13] linux-gen: hide get_qentry

Message ID 1501837208-7450-2-git-send-email-odpbot@yandex.ru
State New
Headers show
Series
  • [API-NEXT,v1,1/13] linux-gen: hide get_qentry
Related show

Commit Message

Github ODP bot Aug. 4, 2017, 8:59 a.m.
From: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>


Replace two last index->qentry lookups with pointers to quentry, thus
making it possible to make get_qentry static in odp_queue.c

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>

---
/** Email created from pull request 108 (lumag:symbols-cleanup)
 ** https://github.com/Linaro/odp/pull/108
 ** Patch: https://github.com/Linaro/odp/pull/108.patch
 ** Base sha: 8390f890d4bd2babb63a24f7b15d2f4763e44050
 ** Merge commit sha: 44fd671a0d2772a32395c7f0574aa545d2a9aa71
 **/
 platform/linux-generic/include/odp_queue_internal.h | 2 --
 platform/linux-generic/odp_queue.c                  | 4 ++++
 platform/linux-generic/odp_schedule.c               | 8 +++-----
 platform/linux-generic/odp_schedule_iquery.c        | 8 +++-----
 4 files changed, 10 insertions(+), 12 deletions(-)

Patch

diff --git a/platform/linux-generic/include/odp_queue_internal.h b/platform/linux-generic/include/odp_queue_internal.h
index 032dde88..c5ff1e7d 100644
--- a/platform/linux-generic/include/odp_queue_internal.h
+++ b/platform/linux-generic/include/odp_queue_internal.h
@@ -61,8 +61,6 @@  union queue_entry_u {
 	uint8_t pad[ROUNDUP_CACHE_LINE(sizeof(struct queue_entry_s))];
 };
 
-queue_entry_t *get_qentry(uint32_t queue_id);
-
 void queue_lock(queue_entry_t *queue);
 void queue_unlock(queue_entry_t *queue);
 
diff --git a/platform/linux-generic/odp_queue.c b/platform/linux-generic/odp_queue.c
index 904c9ef2..e2f8c067 100644
--- a/platform/linux-generic/odp_queue.c
+++ b/platform/linux-generic/odp_queue.c
@@ -43,6 +43,9 @@  typedef struct queue_table_t {
 
 static queue_table_t *queue_tbl;
 
+static
+queue_entry_t *get_qentry(uint32_t queue_id);
+
 static inline queue_entry_t *handle_to_qentry(odp_queue_t handle)
 {
 	uint32_t queue_id;
@@ -56,6 +59,7 @@  static inline odp_queue_t queue_from_id(uint32_t queue_id)
 	return _odp_cast_scalar(odp_queue_t, queue_id + 1);
 }
 
+static
 queue_entry_t *get_qentry(uint32_t queue_id)
 {
 	return &queue_tbl->queue[queue_id];
diff --git a/platform/linux-generic/odp_schedule.c b/platform/linux-generic/odp_schedule.c
index 8af27673..f52ef28c 100644
--- a/platform/linux-generic/odp_schedule.c
+++ b/platform/linux-generic/odp_schedule.c
@@ -130,7 +130,7 @@  ODP_STATIC_ASSERT((8 * sizeof(pri_mask_t)) >= QUEUES_PER_PRIO,
 /* Storage for stashed enqueue operation arguments */
 typedef struct {
 	odp_buffer_hdr_t *buf_hdr[QUEUE_MULTI_MAX];
-	uint32_t queue_index;
+	queue_entry_t *queue_entry;
 	int num;
 } ordered_stash_t;
 
@@ -682,12 +682,10 @@  static inline void ordered_stash_release(void)
 
 	for (i = 0; i < sched_local.ordered.stash_num; i++) {
 		queue_entry_t *queue_entry;
-		uint32_t queue_index;
 		odp_buffer_hdr_t **buf_hdr;
 		int num;
 
-		queue_index = sched_local.ordered.stash[i].queue_index;
-		queue_entry = get_qentry(queue_index);
+		queue_entry = sched_local.ordered.stash[i].queue_entry;
 		buf_hdr = sched_local.ordered.stash[i].buf_hdr;
 		num = sched_local.ordered.stash[i].num;
 
@@ -788,7 +786,7 @@  static int schedule_ord_enq_multi(queue_t q_int, void *buf_hdr[],
 		return 0;
 	}
 
-	sched_local.ordered.stash[stash_num].queue_index = dst_queue->s.index;
+	sched_local.ordered.stash[stash_num].queue_entry = dst_queue;
 	sched_local.ordered.stash[stash_num].num = num;
 	for (i = 0; i < num; i++)
 		sched_local.ordered.stash[stash_num].buf_hdr[i] = buf_hdr[i];
diff --git a/platform/linux-generic/odp_schedule_iquery.c b/platform/linux-generic/odp_schedule_iquery.c
index 44a725ab..23e36c9a 100644
--- a/platform/linux-generic/odp_schedule_iquery.c
+++ b/platform/linux-generic/odp_schedule_iquery.c
@@ -174,7 +174,7 @@  typedef struct {
 /* Storage for stashed enqueue operation arguments */
 typedef struct {
 	odp_buffer_hdr_t *buf_hdr[QUEUE_MULTI_MAX];
-	uint32_t queue_index;
+	queue_entry_t *queue_entry;
 	int num;
 } ordered_stash_t;
 
@@ -1133,12 +1133,10 @@  static inline void ordered_stash_release(void)
 
 	for (i = 0; i < thread_local.ordered.stash_num; i++) {
 		queue_entry_t *queue_entry;
-		uint32_t queue_index;
 		odp_buffer_hdr_t **buf_hdr;
 		int num;
 
-		queue_index = thread_local.ordered.stash[i].queue_index;
-		queue_entry = get_qentry(queue_index);
+		queue_entry = thread_local.ordered.stash[i].queue_entry;
 		buf_hdr = thread_local.ordered.stash[i].buf_hdr;
 		num = thread_local.ordered.stash[i].num;
 
@@ -1225,7 +1223,7 @@  static int schedule_ord_enq_multi(queue_t q_int, void *buf_hdr[],
 		return 0;
 	}
 
-	thread_local.ordered.stash[stash_num].queue_index = dst_queue->s.index;
+	thread_local.ordered.stash[stash_num].queue_entry = dst_queue;
 	thread_local.ordered.stash[stash_num].num = num;
 	for (i = 0; i < num; i++)
 		thread_local.ordered.stash[stash_num].buf_hdr[i] = buf_hdr[i];