Commit 7c4aa901 authored by Masahiro Yamada's avatar Masahiro Yamada

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: default avatarMasahiro Yamada <masahiroy@kernel.org>
parent a6dac400
...@@ -52,6 +52,7 @@ static inline void xfwrite(const void *str, size_t len, size_t count, FILE *out) ...@@ -52,6 +52,7 @@ static inline void xfwrite(const void *str, size_t len, size_t count, FILE *out)
} }
/* util.c */ /* util.c */
unsigned int strhash(const char *s);
const char *file_lookup(const char *name); const char *file_lookup(const char *name);
void *xmalloc(size_t size); void *xmalloc(size_t size);
void *xcalloc(size_t nmemb, size_t size); void *xcalloc(size_t nmemb, size_t size);
......
...@@ -803,15 +803,6 @@ bool sym_is_changeable(struct symbol *sym) ...@@ -803,15 +803,6 @@ bool sym_is_changeable(struct symbol *sym)
return sym->visible > sym->rev_dep.tri; 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 *sym_lookup(const char *name, int flags)
{ {
struct symbol *symbol; struct symbol *symbol;
......
...@@ -9,6 +9,16 @@ ...@@ -9,6 +9,16 @@
#include <string.h> #include <string.h>
#include "lkc.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 {
struct file *next; struct file *next;
char name[]; char name[];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment