datapath: Fix coding style issues.
[sliver-openvswitch.git] / datapath / vport-netdev.c
index 4c7f1cb..a9d9238 100644 (file)
 #include "vport-netdev.h"
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37) && \
-    !defined(HAVE_VLAN_BUG_WORKAROUND)
+       !defined(HAVE_VLAN_BUG_WORKAROUND)
 #include <linux/module.h>
 
-static int vlan_tso __read_mostly = 0;
+static int vlan_tso __read_mostly;
 module_param(vlan_tso, int, 0644);
 MODULE_PARM_DESC(vlan_tso, "Enable TSO for VLAN packets");
 #else
@@ -120,7 +120,8 @@ static struct vport *netdev_create(const struct vport_parms *parms)
        struct netdev_vport *netdev_vport;
        int err;
 
-       vport = vport_alloc(sizeof(struct netdev_vport), &netdev_vport_ops, parms);
+       vport = vport_alloc(sizeof(struct netdev_vport),
+                           &netdev_vport_ops, parms);
        if (IS_ERR(vport)) {
                err = PTR_ERR(vport);
                goto error;
@@ -262,7 +263,7 @@ static void netdev_port_receive(struct vport *vport, struct sk_buff *skb)
        vport_receive(vport, skb);
 }
 
-static inline unsigned packet_length(const struct sk_buff *skb)
+static unsigned packet_length(const struct sk_buff *skb)
 {
        unsigned length = skb->len - ETH_HLEN;
 
@@ -374,11 +375,11 @@ error:
 /* Returns null if this device is not attached to a datapath. */
 struct vport *netdev_get_vport(struct net_device *dev)
 {
-#ifdef IFF_BRIDGE_PORT
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)
 #if IFF_BRIDGE_PORT != IFF_OVS_DATAPATH
        if (likely(dev->priv_flags & IFF_OVS_DATAPATH))
 #else
-       if (likely(rcu_access_pointer(dev->rx_handler) == netdev_frame_hook))   
+       if (likely(rcu_access_pointer(dev->rx_handler) == netdev_frame_hook))
 #endif
                return (struct vport *)rcu_dereference_rtnl(dev->rx_handler_data);
        else