linux-m68k.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] m68k: mac_via: use explicitly signed char
Date: Wed, 26 Oct 2022 14:59:40 +0200	[thread overview]
Message-ID: <CAHmME9oGomHncF1c=LDXow=JwRQwieP0ohA=s9Y0jnzVhjE8YQ@mail.gmail.com> (raw)
In-Reply-To: <CAMuHMdXdR34JX3+=m8vuw=k_kOxT1jq3sGsW6yh_h9aFH+BP4A@mail.gmail.com>

On Wed, Oct 26, 2022 at 2:57 PM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>
> Hi Jason,
>
> On Wed, Oct 26, 2022 at 2:48 PM Jason A. Donenfeld <Jason@zx2c4.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@linux-m68k.org>
> > Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.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.

Hah! Nice catch. Okay, will send you a removal patch (for you to take).

Jason

      reply	other threads:[~2022-10-26 13:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-26 12:48 [PATCH] m68k: mac_via: use explicitly signed char Jason A. Donenfeld
2022-10-26 12:57 ` Geert Uytterhoeven
2022-10-26 12:59   ` Jason A. Donenfeld [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHmME9oGomHncF1c=LDXow=JwRQwieP0ohA=s9Y0jnzVhjE8YQ@mail.gmail.com' \
    --to=jason@zx2c4.com \
    --cc=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).