[media] dvb-net: Fix probable mask then right shift defects
authorJoe Perches <joe@perches.com>
Mon, 27 Oct 2014 05:25:00 +0000 (02:25 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Mon, 3 Nov 2014 14:40:10 +0000 (12:40 -0200)
Precedence of & and >> is not the same and is not left to right.
shift has higher precedence and should be done after the mask.

Add parentheses around the mask.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/dvb-core/dvb_net.c

index 059e6117f22b5181d59229f0bd0af202466f7817..441814b94eb890151b90fbf40dc6cc61e24c5c71 100644 (file)
@@ -379,7 +379,9 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len )
                        /* Check TS error conditions: sync_byte, transport_error_indicator, scrambling_control . */
                        if ((ts[0] != TS_SYNC) || (ts[1] & TS_TEI) || ((ts[3] & TS_SC) != 0)) {
                                printk(KERN_WARNING "%lu: Invalid TS cell: SYNC %#x, TEI %u, SC %#x.\n",
-                                      priv->ts_count, ts[0], ts[1] & TS_TEI >> 7, ts[3] & 0xC0 >> 6);
+                                      priv->ts_count, ts[0],
+                                      (ts[1] & TS_TEI) >> 7,
+                                      (ts[3] & 0xC0) >> 6);
 
                                /* Drop partly decoded SNDU, reset state, resync on PUSI. */
                                if (priv->ule_skb) {