cnss2: Consolidate logging message
Currently the code makes liberal use of macros that print a log
message (with pr_err or pr_debug) and then passes the same string
on to the IPC logging mechanism. The problem is that it doesn't
actually end up being the same string in the binary. Using pr_err
or one of its friends appends the KERN_* code to the front of the
string with the pre-processor and the IPC logger just uses the
passed in string. Every string used by the macros ends up appearing
twice in the binary, once with KERN_* prepended and the other not.
This change fixes this duplication issue by appending KERN_* to the
front of the IPC logger for CNSS2 driver.
Change-Id: I62facd7aaf23bd06fad84d272144f1a50ad539a5
Signed-off-by: Yue Ma <yuem@codeaurora.org>
diff --git a/drivers/net/wireless/cnss2/debug.h b/drivers/net/wireless/cnss2/debug.h
index f31fdfe..bf2e755 100644
--- a/drivers/net/wireless/cnss2/debug.h
+++ b/drivers/net/wireless/cnss2/debug.h
@@ -26,23 +26,23 @@
} while (0)
#define cnss_pr_err(_fmt, ...) do { \
- pr_err("cnss: " _fmt, ##__VA_ARGS__); \
- cnss_ipc_log_string("ERR: " _fmt, ##__VA_ARGS__); \
+ printk("%scnss: " _fmt, KERN_ERR, ##__VA_ARGS__); \
+ cnss_ipc_log_string("%scnss: " _fmt, "", ##__VA_ARGS__);\
} while (0)
#define cnss_pr_warn(_fmt, ...) do { \
- pr_warn("cnss: " _fmt, ##__VA_ARGS__); \
- cnss_ipc_log_string("WRN: " _fmt, ##__VA_ARGS__); \
+ printk("%scnss: " _fmt, KERN_WARNING, ##__VA_ARGS__); \
+ cnss_ipc_log_string("%scnss: " _fmt, "", ##__VA_ARGS__);\
} while (0)
#define cnss_pr_info(_fmt, ...) do { \
- pr_info("cnss: " _fmt, ##__VA_ARGS__); \
- cnss_ipc_log_string("INF: " _fmt, ##__VA_ARGS__); \
+ printk("%scnss: " _fmt, KERN_INFO, ##__VA_ARGS__); \
+ cnss_ipc_log_string("%scnss: " _fmt, "", ##__VA_ARGS__);\
} while (0)
#define cnss_pr_dbg(_fmt, ...) do { \
- pr_debug("cnss: " _fmt, ##__VA_ARGS__); \
- cnss_ipc_log_string("DBG: " _fmt, ##__VA_ARGS__); \
+ printk("%scnss: " _fmt, KERN_DEBUG, ##__VA_ARGS__); \
+ cnss_ipc_log_string("%scnss: " _fmt, "", ##__VA_ARGS__);\
} while (0)
#ifdef CONFIG_CNSS2_DEBUG