Hi,

Here a little proposal to fix a compilation warning.

Hope it s useful.

Kind regards.
From 2c1919351bbf5e1e03302b455a81315859bd3c41 Mon Sep 17 00:00:00 2001
From: David Carlier <devne...@gmail.com>
Date: Fri, 1 Jun 2018 12:22:33 +0000
Subject: [PATCH] CLEANUP: task_insert_into_tasklet_list explicit cast

We explicity cast to a void pointer what is considered
as an integral otherwise but emitting the value one time.
---
 include/proto/task.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/proto/task.h b/include/proto/task.h
index 760b368b..43202ae5 100644
--- a/include/proto/task.h
+++ b/include/proto/task.h
@@ -213,12 +213,13 @@ static inline void task_insert_into_tasklet_list(struct task *t)
 {
 	struct tasklet *tl;
 	void *expected = NULL;
+ static void *leaf = (void *)0x1;
 
 	/* Protect ourself against anybody trying to insert the task into
 	 * another runqueue. We set leaf_p to 0x1 to indicate that the node is
 	 * not in a tree but that it's in the tasklet list. See task_in_rq().
 	 */
-	if (unlikely(!HA_ATOMIC_CAS(&t->rq.node.leaf_p, &expected, 0x1)))
+	if (unlikely(!HA_ATOMIC_CAS(&t->rq.node.leaf_p, &expected, leaf)))
 		return;
 	HA_ATOMIC_ADD(&tasks_run_queue, 1);
 	task_list_size[tid]++;
-- 
2.17.0

Reply via email to