msgb.c: Style cleanup in initialization
Don't assign the same var twice & init all from the same source.
This commit is contained in:
parent
ac778fb85d
commit
17a5a28202
17
src/msgb.c
17
src/msgb.c
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue