summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2024-02-03 00:58:22 +0900
committerMasahiro Yamada <masahiroy@kernel.org>2024-02-20 20:36:15 +0900
commit7c4aa901bd9d7e95be95a5c888d026b3214bae05 (patch)
tree02e90872df39357eb2823521b90c3d965f82defe /scripts
parenta6dac4002b88f0ad242ac20d9de86d11321ecf84 (diff)
downloadlinux-stable-7c4aa901bd9d7e95be95a5c888d026b3214bae05.tar.gz
linux-stable-7c4aa901bd9d7e95be95a5c888d026b3214bae05.tar.bz2
linux-stable-7c4aa901bd9d7e95be95a5c888d026b3214bae05.zip
kconfig: move strhash() to util.c as a global function
Remove the 'static' qualifier from strhash() so that it can be accessed from other files. Move it to util.c, which is a more appropriate location. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/kconfig/lkc.h1
-rw-r--r--scripts/kconfig/symbol.c9
-rw-r--r--scripts/kconfig/util.c10
3 files changed, 11 insertions, 9 deletions
diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h
index 71afcbd56273..e69d7c59d930 100644
--- a/scripts/kconfig/lkc.h
+++ b/scripts/kconfig/lkc.h
@@ -52,6 +52,7 @@ static inline void xfwrite(const void *str, size_t len, size_t count, FILE *out)
}
/* util.c */
+unsigned int strhash(const char *s);
const char *file_lookup(const char *name);
void *xmalloc(size_t size);
void *xcalloc(size_t nmemb, size_t size);
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
index dae630a74e50..3dbe3a19622b 100644
--- a/scripts/kconfig/symbol.c
+++ b/scripts/kconfig/symbol.c
@@ -803,15 +803,6 @@ bool sym_is_changeable(struct symbol *sym)
return sym->visible > sym->rev_dep.tri;
}
-static unsigned strhash(const char *s)
-{
- /* fnv32 hash */
- unsigned hash = 2166136261U;
- for (; *s; s++)
- hash = (hash ^ *s) * 0x01000193;
- return hash;
-}
-
struct symbol *sym_lookup(const char *name, int flags)
{
struct symbol *symbol;
diff --git a/scripts/kconfig/util.c b/scripts/kconfig/util.c
index 610d64c01479..d6172f2f64c9 100644
--- a/scripts/kconfig/util.c
+++ b/scripts/kconfig/util.c
@@ -9,6 +9,16 @@
#include <string.h>
#include "lkc.h"
+unsigned int strhash(const char *s)
+{
+ /* fnv32 hash */
+ unsigned int hash = 2166136261U;
+
+ for (; *s; s++)
+ hash = (hash ^ *s) * 0x01000193;
+ return hash;
+}
+
struct file {
struct file *next;
char name[];