pbuf: Use SYS_ARCH_INC in pbuf_ref()

Use SYS_ARCH_INC to simplify the code.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: goldsimon <goldsimon@gmx.de>
This commit is contained in:
Axel Lin 2016-08-22 23:09:57 +08:00 committed by goldsimon
parent 40f2bed5c4
commit 1c5c96a50a

View File

@ -766,12 +766,9 @@ pbuf_clen(struct pbuf *p)
void
pbuf_ref(struct pbuf *p)
{
SYS_ARCH_DECL_PROTECT(old_level);
/* pbuf given? */
if (p != NULL) {
SYS_ARCH_PROTECT(old_level);
++(p->ref);
SYS_ARCH_UNPROTECT(old_level);
SYS_ARCH_INC(p->ref, 1);
}
}