Skip to contentSkip to conversation

media: fix precedence in dvb/frontends/tda665x

PATCH In review Randy Dunlap 2 participants 2 messages Feb 25, 2010 – Feb 26, 2010 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: fix precedence in dvb/frontends/tda665x

From: Randy Dunlap <[email protected]>

Fix precedence so that data is used correctly.
Fixes sparse warning:
drivers/media/dvb/frontends/tda665x.c:136:55: warning: right shift by bigger than source value

---
 drivers/media/dvb/frontends/tda665x.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/dvb/frontends/tda665x.c +1 -1
@@ -133,7 +133,7 @@ static int tda665x_set_state(struct dvb_
 		frequency += config->ref_divider >> 1;
 		frequency /= config->ref_divider;
 
-		buf[0] = (u8) (frequency & 0x7f00) >> 8;
+		buf[0] = (u8) ((frequency & 0x7f00) >> 8);
 		buf[1] = (u8) (frequency & 0x00ff) >> 0;
 		buf[2] = 0x80 | 0x40 | 0x02;
 		buf[3] = 0x00;
Reviewed-by Acked-by on v1 1/1
#1 lore raw

Hi Randy,

Thanks for catching the bug !

Quoted 8 lines · Randy Dunlap

From: Randy Dunlap <[email protected]>

Fix precedence so that data is used correctly.
Fixes sparse warning:
drivers/media/dvb/frontends/tda665x.c:136:55: warning: right shift by bigger than source value

Quoted 17 lines

---
 drivers/media/dvb/frontends/tda665x.c |    2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/dvb/frontends/tda665x.c +1 -1
@@ -133,7 +133,7 @@ static int tda665x_set_state(struct dvb_
                frequency += config->ref_divider >> 1;
                frequency /= config->ref_divider;
 
-               buf[0] = (u8) (frequency & 0x7f00) >> 8;
+               buf[0] = (u8) ((frequency & 0x7f00) >> 8);
                buf[1] = (u8) (frequency & 0x00ff) >> 0;
                buf[2] = 0x80 | 0x40 | 0x02;
                buf[3] = 0x00;