Linux M68K Architecture development
 help / color / mirror / Atom feed
* [PATCH] m68k: mac_via: use explicitly signed char
@ 2022-10-26 12:48 Jason A. Donenfeld
  2022-10-26 12:57 ` Geert Uytterhoeven
  0 siblings, 1 reply; 3+ messages in thread
From: Jason A. Donenfeld @ 2022-10-26 12:48 UTC (permalink / raw)
  To: linux-m68k, linux-kernel; +Cc: Jason A. Donenfeld, Geert Uytterhoeven

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

 arch/m68k/include/asm/mac_via.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/m68k/include/asm/mac_via.h b/arch/m68k/include/asm/mac_via.h
index 1149251ea58d..e37fcbf47926 100644
--- 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;
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-10-26 13:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox