From b08723425e76eafcdb88e501410c910e3c7bd2c0 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Fri, 26 Feb 2016 16:57:49 +0100 Subject: ipcpd: Fixes in pci.c HEAD_SIZE and TAIL_SIZE renamed PCI_HEAD_SIZE and PCI_TAIL_SIZE broke up a mixed definition and assignment --- src/ipcpd/pci.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'src/ipcpd') diff --git a/src/ipcpd/pci.c b/src/ipcpd/pci.c index d4ef9033..19c42e53 100644 --- a/src/ipcpd/pci.c +++ b/src/ipcpd/pci.c @@ -25,13 +25,13 @@ #include #include -#define HEAD_SIZE(a, b) a.addr_size * 2 + \ - a.cep_id_size * 2 + \ - a.pdu_length_size + \ - a.seqno_size + \ - a.qos_id_size + \ - b.ttl_size -#define TAIL_SIZE(b) b.chk_size +#define PCI_HEAD_SIZE(a, b) a.addr_size * 2 + \ + a.cep_id_size * 2 + \ + a.pdu_length_size + \ + b.ttl_size + \ + a.seqno_size + \ + a.qos_id_size +#define PCI_TAIL_SIZE(b) b.chk_size struct pci { @@ -58,13 +58,14 @@ pci_t * pci_create(du_buff_t * dub, const struct ipcp_dtp_const * dtpc, const struct ipcp_dup_const * dupc) { + struct pci * p; if (dub == NULL) { LOG_DBGF("Bogus input. Bugging out."); return NULL; } - struct pci * p = malloc(sizeof *p); + p = malloc(sizeof *p); if (p == NULL) return NULL; @@ -99,9 +100,10 @@ int pci_init(pci_t * pci) return -EINVAL; } - uint8_t * pci_head = du_buff_head_alloc(pci->dub, - HEAD_SIZE(pci->dtpc,pci->dupc)); - uint8_t * pci_tail = du_buff_tail_alloc(pci->dub, TAIL_SIZE(pci->dupc)); + uint8_t * pci_head = du_buff_head_alloc(pci->dub, PCI_HEAD_SIZE( + pci->dtpc,pci->dupc)); + uint8_t * pci_tail = du_buff_tail_alloc(pci->dub, PCI_TAIL_SIZE( + pci->dupc)); if (pci_head == NULL) { LOG_DBG("Failed to allocate space for PCI at head."); @@ -135,6 +137,6 @@ void pci_release(pci_t * pci) if (pci->dub == NULL) return; - du_buff_head_release(pci->dub, HEAD_SIZE(pci->dtpc, pci->dupc)); - du_buff_tail_release(pci->dub, TAIL_SIZE(pci->dupc)); + du_buff_head_release(pci->dub, PCI_HEAD_SIZE(pci->dtpc, pci->dupc)); + du_buff_tail_release(pci->dub, PCI_TAIL_SIZE(pci->dupc)); } -- cgit v1.2.3