Re: [PATCH] Rename other copy of hash_string to hashlen_string
From: Geert Uytterhoeven
Date: Sun May 29 2016 - 06:48:19 EST
Hi Georges,
On Sun, May 29, 2016 at 7:26 AM, George Spelvin
<linux@xxxxxxxxxxxxxxxxxxx> wrote:
> The original name was simply hash_string(), but that conflicted with a
> function with that name in drivers/base/power/trace.c, and I decided that
> calling it "hashlen_" was better anyway.
>
> But you have to do it in two places.
>
> Signed-off-by: George Spelvin <linux@xxxxxxxxxxxxxxxxxxx>
> Fixes: fcfd2fbf22d2587196890103d41e3d554c47da0e
> ---
> fs/namei.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/namei.c b/fs/namei.c
> index 968dae02..aefba699 100644
> --- a/fs/namei.c
> +++ b/fs/namei.c
> @@ -1952,7 +1952,7 @@ unsigned int full_name_hash(const char *name, unsigned int len)
> EXPORT_SYMBOL(full_name_hash);
>
> /* Return the "hash_len" (hash and length) of a null-terminated string */
> -u64 hash_string(const char *name)
> +u64 hashlen_string(const char *name)
> {
> unsigned long hash = init_name_hash();
> unsigned long len = 0, c;
> @@ -1965,7 +1965,7 @@ u64 hash_string(const char *name)
> } while (c);
> return hashlen_create(end_name_hash(hash), len);
> }
> -EXPORT_SYMBOL(hash_string);
> +EXPORT_SYMBOL(hashlen_string);
That version fails the test. On m68k/ARAnyM:
test_hash: hashlen_string(256..256) returned length 1, expected 0
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds