]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
net: drivers: use bool type instead of double negation
authorMichał Mirosław <mirq-linux@rere.qmqm.pl>
Wed, 16 Nov 2011 14:05:33 +0000 (14:05 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 17 Nov 2011 04:12:20 +0000 (23:12 -0500)
Save some punctuation by using bool type's property equivalent to
doubled negation operator.

Reported-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/jme.c
drivers/net/ethernet/marvell/mv643xx_eth.c
drivers/net/ethernet/marvell/sky2.c
drivers/net/xen-netfront.c

index df3ab831b1ad6f3e2319335e9d4d12df29629a53..5c0b531949e200b26f8875d2dc46235773e312de 100644 (file)
@@ -1883,7 +1883,7 @@ jme_fill_tx_map(struct pci_dev *pdev,
                struct page *page,
                u32 page_offset,
                u32 len,
-               u8 hidma)
+               bool hidma)
 {
        dma_addr_t dmaaddr;
 
@@ -1917,7 +1917,7 @@ jme_map_tx_skb(struct jme_adapter *jme, struct sk_buff *skb, int idx)
        struct jme_ring *txring = &(jme->txring[0]);
        struct txdesc *txdesc = txring->desc, *ctxdesc;
        struct jme_buffer_info *txbi = txring->bufinf, *ctxbi;
-       u8 hidma = !!(jme->dev->features & NETIF_F_HIGHDMA);
+       bool hidma = jme->dev->features & NETIF_F_HIGHDMA;
        int i, nr_frags = skb_shinfo(skb)->nr_frags;
        int mask = jme->tx_ring_mask;
        const struct skb_frag_struct *frag;
index 157c5c17fdcc407455610baf7b6f49ed279bce91..43e3e6102149965988228cb8fa3c3a81542e5e19 100644 (file)
@@ -1582,7 +1582,7 @@ static int
 mv643xx_eth_set_features(struct net_device *dev, netdev_features_t features)
 {
        struct mv643xx_eth_private *mp = netdev_priv(dev);
-       int rx_csum = !!(features & NETIF_F_RXCSUM);
+       bool rx_csum = features & NETIF_F_RXCSUM;
 
        wrlp(mp, PORT_CONFIG, rx_csum ? 0x02000000 : 0x00000000);
 
index c79dc54476581d1fd83ac286fcf78fc861e0c537..7db6e36ec4f91717c123c37e4471287e47974892 100644 (file)
@@ -4313,7 +4313,7 @@ static int sky2_set_features(struct net_device *dev, netdev_features_t features)
        netdev_features_t changed = dev->features ^ features;
 
        if (changed & NETIF_F_RXCSUM) {
-               int on = !!(features & NETIF_F_RXCSUM);
+               bool on = features & NETIF_F_RXCSUM;
                sky2_write32(sky2->hw, Q_ADDR(rxqaddr[sky2->port], Q_CSR),
                             on ? BMU_ENA_RX_CHKSUM : BMU_DIS_RX_CHKSUM);
        }
index a6e379fbf377d93d4097871189a76e21dc2cff58..4312db8cdeab20c5c3b5ea0e3348f19ab3875ee7 100644 (file)
@@ -201,9 +201,9 @@ static void xennet_sysfs_delif(struct net_device *netdev);
 #define xennet_sysfs_delif(dev) do { } while (0)
 #endif
 
-static int xennet_can_sg(struct net_device *dev)
+static bool xennet_can_sg(struct net_device *dev)
 {
-       return !!(dev->features & NETIF_F_SG);
+       return dev->features & NETIF_F_SG;
 }