msgb.c: Style cleanup in initialization

Don't assign the same var twice & init all from the same source.
This commit is contained in:
Sylvain Munaut 2010-02-24 22:57:46 +01:00 committed by Harald Welte
parent ac778fb85d
commit 17a5a28202
1 changed files with 4 additions and 13 deletions

View File

@ -44,12 +44,8 @@ struct msgb *msgb_alloc(uint16_t size, const char *name)
msg->data_len = size;
msg->len = 0;
msg->data = msg->_data;
msg->head = msg->data;
msg->data = msg->data;
/* reset tail pointer */
msg->tail = msg->data;
//msg->end = msg->tail + size;
msg->head = msg->_data;
msg->tail = msg->_data;
return msg;
}
@ -79,16 +75,11 @@ struct msgb *msgb_dequeue(struct llist_head *queue)
void msgb_reset(struct msgb *msg)
{
msg->len = 0;
msg->len = 0;
msg->data = msg->_data;
msg->head = msg->_data;
msg->tail = msg->_data;
msg->head = msg->data;
msg->data = msg->data;
/* reset tail pointer */
msg->tail = msg->data;
/* reset pointers */
msg->bts_link = NULL;
msg->trx = NULL;
msg->lchan = NULL;