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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 26 Oct 2022 14:57:04 +0200
From:   Geert Uytterhoeven <geert@...ux-m68k.org>
To:     "Jason A. Donenfeld" <Jason@...c4.com>
Cc:     linux-m68k@...ts.linux-m68k.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] m68k: mac_via: use explicitly signed char

Hi Jason,

On Wed, Oct 26, 2022 at 2:48 PM Jason A. Donenfeld <Jason@...c4.com> wrote:
> The `val` variable is set to -1 and compared against < 0, which means
> it's assumed to be signed. However, soon char is to become unsigned
> tree-wide. So explicitly mark `val` as signed to that it keeps working
> the same way.
>
> Cc: Geert Uytterhoeven <geert@...ux-m68k.org>
> Signed-off-by: Jason A. Donenfeld <Jason@...c4.com>
> ---
> Geert - Linus asked me to consolidate all of the unsigned-char fixups in
> one tree. So, unless you plan on taking this for 6.1, I'll queue it up
> in that tree for 6.2, following your ack. -Jason

Thanks for your patch!

> --- a/arch/m68k/include/asm/mac_via.h
> +++ b/arch/m68k/include/asm/mac_via.h
> @@ -269,7 +269,7 @@ extern int via2_scsi_drq_pending(void);
>
>  static inline int rbv_set_video_bpp(int bpp)
>  {
> -       char val = (bpp==1)?0:(bpp==2)?1:(bpp==4)?2:(bpp==8)?3:-1;
> +       signed char val = (bpp==1)?0:(bpp==2)?1:(bpp==4)?2:(bpp==8)?3:-1;
>         if (!rbv_present || val<0) return -1;
>         via2[rMonP] = (via2[rMonP] & ~RBV_DEPTH) | val;
>         return 0;

LGTM, although this could just use "int" instead.

Upon closer look, this function is not used, and seems to have never
been used before.  Please just remove it instead.
Thanks!

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