mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-25 18:14:53 +00:00
pbuf: Simplify pbuf_alloc a bit
No need to have additional if statement for PBUF_REF/PBUF_ROM. It can be merged to the existing swtich(type) cases. Signed-off-by: Axel Lin <axel.lin@ingics.com>
This commit is contained in:
parent
f3c860958f
commit
6f28a874b8
@ -224,11 +224,10 @@ pbuf_alloc(pbuf_layer layer, u16_t length, pbuf_type type)
|
||||
u16_t offset = (u16_t)layer;
|
||||
LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_alloc(length=%"U16_F")\n", length));
|
||||
|
||||
if ((type == PBUF_REF) || (type == PBUF_ROM)) {
|
||||
return pbuf_alloc_reference(NULL, length, type);
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case PBUF_REF:
|
||||
case PBUF_ROM:
|
||||
return pbuf_alloc_reference(NULL, length, type);
|
||||
case PBUF_POOL:
|
||||
{
|
||||
struct pbuf *q, *last;
|
||||
|
Loading…
Reference in New Issue
Block a user