mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Julian Braha <julianbraha@gmail.com>
To: nathan@kernel.org, nsc@kernel.org
Cc: samitolvanen@google.com, torvalds@linux-foundation.org,
	ljs@kernel.org, david.laight.linux@gmail.com, sashal@kernel.org,
	lzsx618@gmail.com, zuoan.penguin@gmail.com, petr.pavlu@suse.com,
	jani.nikula@intel.com, xur@google.com, sidnayyar@google.com,
	robertusdchris@gmail.com, acourbot@nvidia.com,
	linux-modules@vger.kernel.org, linux-kbuild@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Julian Braha <julianbraha@gmail.com>
Subject: [PATCH 3/5] scripts: restore host hash table macro names
Date: Fri, 27 Nov 2026 00:00:13 +0000	[thread overview]
Message-ID: <20261127000015.3662267-4-julianbraha@gmail.com> (raw)
In-Reply-To: <20261127000015.3662267-1-julianbraha@gmail.com>

This partially reverts commit 0a3128e75108 ("kconfig: add macros useful
for hashtable").

Rename HASHTABLE_DECLARE() to DECLARE_HASHTABLE() and HASHTABLE_DEFINE()
to DEFINE_HASHTABLE() in the host scripts/include/hashtable.h, bringing
the signatures closer to the original in-kernel implementation, and update
the callers, accordingly.

Signed-off-by: Julian Braha <julianbraha@gmail.com>
---
This patch isn't really necessary to fix the issue, but it does make
maintenance a tad easier when you're looking at the two implementations
side-by-side.
---
 scripts/gendwarfksyms/die.c           | 2 +-
 scripts/gendwarfksyms/gendwarfksyms.h | 2 +-
 scripts/gendwarfksyms/kabi.c          | 2 +-
 scripts/gendwarfksyms/symbols.c       | 4 ++--
 scripts/gendwarfksyms/types.c         | 2 +-
 scripts/genksyms/genksyms.c           | 2 +-
 scripts/include/hashtable.h           | 6 +++---
 scripts/kconfig/expr.c                | 2 +-
 scripts/kconfig/internal.h            | 4 ++--
 scripts/kconfig/symbol.c              | 2 +-
 scripts/kconfig/util.c                | 2 +-
 scripts/mod/modpost.c                 | 2 +-
 12 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/scripts/gendwarfksyms/die.c b/scripts/gendwarfksyms/die.c
index 4e390a6295a3..79d738e69ce5 100644
--- a/scripts/gendwarfksyms/die.c
+++ b/scripts/gendwarfksyms/die.c
@@ -9,7 +9,7 @@
 #define DIE_HASH_BITS 16
 
 /* {die->addr, state} -> struct die * */
-static HASHTABLE_DEFINE(die_map, 1 << DIE_HASH_BITS);
+static DEFINE_HASHTABLE(die_map, 1 << DIE_HASH_BITS);
 
 static unsigned int map_hits;
 static unsigned int map_misses;
diff --git a/scripts/gendwarfksyms/gendwarfksyms.h b/scripts/gendwarfksyms/gendwarfksyms.h
index f4f21d6090e7..c987acbbf1ef 100644
--- a/scripts/gendwarfksyms/gendwarfksyms.h
+++ b/scripts/gendwarfksyms/gendwarfksyms.h
@@ -208,7 +208,7 @@ void die_map_free(void);
 
 /* A cache for addresses we've already seen. */
 struct cache {
-	HASHTABLE_DECLARE(cache, 1 << CACHE_HASH_BITS);
+	DECLARE_HASHTABLE(cache, 1 << CACHE_HASH_BITS);
 };
 
 void cache_set(struct cache *cache, unsigned long key, int value);
diff --git a/scripts/gendwarfksyms/kabi.c b/scripts/gendwarfksyms/kabi.c
index 2d941ee13c9b..35c70a6230d9 100644
--- a/scripts/gendwarfksyms/kabi.c
+++ b/scripts/gendwarfksyms/kabi.c
@@ -87,7 +87,7 @@ struct rule {
 };
 
 /* { type, target } -> struct rule */
-static HASHTABLE_DEFINE(rules, 1 << RULE_HASH_BITS);
+static DEFINE_HASHTABLE(rules, 1 << RULE_HASH_BITS);
 
 static inline unsigned int rule_values_hash(enum kabi_rule_type type,
 					    const char *target)
diff --git a/scripts/gendwarfksyms/symbols.c b/scripts/gendwarfksyms/symbols.c
index b4110b0e12ce..a87444611bbd 100644
--- a/scripts/gendwarfksyms/symbols.c
+++ b/scripts/gendwarfksyms/symbols.c
@@ -9,9 +9,9 @@
 #define SYMBOL_HASH_BITS 12
 
 /* struct symbol_addr -> struct symbol */
-static HASHTABLE_DEFINE(symbol_addrs, 1 << SYMBOL_HASH_BITS);
+static DEFINE_HASHTABLE(symbol_addrs, 1 << SYMBOL_HASH_BITS);
 /* name -> struct symbol */
-static HASHTABLE_DEFINE(symbol_names, 1 << SYMBOL_HASH_BITS);
+static DEFINE_HASHTABLE(symbol_names, 1 << SYMBOL_HASH_BITS);
 
 static inline unsigned int symbol_addr_hash(const struct symbol_addr *addr)
 {
diff --git a/scripts/gendwarfksyms/types.c b/scripts/gendwarfksyms/types.c
index 9c3b053bf061..db55c8ae57f8 100644
--- a/scripts/gendwarfksyms/types.c
+++ b/scripts/gendwarfksyms/types.c
@@ -100,7 +100,7 @@ static void type_expansion_append(struct type_expansion *type, const char *s,
  * const char *name -> struct type_expansion *
  */
 #define TYPE_HASH_BITS 12
-static HASHTABLE_DEFINE(type_map, 1 << TYPE_HASH_BITS);
+static DEFINE_HASHTABLE(type_map, 1 << TYPE_HASH_BITS);
 
 static int __type_map_get(const char *name, struct type_expansion **res)
 {
diff --git a/scripts/genksyms/genksyms.c b/scripts/genksyms/genksyms.c
index 83e48670c2fc..01bea2d91d7a 100644
--- a/scripts/genksyms/genksyms.c
+++ b/scripts/genksyms/genksyms.c
@@ -24,7 +24,7 @@
 #include "genksyms.h"
 /*----------------------------------------------------------------------*/
 
-static HASHTABLE_DEFINE(symbol_hashtable, 1U << 12);
+static DEFINE_HASHTABLE(symbol_hashtable, 1U << 12);
 static FILE *debugfile;
 
 int cur_line = 1;
diff --git a/scripts/include/hashtable.h b/scripts/include/hashtable.h
index 45abcb12bfce..fa60976eae37 100644
--- a/scripts/include/hashtable.h
+++ b/scripts/include/hashtable.h
@@ -7,10 +7,10 @@
 
 #define HASH_SIZE(name) (ARRAY_SIZE(name))
 
-#define HASHTABLE_DECLARE(name, size)		struct hlist_head name[size]
+#define DECLARE_HASHTABLE(name, size)		struct hlist_head name[size]
 
-#define HASHTABLE_DEFINE(name, size)						\
-	HASHTABLE_DECLARE(name, size) =						\
+#define DEFINE_HASHTABLE(name, size)						\
+	DECLARE_HASHTABLE(name, size) =						\
 			{ [0 ... ((size) - 1)] = HLIST_HEAD_INIT }
 
 #define hash_head(table, key)		(&(table)[(key) % HASH_SIZE(table)])
diff --git a/scripts/kconfig/expr.c b/scripts/kconfig/expr.c
index ea93016b68d4..5938b775a3fc 100644
--- a/scripts/kconfig/expr.c
+++ b/scripts/kconfig/expr.c
@@ -16,7 +16,7 @@
 
 #define DEBUG_EXPR	0
 
-HASHTABLE_DEFINE(expr_hashtable, EXPR_HASHSIZE);
+DEFINE_HASHTABLE(expr_hashtable, EXPR_HASHSIZE);
 
 static struct expr *expr_eliminate_yn(struct expr *e);
 
diff --git a/scripts/kconfig/internal.h b/scripts/kconfig/internal.h
index d0ffce2dfbba..f7e660dbd299 100644
--- a/scripts/kconfig/internal.h
+++ b/scripts/kconfig/internal.h
@@ -6,14 +6,14 @@
 
 #define SYMBOL_HASHSIZE		(1U << 14)
 
-extern HASHTABLE_DECLARE(sym_hashtable, SYMBOL_HASHSIZE);
+extern DECLARE_HASHTABLE(sym_hashtable, SYMBOL_HASHSIZE);
 
 #define for_all_symbols(sym) \
 	hash_for_each(sym_hashtable, sym, node)
 
 #define EXPR_HASHSIZE		(1U << 14)
 
-extern HASHTABLE_DECLARE(expr_hashtable, EXPR_HASHSIZE);
+extern DECLARE_HASHTABLE(expr_hashtable, EXPR_HASHSIZE);
 
 void expr_invalidate_all(void);
 
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
index 27138252c667..e46228d6348e 100644
--- a/scripts/kconfig/symbol.c
+++ b/scripts/kconfig/symbol.c
@@ -971,7 +971,7 @@ bool sym_is_choice_value(const struct symbol *sym)
 	return !list_empty(&sym->choice_link);
 }
 
-HASHTABLE_DEFINE(sym_hashtable, SYMBOL_HASHSIZE);
+DEFINE_HASHTABLE(sym_hashtable, SYMBOL_HASHSIZE);
 
 struct symbol *sym_lookup(const char *name, int flags)
 {
diff --git a/scripts/kconfig/util.c b/scripts/kconfig/util.c
index 0809aa061b6a..d2d17d9d37b9 100644
--- a/scripts/kconfig/util.c
+++ b/scripts/kconfig/util.c
@@ -14,7 +14,7 @@
 #include "lkc.h"
 
 /* hash table of all parsed Kconfig files */
-static HASHTABLE_DEFINE(file_hashtable, 1U << 11);
+static DEFINE_HASHTABLE(file_hashtable, 1U << 11);
 
 struct file {
 	struct hlist_node node;
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 75374c64b8cc..92bcd2b3a08e 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -234,7 +234,7 @@ struct symbol {
 	char name[];
 };
 
-static HASHTABLE_DEFINE(symbol_hashtable, 1U << 10);
+static DEFINE_HASHTABLE(symbol_hashtable, 1U << 10);
 
 /**
  * Allocate a new symbols for use in the hash of exported symbols or
-- 
2.56.0


  parent reply	other threads:[~2026-11-27  0:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-27  0:00 [PATCH 0/5] kconfig: fix slow 'make oldconfig' by reverting host header simplifications Julian Braha
2026-11-27  0:00 ` [PATCH 1/5] scripts: add bit count parameter back to host hash functions Julian Braha
2026-11-27  1:16   ` Linus Torvalds
2026-11-27  1:34     ` Linus Torvalds
2026-11-27  0:00 ` [PATCH 2/5] scripts: restore support for 64-bit pointers in " Julian Braha
2026-11-27  0:00 ` Julian Braha [this message]
2026-11-27  0:00 ` [PATCH 4/5] scripts: add bit count parameter back to the host hash table functions Julian Braha
2026-11-27  0:00 ` [PATCH 5/5] kconfig: replace XOR with addition for expr_lookup() key generation Julian Braha

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261127000015.3662267-4-julianbraha@gmail.com \
    --to=julianbraha@gmail.com \
    --cc=acourbot@nvidia.com \
    --cc=david.laight.linux@gmail.com \
    --cc=jani.nikula@intel.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-modules@vger.kernel.org \
    --cc=ljs@kernel.org \
    --cc=lzsx618@gmail.com \
    --cc=nathan@kernel.org \
    --cc=nsc@kernel.org \
    --cc=petr.pavlu@suse.com \
    --cc=robertusdchris@gmail.com \
    --cc=samitolvanen@google.com \
    --cc=sashal@kernel.org \
    --cc=sidnayyar@google.com \
    --cc=torvalds@linux-foundation.org \
    --cc=xur@google.com \
    --cc=zuoan.penguin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®