summaryrefslogtreecommitdiff
path: root/src/ipcpd/normal/shm_pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ipcpd/normal/shm_pci.c')
-rw-r--r--src/ipcpd/normal/shm_pci.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/ipcpd/normal/shm_pci.c b/src/ipcpd/normal/shm_pci.c
index 3a16a2da..aa18fa38 100644
--- a/src/ipcpd/normal/shm_pci.c
+++ b/src/ipcpd/normal/shm_pci.c
@@ -39,13 +39,12 @@
#define TTL_SIZE 1
#define CHK_SIZE 4
-static int shm_pci_head_size(struct dt_const * dtc)
+static size_t shm_pci_head_size(struct dt_const * dtc)
{
- int len = 0;
+ size_t len = 0;
len = dtc->addr_size * 2 + dtc->cep_id_size * 2
- + dtc->pdu_length_size + dtc->seqno_size
- + QOS_ID_SIZE;
+ + dtc->pdu_length_size + dtc->seqno_size + QOS_ID_SIZE;
if (dtc->has_ttl)
len += TTL_SIZE;
@@ -53,7 +52,7 @@ static int shm_pci_head_size(struct dt_const * dtc)
return len;
}
-static int shm_pci_tail_size(struct dt_const * dtc)
+static size_t shm_pci_tail_size(struct dt_const * dtc)
{
return dtc->has_chk ? CHK_SIZE : 0;
}
@@ -162,10 +161,11 @@ struct pci * shm_pci_des(struct shm_du_buff * sdb)
int offset = 0;
struct dt_const * dtc;
- head = shm_du_buff_head(sdb);
- if (head == NULL)
+ if (sdb == NULL)
return NULL;
+ head = shm_du_buff_head(sdb);
+
dtc = ribmgr_dt_const();
if (dtc == NULL)
return NULL;
@@ -221,7 +221,7 @@ int shm_pci_shrink(struct shm_du_buff * sdb)
int shm_pci_dec_ttl(struct shm_du_buff * sdb)
{
struct dt_const * dtc;
- int offset = 0;
+ size_t offset = 0;
uint8_t * head;
uint8_t * tail;