]> git.karo-electronics.de Git - linux-beck.git/commitdiff
6lowpan: iphc: Fix parenthesis alignments which off-by-one
authorMarcel Holtmann <marcel@holtmann.org>
Wed, 30 Jul 2014 01:48:44 +0000 (03:48 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Wed, 30 Jul 2014 17:28:40 +0000 (19:28 +0200)
CHECK: Alignment should match open parenthesis
+ if (((hdr->flow_lbl[0] & 0x0F) == 0) &&
+      (hdr->flow_lbl[1] == 0) && (hdr->flow_lbl[2] == 0)) {

CHECK: Alignment should match open parenthesis
+ if ((hdr->priority == 0) &&
+    ((hdr->flow_lbl[0] & 0xF0) == 0)) {

CHECK: Alignment should match open parenthesis
+ if ((hdr->priority == 0) &&
+    ((hdr->flow_lbl[0] & 0xF0) == 0)) {

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
net/6lowpan/iphc.c

index 9e47702d24ddf6745b29fa6ba6f3bbecd5acf14f..350ecfafa8e78c6406cceae0f7f21f12cf94ce44 100644 (file)
@@ -643,11 +643,11 @@ int lowpan_header_compress(struct sk_buff *skb, struct net_device *dev,
        tmp = ((tmp & 0x03) << 6) | (tmp >> 2);
 
        if (((hdr->flow_lbl[0] & 0x0F) == 0) &&
-            (hdr->flow_lbl[1] == 0) && (hdr->flow_lbl[2] == 0)) {
+           (hdr->flow_lbl[1] == 0) && (hdr->flow_lbl[2] == 0)) {
                /* flow label can be compressed */
                iphc0 |= LOWPAN_IPHC_FL_C;
                if ((hdr->priority == 0) &&
-                  ((hdr->flow_lbl[0] & 0xF0) == 0)) {
+                   ((hdr->flow_lbl[0] & 0xF0) == 0)) {
                        /* compress (elide) all */
                        iphc0 |= LOWPAN_IPHC_TC_C;
                } else {
@@ -658,7 +658,7 @@ int lowpan_header_compress(struct sk_buff *skb, struct net_device *dev,
        } else {
                /* Flow label cannot be compressed */
                if ((hdr->priority == 0) &&
-                  ((hdr->flow_lbl[0] & 0xF0) == 0)) {
+                   ((hdr->flow_lbl[0] & 0xF0) == 0)) {
                        /* compress only traffic class */
                        iphc0 |= LOWPAN_IPHC_TC_C;
                        *hc_ptr = (tmp & 0xc0) | (hdr->flow_lbl[0] & 0x0F);