Skip to contentSkip to conversation

video: fbdev: sis: use explicitly signed char

PATCH Applied Jason A. Donenfeld 3 participants 5 messages Oct 24, 2022 – Oct 25, 2022

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 video: fbdev: sis: use explicitly signed char

With char becoming unsigned by default, and with char alone being ambiguous and based on architecture, signed chars need to be marked explicitly as such. This fixes warnings like:

drivers/video/fbdev/sis/init301.c:3549 SiS_GetCRT2Data301() warn: 'SiS_Pr->SiS_EModeIDTable[ModeIdIndex]->ROMMODEIDX661' is unsigned

---
 drivers/usb/misc/sisusbvga/sisusb_struct.h | 2 +-
 drivers/video/fbdev/sis/vstruct.h          | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/usb/misc/sisusbvga/sisusb_struct.h +1 -1
index 3df64d2a9d43..a86032a26d36 100644
@@ -91,7 +91,7 @@ struct SiS_Ext {
 	unsigned char VB_ExtTVYFilterIndex;
 	unsigned char VB_ExtTVYFilterIndexROM661;
 	unsigned char REFindex;
-	char ROMMODEIDX661;
+	signed char ROMMODEIDX661;
 };
 
 struct SiS_Ext2 {
drivers/video/fbdev/sis/vstruct.h +1 -1
index ea94d214dcff..d7a14e63ba5a 100644
@@ -148,7 +148,7 @@ struct SiS_Ext {
 	unsigned char  VB_ExtTVYFilterIndex;
 	unsigned char  VB_ExtTVYFilterIndexROM661;
 	unsigned char  REFindex;
-	char           ROMMODEIDX661;
+	signed char    ROMMODEIDX661;
 };
 
 struct SiS_Ext2 {
Signature · 1 line
2.38.1
maintainer Applied
#1 lore raw
Quoted 6 lines · Jason A. Donenfeld

With char becoming unsigned by default, and with char alone being ambiguous and based on architecture, signed chars need to be marked explicitly as such. This fixes warnings like:

drivers/video/fbdev/sis/init301.c:3549 SiS_GetCRT2Data301() warn: 'SiS_Pr->SiS_EModeIDTable[ModeIdIndex]->ROMMODEIDX661' is unsigned

Quoted 7 lines

Applied to linux-fbdev git tree.

Thanks,
Helge

Quoted 31 lines
---
  drivers/usb/misc/sisusbvga/sisusb_struct.h | 2 +-
  drivers/video/fbdev/sis/vstruct.h          | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)
drivers/usb/misc/sisusbvga/sisusb_struct.h +1 -1
index 3df64d2a9d43..a86032a26d36 100644
@@ -91,7 +91,7 @@ struct SiS_Ext {
  	unsigned char VB_ExtTVYFilterIndex;
  	unsigned char VB_ExtTVYFilterIndexROM661;
  	unsigned char REFindex;
-	char ROMMODEIDX661;
+	signed char ROMMODEIDX661;
  };
 
  struct SiS_Ext2 {
drivers/video/fbdev/sis/vstruct.h +1 -1
index ea94d214dcff..d7a14e63ba5a 100644
@@ -148,7 +148,7 @@ struct SiS_Ext {
  	unsigned char  VB_ExtTVYFilterIndex;
  	unsigned char  VB_ExtTVYFilterIndexROM661;
  	unsigned char  REFindex;
-	char           ROMMODEIDX661;
+	signed char    ROMMODEIDX661;
  };
 
  struct SiS_Ext2 {
#2 lore raw
Quoted 16 lines · Helge Deller
Quoted 6 lines · Jason A. Donenfeld

With char becoming unsigned by default, and with char alone being ambiguous and based on architecture, signed chars need to be marked explicitly as such. This fixes warnings like:

drivers/video/fbdev/sis/init301.c:3549 SiS_GetCRT2Data301() warn: 'SiS_Pr->SiS_EModeIDTable[ModeIdIndex]->ROMMODEIDX661' is unsigned

Quoted 7 lines
Quoted 1 line

Applied to linux-fbdev git tree.

For 6.1 as a fix, right? Since this is already broken on, e.g., ARM.

Jason

maintainer
#3 lore raw
Quoted 17 lines · Jason A. Donenfeld
Quoted 16 lines · Helge Deller
Quoted 13 lines · Jason A. Donenfeld

With char becoming unsigned by default, and with char alone being ambiguous and based on architecture, signed chars need to be marked explicitly as such. This fixes warnings like:

drivers/video/fbdev/sis/init301.c:3549 SiS_GetCRT2Data301() warn: 'SiS_Pr->SiS_EModeIDTable[ModeIdIndex]->ROMMODEIDX661' is unsigned

Quoted 3 lines
Quoted 1 line

Applied to linux-fbdev git tree.

For 6.1 as a fix, right? Since this is already broken on, e.g., ARM.

Yes.

Helge

#4 lore raw
In reply to Jason A. Donenfeld

From: Jason A. Donenfeld

Quoted 7 lines

Sent: 24 October 2022 17:29
To: [email protected]

With char becoming unsigned by default, and with char alone being ambiguous and based on architecture, signed chars need to be marked explicitly as such. This fixes warnings like:

...

Quoted 10 lines
---
 drivers/usb/misc/sisusbvga/sisusb_struct.h | 2 +-
 drivers/video/fbdev/sis/vstruct.h          | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/usb/misc/sisusbvga/sisusb_struct.h +0 -0
index 3df64d2a9d43..a86032a26d36 100644

drivers/usb/misc/sisusbvga/sisusb_struct.h struct SiS_Ext { · line 94

Quoted 5 lines
drivers/usb/misc/sisusbvga/sisusb_struct.h +1 -1
@@ -91,7 +91,7 @@ struct SiS_Ext {
 	unsigned char VB_ExtTVYFilterIndex;
 	unsigned char VB_ExtTVYFilterIndexROM661;
 	unsigned char REFindex;
-	char ROMMODEIDX661;
+	signed char ROMMODEIDX661;

Isn't the correct fix to use u8 and s8 ?

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)