]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
3c574_cs: fix operator precedence between << and &
authorNickolai Zeldovich <nickolai@csail.mit.edu>
Thu, 17 Jan 2013 07:18:29 +0000 (07:18 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 17 Jan 2013 20:04:30 +0000 (15:04 -0500)
The code to print the FIFO size in tc574_config computes it as:

  8 << config & Ram_size

which evaluates the '<<' first, but the actual intent is to evaluate the
'&' first.  Add parentheses to enforce desired evaluation order.

Signed-off-by: Nickolai Zeldovich <nickolai@csail.mit.edu>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/3com/3c574_cs.c

index 66df936380859b55ab0b8b15595319bfeb98c98a..ffd8de28a76ad2c69a96daab3c59dbe29127faa1 100644 (file)
@@ -432,7 +432,7 @@ static int tc574_config(struct pcmcia_device *link)
        netdev_info(dev, "%s at io %#3lx, irq %d, hw_addr %pM\n",
                    cardname, dev->base_addr, dev->irq, dev->dev_addr);
        netdev_info(dev, " %dK FIFO split %s Rx:Tx, %sMII interface.\n",
-                   8 << config & Ram_size,
+                   8 << (config & Ram_size),
                    ram_split[(config & Ram_split) >> Ram_split_shift],
                    config & Autoselect ? "autoselect " : "");