All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kconfig/menuconfig: use TAILQ instead of CIRCLEQ
@ 2012-10-18 17:33 Yann E. MORIN
  2012-10-18 17:55 ` Yaakov (Cygwin/X)
                   ` (3 more replies)
  0 siblings, 4 replies; 16+ messages in thread
From: Yann E. MORIN @ 2012-10-18 17:33 UTC (permalink / raw)
  To: linux-kbuild, linux-kernel
  Cc: Michal Marek, Tetsuo Handa, Benjamin Poirier, Yann E. MORIN,
	Yaakov Selkowitz

Some systems (eg. Cygwin, FreeBSD) are missing the CIRCLEQ macros.
They were removed in Y2000 from FreeBSD:
    http://svnweb.freebsd.org/base?view=revision&revision=70469

The reason was that TAILQ are perfectly capable of doing the exact
same things:
    http://www.mavetju.org/mail/view_thread.php?list=freebsd-arch&id=915145&thread=yes

(Thank Yaakov for the pointers!)

So, switch to using TAILQ instead, which are more portable.

Reported-by: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Reported-by: Benjamin Poirier <bpoirier@suse.de>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Yaakov Selkowitz <yselkowitz@gmail.com>
---
 scripts/kconfig/expr.h  |    4 ++--
 scripts/kconfig/mconf.c |    4 ++--
 scripts/kconfig/menu.c  |    6 +++---
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/scripts/kconfig/expr.h b/scripts/kconfig/expr.h
index bd2e098..c6a8b99 100644
--- a/scripts/kconfig/expr.h
+++ b/scripts/kconfig/expr.h
@@ -175,12 +175,12 @@ struct menu {
 #define MENU_ROOT		0x0002
 
 struct jump_key {
-	CIRCLEQ_ENTRY(jump_key) entries;
+	TAILQ_ENTRY(jump_key) entries;
 	size_t offset;
 	struct menu *target;
 	int index;
 };
-CIRCLEQ_HEAD(jk_head, jump_key);
+TAILQ_HEAD(jk_head, jump_key);
 
 #define JUMP_NB			9
 
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c
index 48f6744..f1ee1c9 100644
--- a/scripts/kconfig/mconf.c
+++ b/scripts/kconfig/mconf.c
@@ -323,7 +323,7 @@ static void update_text(char *buf, size_t start, size_t end, void *_data)
 	struct jump_key *pos;
 	int k = 0;
 
-	CIRCLEQ_FOREACH(pos, data->head, entries) {
+	TAILQ_FOREACH(pos, data->head, entries) {
 		if (pos->offset >= start && pos->offset < end) {
 			char header[4];
 
@@ -375,7 +375,7 @@ again:
 
 	sym_arr = sym_re_search(dialog_input);
 	do {
-		struct jk_head head = CIRCLEQ_HEAD_INITIALIZER(head);
+		struct jk_head head = TAILQ_HEAD_INITIALIZER(head);
 		struct menu *targets[JUMP_NB];
 		int keys[JUMP_NB + 1], i;
 		struct search_data data = {
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
index a3cade6..9eff451 100644
--- a/scripts/kconfig/menu.c
+++ b/scripts/kconfig/menu.c
@@ -544,12 +544,12 @@ static void get_prompt_str(struct gstr *r, struct property *prop,
 		} else
 			jump->target = location;
 
-		if (CIRCLEQ_EMPTY(head))
+		if (TAILQ_EMPTY(head))
 			jump->index = 0;
 		else
-			jump->index = CIRCLEQ_LAST(head)->index + 1;
+			jump->index = TAILQ_LAST(head, jk_head)->index + 1;
 
-		CIRCLEQ_INSERT_TAIL(head, jump, entries);
+		TAILQ_INSERT_TAIL(head, jump, entries);
 	}
 
 	if (i > 0) {
-- 
1.7.2.5


^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2012-10-23 17:04 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-18 17:33 [PATCH] kconfig/menuconfig: use TAILQ instead of CIRCLEQ Yann E. MORIN
2012-10-18 17:55 ` Yaakov (Cygwin/X)
2012-10-18 18:59   ` Yann E. MORIN
2012-10-19  8:59     ` Yaakov (Cygwin/X)
2012-10-19 12:10 ` Tetsuo Handa
2012-10-19 14:54   ` Michal Marek
2012-10-20 14:43     ` Tetsuo Handa
2012-10-20 16:58       ` Yann E. MORIN
2012-10-19 22:52   ` Yann E. MORIN
2012-10-20 17:56 ` [PATCH] menuconfig: Replace CIRCLEQ by list_head-style lists Benjamin Poirier
2012-10-20 21:22   ` Yann E. MORIN
2012-10-21  1:21     ` Tetsuo Handa
2012-10-20 22:19   ` Yann E. MORIN
2012-10-21  1:54   ` Yaakov (Cygwin/X)
2012-10-23 13:12 ` [PATCH] kconfig/menuconfig: use TAILQ instead of CIRCLEQ Christoph Hellwig
2012-10-23 17:04   ` Yann E. MORIN

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.