Skip to contentSkip to conversation

media: stv0288: use explicitly signed char

PATCH In review Jason A. Donenfeld 1 participant 3 messages Oct 24, 2022 – Nov 11, 2022 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: stv0288: 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. Use s8 and u8 types here, since that's what surrounding code does. This fixes:

drivers/media/dvb-frontends/stv0288.c:471 stv0288_set_frontend() warn: assigning (-9) to unsigned variable 'tm' drivers/media/dvb-frontends/stv0288.c:471 stv0288_set_frontend() warn: we never enter this loop

---
 drivers/media/dvb-frontends/stv0288.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/media/dvb-frontends/stv0288.c +2 -3
index 3d54a0ec86af..3ae1f3a2f142 100644
@@ -440,9 +440,8 @@ static int stv0288_set_frontend(struct dvb_frontend *fe)
 	struct stv0288_state *state = fe->demodulator_priv;
 	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
 
-	char tm;
-	unsigned char tda[3];
-	u8 reg, time_out = 0;
+	u8 tda[3], reg, time_out = 0;
+	s8 tm;
 
 	dprintk("%s : FE_SET_FRONTEND\n", __func__);
 
Signature · 1 line
2.38.1
#1 lore raw

Hi Mauro,

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. Use s8 and u8 types here, since that's what surrounding code does. This fixes:

Quoted 6 lines

drivers/media/dvb-frontends/stv0288.c:471 stv0288_set_frontend() warn: assigning (-9) to unsigned variable 'tm' drivers/media/dvb-frontends/stv0288.c:471 stv0288_set_frontend() warn: we never enter this loop

Was wondering whether you planned on taking this into your tree as a 6.1 fix for Linus for rc4?

Thanks,
Jason

#2 lore raw

Hi Mauro,

Quoted 13 lines · Jason A. Donenfeld

Hi Mauro,

Quoted 9 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. Use s8 and u8 types here, since that's what surrounding code does. This fixes:

drivers/media/dvb-frontends/stv0288.c:471 stv0288_set_frontend() warn: assigning (-9) to unsigned variable 'tm' drivers/media/dvb-frontends/stv0288.c:471 stv0288_set_frontend() warn: we never enter this loop

Quoted 6 lines
Quoted 3 lines

Was wondering whether you planned on taking this into your tree as a 6.1 fix for Linus for rc4?

Thought I should follow up with you about this again.

Thanks,
Jason