Skip to content

Commit 7fc4cfd

Browse files
committed
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: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
1 parent 89f5349 commit 7fc4cfd

1 file changed

Lines changed: 35 additions & 39 deletions

File tree

‎net/6lowpan/iphc.c‎

Lines changed: 35 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@
6363
* address_mode is sam value or dam value.
6464
*/
6565
static int uncompress_addr(struct sk_buff *skb,
66-
struct in6_addr *ipaddr, const u8 address_mode,
67-
const u8 *lladdr, const u8 addr_type,
68-
const u8 addr_len)
66+
struct in6_addr *ipaddr, const u8 address_mode,
67+
const u8 *lladdr, const u8 addr_type,
68+
const u8 addr_len)
6969
{
7070
bool fail;
7171

@@ -142,8 +142,8 @@ static int uncompress_addr(struct sk_buff *skb,
142142
* based address(non-multicast).
143143
*/
144144
static int uncompress_context_based_src_addr(struct sk_buff *skb,
145-
struct in6_addr *ipaddr,
146-
const u8 sam)
145+
struct in6_addr *ipaddr,
146+
const u8 sam)
147147
{
148148
switch (sam) {
149149
case LOWPAN_IPHC_ADDR_00:
@@ -172,13 +172,13 @@ static int uncompress_context_based_src_addr(struct sk_buff *skb,
172172
}
173173

174174
static int skb_deliver(struct sk_buff *skb, struct ipv6hdr *hdr,
175-
struct net_device *dev, skb_delivery_cb deliver_skb)
175+
struct net_device *dev, skb_delivery_cb deliver_skb)
176176
{
177177
struct sk_buff *new;
178178
int stat;
179179

180180
new = skb_copy_expand(skb, sizeof(struct ipv6hdr), skb_tailroom(skb),
181-
GFP_ATOMIC);
181+
GFP_ATOMIC);
182182
kfree_skb(skb);
183183

184184
if (!new)
@@ -193,7 +193,7 @@ static int skb_deliver(struct sk_buff *skb, struct ipv6hdr *hdr,
193193
new->dev = dev;
194194

195195
raw_dump_table(__func__, "raw skb data dump before receiving",
196-
new->data, new->len);
196+
new->data, new->len);
197197

198198
stat = deliver_skb(new, dev);
199199

@@ -205,10 +205,9 @@ static int skb_deliver(struct sk_buff *skb, struct ipv6hdr *hdr,
205205
/* Uncompress function for multicast destination address,
206206
* when M bit is set.
207207
*/
208-
static int
209-
lowpan_uncompress_multicast_daddr(struct sk_buff *skb,
210-
struct in6_addr *ipaddr,
211-
const u8 dam)
208+
static int lowpan_uncompress_multicast_daddr(struct sk_buff *skb,
209+
struct in6_addr *ipaddr,
210+
const u8 dam)
212211
{
213212
bool fail;
214213

@@ -254,13 +253,12 @@ lowpan_uncompress_multicast_daddr(struct sk_buff *skb,
254253
}
255254

256255
raw_dump_inline(NULL, "Reconstructed ipv6 multicast addr is",
257-
ipaddr->s6_addr, 16);
256+
ipaddr->s6_addr, 16);
258257

259258
return 0;
260259
}
261260

262-
static int
263-
uncompress_udp_header(struct sk_buff *skb, struct udphdr *uh)
261+
static int uncompress_udp_header(struct sk_buff *skb, struct udphdr *uh)
264262
{
265263
bool fail;
266264
u8 tmp = 0, val = 0;
@@ -336,16 +334,16 @@ uncompress_udp_header(struct sk_buff *skb, struct udphdr *uh)
336334
static const u8 lowpan_ttl_values[] = { 0, 1, 64, 255 };
337335

338336
int lowpan_process_data(struct sk_buff *skb, struct net_device *dev,
339-
const u8 *saddr, const u8 saddr_type, const u8 saddr_len,
340-
const u8 *daddr, const u8 daddr_type, const u8 daddr_len,
341-
u8 iphc0, u8 iphc1, skb_delivery_cb deliver_skb)
337+
const u8 *saddr, const u8 saddr_type, const u8 saddr_len,
338+
const u8 *daddr, const u8 daddr_type, const u8 daddr_len,
339+
u8 iphc0, u8 iphc1, skb_delivery_cb deliver_skb)
342340
{
343341
struct ipv6hdr hdr = {};
344342
u8 tmp, num_context = 0;
345343
int err;
346344

347345
raw_dump_table(__func__, "raw skb data dump uncompressed",
348-
skb->data, skb->len);
346+
skb->data, skb->len);
349347

350348
/* another if the CID flag is set */
351349
if (iphc1 & LOWPAN_IPHC_CID) {
@@ -424,13 +422,12 @@ int lowpan_process_data(struct sk_buff *skb, struct net_device *dev,
424422
if (iphc1 & LOWPAN_IPHC_SAC) {
425423
/* Source address context based uncompression */
426424
pr_debug("SAC bit is set. Handle context based source address.\n");
427-
err = uncompress_context_based_src_addr(
428-
skb, &hdr.saddr, tmp);
425+
err = uncompress_context_based_src_addr(skb, &hdr.saddr, tmp);
429426
} else {
430427
/* Source address uncompression */
431428
pr_debug("source address stateless compression\n");
432429
err = uncompress_addr(skb, &hdr.saddr, tmp, saddr,
433-
saddr_type, saddr_len);
430+
saddr_type, saddr_len);
434431
}
435432

436433
/* Check on error of previous branch */
@@ -446,16 +443,17 @@ int lowpan_process_data(struct sk_buff *skb, struct net_device *dev,
446443
pr_debug("dest: context-based mcast compression\n");
447444
/* TODO: implement this */
448445
} else {
449-
err = lowpan_uncompress_multicast_daddr(
450-
skb, &hdr.daddr, tmp);
446+
err = lowpan_uncompress_multicast_daddr(skb, &hdr.daddr,
447+
tmp);
448+
451449
if (err)
452450
goto drop;
453451
}
454452
} else {
455453
err = uncompress_addr(skb, &hdr.daddr, tmp, daddr,
456-
daddr_type, daddr_len);
454+
daddr_type, daddr_len);
457455
pr_debug("dest: stateless compression mode %d dest %pI6c\n",
458-
tmp, &hdr.daddr);
456+
tmp, &hdr.daddr);
459457
if (err)
460458
goto drop;
461459
}
@@ -484,7 +482,7 @@ int lowpan_process_data(struct sk_buff *skb, struct net_device *dev,
484482
skb_copy_to_linear_data(skb, &uh, sizeof(struct udphdr));
485483

486484
raw_dump_table(__func__, "raw UDP header dump",
487-
(u8 *)&uh, sizeof(uh));
485+
(u8 *)&uh, sizeof(uh));
488486

489487
hdr.nexthdr = UIP_PROTO_UDP;
490488
}
@@ -499,8 +497,7 @@ int lowpan_process_data(struct sk_buff *skb, struct net_device *dev,
499497
hdr.version, ntohs(hdr.payload_len), hdr.nexthdr,
500498
hdr.hop_limit, &hdr.daddr);
501499

502-
raw_dump_table(__func__, "raw header dump", (u8 *)&hdr,
503-
sizeof(hdr));
500+
raw_dump_table(__func__, "raw header dump", (u8 *)&hdr, sizeof(hdr));
504501

505502
return skb_deliver(skb, &hdr, dev, deliver_skb);
506503

@@ -594,8 +591,8 @@ static void compress_udp_header(u8 **hc_ptr, struct sk_buff *skb)
594591
}
595592

596593
int lowpan_header_compress(struct sk_buff *skb, struct net_device *dev,
597-
unsigned short type, const void *_daddr,
598-
const void *_saddr, unsigned int len)
594+
unsigned short type, const void *_daddr,
595+
const void *_saddr, unsigned int len)
599596
{
600597
u8 tmp, iphc0, iphc1, *hc_ptr;
601598
struct ipv6hdr *hdr;
@@ -610,11 +607,11 @@ int lowpan_header_compress(struct sk_buff *skb, struct net_device *dev,
610607

611608
pr_debug("IPv6 header dump:\n\tversion = %d\n\tlength = %d\n"
612609
"\tnexthdr = 0x%02x\n\thop_lim = %d\n\tdest = %pI6c\n",
613-
hdr->version, ntohs(hdr->payload_len), hdr->nexthdr,
614-
hdr->hop_limit, &hdr->daddr);
610+
hdr->version, ntohs(hdr->payload_len), hdr->nexthdr,
611+
hdr->hop_limit, &hdr->daddr);
615612

616613
raw_dump_table(__func__, "raw skb network header dump",
617-
skb_network_header(skb), sizeof(struct ipv6hdr));
614+
skb_network_header(skb), sizeof(struct ipv6hdr));
618615

619616
/* As we copy some bit-length fields, in the IPHC encoding bytes,
620617
* we sometimes use |=
@@ -631,9 +628,8 @@ int lowpan_header_compress(struct sk_buff *skb, struct net_device *dev,
631628
raw_dump_inline(__func__, "daddr",
632629
(unsigned char *)_daddr, IEEE802154_ADDR_LEN);
633630

634-
raw_dump_table(__func__,
635-
"sending raw skb network uncompressed packet",
636-
skb->data, skb->len);
631+
raw_dump_table(__func__, "sending raw skb network uncompressed packet",
632+
skb->data, skb->len);
637633

638634
/* Traffic class, flow label
639635
* If flow label is 0, compress it. If traffic class is 0, compress it
@@ -763,7 +759,7 @@ int lowpan_header_compress(struct sk_buff *skb, struct net_device *dev,
763759
iphc1 |= lowpan_compress_addr_64(&hc_ptr,
764760
LOWPAN_IPHC_DAM_BIT, &hdr->daddr, _daddr);
765761
pr_debug("dest address unicast link-local %pI6c "
766-
"iphc1 0x%02x\n", &hdr->daddr, iphc1);
762+
"iphc1 0x%02x\n", &hdr->daddr, iphc1);
767763
} else {
768764
pr_debug("dest address unicast %pI6c\n", &hdr->daddr);
769765
lowpan_push_hc_data(&hc_ptr, hdr->daddr.s6_addr, 16);
@@ -785,7 +781,7 @@ int lowpan_header_compress(struct sk_buff *skb, struct net_device *dev,
785781
pr_debug("header len %d skb %u\n", (int)(hc_ptr - head), skb->len);
786782

787783
raw_dump_table(__func__, "raw skb data dump compressed",
788-
skb->data, skb->len);
784+
skb->data, skb->len);
789785
return 0;
790786
}
791787
EXPORT_SYMBOL_GPL(lowpan_header_compress);

0 commit comments

Comments
 (0)