Skip to content

Commit be094ba

Browse files
authored
Merge pull request contiki-os#2690 from pjonsson/frame802154-tweak-size
frame802154: tweak for size savings
2 parents fd3c6d2 + bc8fd51 commit be094ba

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

os/net/mac/framer/frame802154.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -304,12 +304,8 @@ field_len(frame802154_t *p, field_length_t *flen)
304304
* up to the caller. */
305305
if(p->fcf.frame_version < FRAME802154_IEEE802154_2015) {
306306
/* Set PAN ID compression bit if src pan id matches dest pan id. */
307-
if((p->fcf.dest_addr_mode & 3) && (p->fcf.src_addr_mode & 3) &&
308-
p->src_pid == p->dest_pid) {
309-
p->fcf.panid_compression = 1;
310-
} else {
311-
p->fcf.panid_compression = 0;
312-
}
307+
p->fcf.panid_compression = (p->fcf.dest_addr_mode & 3) &&
308+
(p->fcf.src_addr_mode & 3) && p->src_pid == p->dest_pid;
313309
}
314310

315311
frame802154_has_panid(&p->fcf, &has_src_panid, &has_dest_panid);
@@ -340,7 +336,6 @@ field_len(frame802154_t *p, field_length_t *flen)
340336
#if LLSEC802154_USES_EXPLICIT_KEYS
341337
flen->aux_sec_len += get_key_id_len(p->aux_hdr.security_control.key_id_mode);
342338
#endif /* LLSEC802154_USES_EXPLICIT_KEYS */
343-
;
344339
}
345340
#endif /* LLSEC802154_USES_AUX_HEADER */
346341
}
@@ -393,7 +388,6 @@ frame802154_create(frame802154_t *p, uint8_t *buf)
393388
{
394389
int c;
395390
field_length_t flen;
396-
uint8_t pos;
397391
#if LLSEC802154_USES_EXPLICIT_KEYS
398392
uint8_t key_id_mode;
399393
#endif /* LLSEC802154_USES_EXPLICIT_KEYS */
@@ -403,7 +397,7 @@ frame802154_create(frame802154_t *p, uint8_t *buf)
403397
/* OK, now we have field lengths. Time to actually construct */
404398
/* the outgoing frame, and store it in buf */
405399
frame802154_create_fcf(&p->fcf, buf);
406-
pos = 2;
400+
unsigned int pos = 2;
407401

408402
/* Sequence number */
409403
if(flen.seqno_len == 1) {

0 commit comments

Comments
 (0)