Commit 7fc4cfda authored by Marcel Holtmann's avatar Marcel Holtmann

6lowpan: iphc: Fix issues with alignment matching open parenthesis

This patch fixes all the issues with alignment matching of open
parenthesis found by checkpatch.pl and makes them follow the
network coding style now.

CHECK: Alignment should match open parenthesis
+static int uncompress_addr(struct sk_buff *skb,
+				struct in6_addr *ipaddr, const u8 address_mode,

CHECK: Alignment should match open parenthesis
+static int uncompress_context_based_src_addr(struct sk_buff *skb,
+						struct in6_addr *ipaddr,

CHECK: Alignment should match open parenthesis
+static int skb_deliver(struct sk_buff *skb, struct ipv6hdr *hdr,
+		struct net_device *dev, skb_delivery_cb deliver_skb)

CHECK: Alignment should match open parenthesis
+	new = skb_copy_expand(skb, sizeof(struct ipv6hdr), skb_tailroom(skb),
+								GFP_ATOMIC);

CHECK: Alignment should match open parenthesis
+	raw_dump_table(__func__, "raw skb data dump before receiving",
+			new->data, new->len);

CHECK: Alignment should match open parenthesis
+lowpan_uncompress_multicast_daddr(struct sk_buff *skb,
+		struct in6_addr *ipaddr,

CHECK: Alignment should match open parenthesis
+	raw_dump_inline(NULL, "Reconstructed ipv6 multicast addr is",
+				ipaddr->s6_addr, 16);

CHECK: Alignment should match open parenthesis
+int lowpan_process_data(struct sk_buff *skb, struct net_device *dev,
+		const u8 *saddr, const u8 saddr_type, const u8 saddr_len,

CHECK: Alignment should match open parenthesis
+	raw_dump_table(__func__, "raw skb data dump uncompressed",
+				skb->data, skb->len);

CHECK: Alignment should match open parenthesis
+		err = uncompress_addr(skb, &hdr.saddr, tmp, saddr,
+					saddr_type, saddr_len);

CHECK: Alignment should match open parenthesis
+		err = uncompress_addr(skb, &hdr.daddr, tmp, daddr,
+					daddr_type, daddr_len);

CHECK: Alignment should match open parenthesis
+		pr_debug("dest: stateless compression mode %d dest %pI6c\n",
+			tmp, &hdr.daddr);

CHECK: Alignment should match open parenthesis
+		raw_dump_table(__func__, "raw UDP header dump",
+				      (u8 *)&uh, sizeof(uh));

CHECK: Alignment should match open parenthesis
+	raw_dump_table(__func__, "raw header dump", (u8 *)&hdr,
+							sizeof(hdr));

CHECK: Alignment should match open parenthesis
+int lowpan_header_compress(struct sk_buff *skb, struct net_device *dev,
+			unsigned short type, const void *_daddr,

CHECK: Alignment should match open parenthesis
+	raw_dump_table(__func__, "raw skb network header dump",
+		skb_network_header(skb), sizeof(struct ipv6hdr));

CHECK: Alignment should match open parenthesis
+	raw_dump_table(__func__,
+			"sending raw skb network uncompressed packet",

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

WARNING: quoted string split across lines
+			pr_debug("dest address unicast link-local %pI6c "
+				"iphc1 0x%02x\n", &hdr->daddr, iphc1);

CHECK: Alignment should match open parenthesis
+	raw_dump_table(__func__, "raw skb data dump compressed",
+				skb->data, skb->len);
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
parent 89f53490
...@@ -205,8 +205,7 @@ static int skb_deliver(struct sk_buff *skb, struct ipv6hdr *hdr, ...@@ -205,8 +205,7 @@ static int skb_deliver(struct sk_buff *skb, struct ipv6hdr *hdr,
/* Uncompress function for multicast destination address, /* Uncompress function for multicast destination address,
* when M bit is set. * when M bit is set.
*/ */
static int static int lowpan_uncompress_multicast_daddr(struct sk_buff *skb,
lowpan_uncompress_multicast_daddr(struct sk_buff *skb,
struct in6_addr *ipaddr, struct in6_addr *ipaddr,
const u8 dam) const u8 dam)
{ {
...@@ -259,8 +258,7 @@ lowpan_uncompress_multicast_daddr(struct sk_buff *skb, ...@@ -259,8 +258,7 @@ lowpan_uncompress_multicast_daddr(struct sk_buff *skb,
return 0; return 0;
} }
static int static int uncompress_udp_header(struct sk_buff *skb, struct udphdr *uh)
uncompress_udp_header(struct sk_buff *skb, struct udphdr *uh)
{ {
bool fail; bool fail;
u8 tmp = 0, val = 0; u8 tmp = 0, val = 0;
...@@ -424,8 +422,7 @@ int lowpan_process_data(struct sk_buff *skb, struct net_device *dev, ...@@ -424,8 +422,7 @@ int lowpan_process_data(struct sk_buff *skb, struct net_device *dev,
if (iphc1 & LOWPAN_IPHC_SAC) { if (iphc1 & LOWPAN_IPHC_SAC) {
/* Source address context based uncompression */ /* Source address context based uncompression */
pr_debug("SAC bit is set. Handle context based source address.\n"); pr_debug("SAC bit is set. Handle context based source address.\n");
err = uncompress_context_based_src_addr( err = uncompress_context_based_src_addr(skb, &hdr.saddr, tmp);
skb, &hdr.saddr, tmp);
} else { } else {
/* Source address uncompression */ /* Source address uncompression */
pr_debug("source address stateless compression\n"); pr_debug("source address stateless compression\n");
...@@ -446,8 +443,9 @@ int lowpan_process_data(struct sk_buff *skb, struct net_device *dev, ...@@ -446,8 +443,9 @@ int lowpan_process_data(struct sk_buff *skb, struct net_device *dev,
pr_debug("dest: context-based mcast compression\n"); pr_debug("dest: context-based mcast compression\n");
/* TODO: implement this */ /* TODO: implement this */
} else { } else {
err = lowpan_uncompress_multicast_daddr( err = lowpan_uncompress_multicast_daddr(skb, &hdr.daddr,
skb, &hdr.daddr, tmp); tmp);
if (err) if (err)
goto drop; goto drop;
} }
...@@ -499,8 +497,7 @@ int lowpan_process_data(struct sk_buff *skb, struct net_device *dev, ...@@ -499,8 +497,7 @@ int lowpan_process_data(struct sk_buff *skb, struct net_device *dev,
hdr.version, ntohs(hdr.payload_len), hdr.nexthdr, hdr.version, ntohs(hdr.payload_len), hdr.nexthdr,
hdr.hop_limit, &hdr.daddr); hdr.hop_limit, &hdr.daddr);
raw_dump_table(__func__, "raw header dump", (u8 *)&hdr, raw_dump_table(__func__, "raw header dump", (u8 *)&hdr, sizeof(hdr));
sizeof(hdr));
return skb_deliver(skb, &hdr, dev, deliver_skb); return skb_deliver(skb, &hdr, dev, deliver_skb);
...@@ -631,8 +628,7 @@ int lowpan_header_compress(struct sk_buff *skb, struct net_device *dev, ...@@ -631,8 +628,7 @@ int lowpan_header_compress(struct sk_buff *skb, struct net_device *dev,
raw_dump_inline(__func__, "daddr", raw_dump_inline(__func__, "daddr",
(unsigned char *)_daddr, IEEE802154_ADDR_LEN); (unsigned char *)_daddr, IEEE802154_ADDR_LEN);
raw_dump_table(__func__, raw_dump_table(__func__, "sending raw skb network uncompressed packet",
"sending raw skb network uncompressed packet",
skb->data, skb->len); skb->data, skb->len);
/* Traffic class, flow label /* Traffic class, flow label
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment