net: Fix NET_BUF_ASSERT macro compile error

This commit fixes this compile error if network buffer debugging
is activated.

  CC      net/buf.o
net/buf.c: In function 'net_buf_unref':
net/buf.c:40:31: error: expected expression before 'if'
 #define NET_BUF_ASSERT(cond) (if (!(cond)) {    \
                               ^
net/buf.c:81:2: note: in expansion of macro 'NET_BUF_ASSERT'
  NET_BUF_ASSERT(buf->ref > 0);
  ^

Change-Id: Id4248806a5df571663e47eab581164a16df0cd1b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
Jukka Rissanen 2015-10-29 16:36:44 +02:00 committed by Anas Nashif
commit db51867a2b

View file

@ -32,9 +32,9 @@
#define NET_BUF_ERR(fmt, ...) printf("buf: %s: " fmt, __func__, ##__VA_ARGS__)
#define NET_BUF_WARN(fmt, ...) printf("buf: %s: " fmt, __func__, ##__VA_ARGS__)
#define NET_BUF_INFO(fmt, ...) printf("buf: " fmt, ##__VA_ARGS__)
#define NET_BUF_ASSERT(cond) (if (!(cond)) { \
NET_BUF_ERR("buf: assert: '" #cond "' failed\n"); \
})
#define NET_BUF_ASSERT(cond) do { if (!(cond)) { \
NET_BUF_ERR("buf: assert: '" #cond "' failed\n"); \
}} while(0)
#else
#define NET_BUF_DBG(fmt, ...)
#define NET_BUF_ERR(fmt, ...)