datapath: Fix kernel style issues.
authorJesse Gross <jesse@nicira.com>
Wed, 5 Feb 2014 05:58:03 +0000 (21:58 -0800)
committerJesse Gross <jesse@nicira.com>
Wed, 5 Feb 2014 05:58:03 +0000 (21:58 -0800)
Suggested-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
datapath/datapath.c
datapath/flow_table.c

index 5f1b34c..d528ba0 100644 (file)
@@ -400,7 +400,7 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb,
 #endif
                .snd_portid = upcall_info->portid,
        };
-       size_t len, plen;
+       size_t len;
        unsigned int hlen;
        int err, dp_ifindex;
 
@@ -472,9 +472,12 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb,
        skb_zerocopy(user_skb, skb, skb->len, hlen);
 
        /* Pad OVS_PACKET_ATTR_PACKET if linear copy was performed */
-       if (!(dp->user_features & OVS_DP_F_UNALIGNED) &&
-           (plen = (ALIGN(user_skb->len, NLA_ALIGNTO) - user_skb->len)) > 0)
-               memset(skb_put(user_skb, plen), 0, plen);
+       if (!(dp->user_features & OVS_DP_F_UNALIGNED)) {
+               size_t plen = NLA_ALIGN(user_skb->len) - user_skb->len;
+
+               if (plen > 0)
+                       memset(skb_put(user_skb, plen), 0, plen);
+       }
 
        ((struct nlmsghdr *) user_skb->data)->nlmsg_len = user_skb->len;
 
index 20854ac..4e6b1c0 100644 (file)
@@ -173,7 +173,8 @@ void ovs_flow_free(struct sw_flow *flow, bool deferred)
                struct sw_flow_mask *mask = flow->mask;
 
                /* ovs-lock is required to protect mask-refcount and
-                * mask list. */
+                * mask list.
+                */
                ASSERT_OVSL();
                BUG_ON(!mask->ref_count);
                mask->ref_count--;