diff mbox series

video: fbdev: sis: use explicitly signed char

Message ID 20221024162901.535972-1-Jason@zx2c4.com (mailing list archive)
State Accepted, archived
Headers show
Series video: fbdev: sis: use explicitly signed char | expand

Commit Message

Jason A. Donenfeld Oct. 24, 2022, 4:29 p.m. UTC
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

Cc: Thomas Winischhofer <thomas@winischhofer.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Helge Deller <deller@gmx.de>
Cc: linux-usb@vger.kernel.org
Cc: linux-fbdev@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
---
 drivers/usb/misc/sisusbvga/sisusb_struct.h | 2 +-
 drivers/video/fbdev/sis/vstruct.h          | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Helge Deller Oct. 24, 2022, 6:29 p.m. UTC | #1
On 10/24/22 18:29, Jason A. Donenfeld wrote:
> 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
>
> Cc: Thomas Winischhofer <thomas@winischhofer.net>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Helge Deller <deller@gmx.de>
> Cc: linux-usb@vger.kernel.org
> Cc: linux-fbdev@vger.kernel.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>

Applied to linux-fbdev git tree.

Thanks,
Helge


> ---
>   drivers/usb/misc/sisusbvga/sisusb_struct.h | 2 +-
>   drivers/video/fbdev/sis/vstruct.h          | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/misc/sisusbvga/sisusb_struct.h b/drivers/usb/misc/sisusbvga/sisusb_struct.h
> index 3df64d2a9d43..a86032a26d36 100644
> --- a/drivers/usb/misc/sisusbvga/sisusb_struct.h
> +++ b/drivers/usb/misc/sisusbvga/sisusb_struct.h
> @@ -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 {
> diff --git a/drivers/video/fbdev/sis/vstruct.h b/drivers/video/fbdev/sis/vstruct.h
> index ea94d214dcff..d7a14e63ba5a 100644
> --- a/drivers/video/fbdev/sis/vstruct.h
> +++ b/drivers/video/fbdev/sis/vstruct.h
> @@ -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 {
David Laight Oct. 25, 2022, 9:59 a.m. UTC | #2
From: Jason A. Donenfeld
> Sent: 24 October 2022 17:29
> To: linux-kernel@vger.kernel.org
> 
> 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/usb/misc/sisusbvga/sisusb_struct.h | 2 +-
>  drivers/video/fbdev/sis/vstruct.h          | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/misc/sisusbvga/sisusb_struct.h b/drivers/usb/misc/sisusbvga/sisusb_struct.h
> index 3df64d2a9d43..a86032a26d36 100644
> --- a/drivers/usb/misc/sisusbvga/sisusb_struct.h
> +++ b/drivers/usb/misc/sisusbvga/sisusb_struct.h
> @@ -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)
Jason A. Donenfeld Oct. 25, 2022, 12:55 p.m. UTC | #3
On Mon, Oct 24, 2022 at 8:29 PM Helge Deller <deller@gmx.de> wrote:
>
> On 10/24/22 18:29, Jason A. Donenfeld wrote:
> > 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
> >
> > Cc: Thomas Winischhofer <thomas@winischhofer.net>
> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > Cc: Helge Deller <deller@gmx.de>
> > Cc: linux-usb@vger.kernel.org
> > Cc: linux-fbdev@vger.kernel.org
> > Cc: dri-devel@lists.freedesktop.org
> > Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
>
> Applied to linux-fbdev git tree.

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

Jason
Helge Deller Oct. 25, 2022, 1 p.m. UTC | #4
On 10/25/22 14:55, Jason A. Donenfeld wrote:
> On Mon, Oct 24, 2022 at 8:29 PM Helge Deller <deller@gmx.de> wrote:
>>
>> On 10/24/22 18:29, Jason A. Donenfeld wrote:
>>> 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
>>>
>>> Cc: Thomas Winischhofer <thomas@winischhofer.net>
>>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>>> Cc: Helge Deller <deller@gmx.de>
>>> Cc: linux-usb@vger.kernel.org
>>> Cc: linux-fbdev@vger.kernel.org
>>> Cc: dri-devel@lists.freedesktop.org
>>> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
>>
>> Applied to linux-fbdev git tree.
>
> For 6.1 as a fix, right? Since this is already broken on, e.g., ARM.

Yes.

Helge
diff mbox series

Patch

diff --git a/drivers/usb/misc/sisusbvga/sisusb_struct.h b/drivers/usb/misc/sisusbvga/sisusb_struct.h
index 3df64d2a9d43..a86032a26d36 100644
--- a/drivers/usb/misc/sisusbvga/sisusb_struct.h
+++ b/drivers/usb/misc/sisusbvga/sisusb_struct.h
@@ -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 {
diff --git a/drivers/video/fbdev/sis/vstruct.h b/drivers/video/fbdev/sis/vstruct.h
index ea94d214dcff..d7a14e63ba5a 100644
--- a/drivers/video/fbdev/sis/vstruct.h
+++ b/drivers/video/fbdev/sis/vstruct.h
@@ -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 {