Thread (70 messages) 70 messages, 9 authors, 2019-01-13

Re: [PATCH V3 2/7] net: lorawan: Add LoRaWAN socket module

From: Jian-Hong Pan <hidden>
Date: 2018-11-17 14:54:14
Also in: linux-arm-kernel, lkml

David Miller [off-list ref] 於 2018年11月17日 週六 下午12:32寫道:
From: Jian-Hong Pan <redacted>
Date: Thu, 15 Nov 2018 00:01:23 +0800
quoted
+#define      lrw_get_mac_cb(skb)     ((struct lrw_mac_cb *)skb->cb)
Please make this a static inline function.  If the identifier is all lowercase
programmers expect it to be real code not a CPP macro.
Okay!  Sure
quoted
+#define      LORAWAN_MODULE_NAME     "lorawan"
+
+#define      LRW_DBG_STR(fmt)        LORAWAN_MODULE_NAME": "fmt
+#define      lrw_info(fmt, ...)      (pr_info(LRW_DBG_STR(fmt), ##__VA_ARGS__))
+#define      lrw_dbg(fmt, ...)       (pr_debug(LRW_DBG_STR(fmt), ##__VA_ARGS__))
Just define "pr_fmt()" appropriately and you don't need to play these kinds
of games.

Set pr_fmt() and call pr_info() and pr_debug() directly.
After checking printk.h again, I get the idea of the comment.
"pr_fmt()" is more convenient!

Thanks for the reviewing.  I will make new patches.

Jian-Hong Pan
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help