lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMuHMdURebgBTuaPxLZSfnVvMkOeX0vE8LXXj02AQjJQkfy8mw@mail.gmail.com>
Date:   Fri, 15 Nov 2019 11:51:09 +0100
From:   Geert Uytterhoeven <geert@...ux-m68k.org>
To:     "Ben Dooks (Codethink)" <ben.dooks@...ethink.co.uk>
Cc:     linux-kernel@...ts.codethink.co.uk,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Arnd Bergmann <arnd@...db.de>
Subject: Re: [PATCH] byteorder: fix warning due to type mismatch in be32 array code

Hi Ben,

CC Arnd.

On Mon, Nov 4, 2019 at 7:25 PM Ben Dooks (Codethink)
<ben.dooks@...ethink.co.uk> wrote:
> The loop should use a "size_t" as the len parameter is a size_t which
> should silence the following warning:
>
> ./include/linux/byteorder/generic.h:195:16: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘unsigned int’} [-Wsign-compare]
> ./include/linux/byteorder/generic.h:203:16: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘unsigned int’} [-Wsign-compare]
>
> Signed-off-by: Ben Dooks (Codethink) <ben.dooks@...ethink.co.uk>

Thanks for your patch!

> --- a/include/linux/byteorder/generic.h
> +++ b/include/linux/byteorder/generic.h
> @@ -190,7 +190,7 @@ static inline void be64_add_cpu(__be64 *var, u64 val)
>
>  static inline void cpu_to_be32_array(__be32 *dst, const u32 *src, size_t len)
>  {
> -       int i;
> +       size_t i;
>
>         for (i = 0; i < len; i++)
>                 dst[i] = cpu_to_be32(src[i]);

Alternatively, you can follow the approach a few lines above:

        while (len--)
                *dst++ = cpu_to_be32(*src++);

Regardless:
Reviewed-by: Geert Uytterhoeven <geert+renesas@...der.be>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ