Skip to content

Commit

Permalink
treewide: Make every ipc_loggings a no-op
Browse files Browse the repository at this point in the history
The compiler will now delete ipc_loggings completely.

Signed-off-by: Park Ju Hyung <[email protected]>
Change-Id: I104b63e7536a2a74869e0e2285c8f8e17283d65a
Signed-off-by: Lau <[email protected]>
  • Loading branch information
arter97 authored and zeelog committed Nov 19, 2023
1 parent 79cd8b5 commit 93f42b6
Show file tree
Hide file tree
Showing 34 changed files with 74 additions and 560 deletions.
6 changes: 1 addition & 5 deletions drivers/char/msm_smd_pkt.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,7 @@ enum {

#ifdef DEBUG

#define SMD_PKT_LOG_STRING(x...) \
do { \
if (smd_pkt_ilctxt) \
ipc_log_string(smd_pkt_ilctxt, "<SMD_PKT>: "x); \
} while (0)
#define SMD_PKT_LOG_STRING(x...) ((void)0)

#define D_STATUS(x...) \
do { \
Expand Down
6 changes: 1 addition & 5 deletions drivers/devfreq/devfreq_spdm.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ static void *spdm_ipc_log_ctxt;
#define DEVFREQ_SPDM_DEFAULT_WINDOW_MS 100
#define SPDM_IPC_LOG_PAGES 5

#define SPDM_IPC_LOG(x...) do { \
pr_debug(x); \
if (spdm_ipc_log_ctxt) \
ipc_log_string(spdm_ipc_log_ctxt, x); \
} while (0)
#define SPDM_IPC_LOG(x...) ((void)0)

#define COPY_SIZE(x, y) ((x) <= (y) ? (x) : (y))

Expand Down
26 changes: 0 additions & 26 deletions drivers/dma/qcom/gpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,45 +43,27 @@
#define GPI_LOG(gpi_dev, fmt, ...) do { \
if (gpi_dev->klog_lvl != LOG_LVL_MASK_ALL) \
dev_dbg(gpi_dev->dev, "%s: " fmt, __func__, ##__VA_ARGS__); \
if (gpi_dev->ilctxt && gpi_dev->ipc_log_lvl != LOG_LVL_MASK_ALL) \
ipc_log_string(gpi_dev->ilctxt, \
"%s: " fmt, __func__, ##__VA_ARGS__); \
} while (0)
#define GPI_ERR(gpi_dev, fmt, ...) do { \
if (gpi_dev->klog_lvl >= LOG_LVL_ERROR) \
dev_err(gpi_dev->dev, "%s: " fmt, __func__, ##__VA_ARGS__); \
if (gpi_dev->ilctxt && gpi_dev->ipc_log_lvl >= LOG_LVL_ERROR) \
ipc_log_string(gpi_dev->ilctxt, \
"%s: " fmt, __func__, ##__VA_ARGS__); \
} while (0)

/* gpii specific logging macros */
#define GPII_INFO(gpii, ch, fmt, ...) do { \
if (gpii->klog_lvl >= LOG_LVL_INFO) \
pr_info("%s:%u:%s: " fmt, gpii->label, ch, \
__func__, ##__VA_ARGS__); \
if (gpii->ilctxt && gpii->ipc_log_lvl >= LOG_LVL_INFO) \
ipc_log_string(gpii->ilctxt, \
"ch:%u %s: " fmt, ch, \
__func__, ##__VA_ARGS__); \
} while (0)
#define GPII_ERR(gpii, ch, fmt, ...) do { \
if (gpii->klog_lvl >= LOG_LVL_ERROR) \
pr_err("%s:%u:%s: " fmt, gpii->label, ch, \
__func__, ##__VA_ARGS__); \
if (gpii->ilctxt && gpii->ipc_log_lvl >= LOG_LVL_ERROR) \
ipc_log_string(gpii->ilctxt, \
"ch:%u %s: " fmt, ch, \
__func__, ##__VA_ARGS__); \
} while (0)
#define GPII_CRITIC(gpii, ch, fmt, ...) do { \
if (gpii->klog_lvl >= LOG_LVL_CRITICAL) \
pr_err("%s:%u:%s: " fmt, gpii->label, ch, \
__func__, ##__VA_ARGS__); \
if (gpii->ilctxt && gpii->ipc_log_lvl >= LOG_LVL_CRITICAL) \
ipc_log_string(gpii->ilctxt, \
"ch:%u %s: " fmt, ch, \
__func__, ##__VA_ARGS__); \
} while (0)

enum DEBUG_LOG_LVL {
Expand Down Expand Up @@ -109,19 +91,11 @@ enum EV_PRIORITY {
if (gpii->klog_lvl >= LOG_LVL_REG_ACCESS) \
pr_info("%s:%u:%s: " fmt, gpii->label, \
ch, __func__, ##__VA_ARGS__); \
if (gpii->ilctxt && gpii->ipc_log_lvl >= LOG_LVL_REG_ACCESS) \
ipc_log_string(gpii->ilctxt, \
"ch:%u %s: " fmt, ch, \
__func__, ##__VA_ARGS__); \
} while (0)
#define GPII_VERB(gpii, ch, fmt, ...) do { \
if (gpii->klog_lvl >= LOG_LVL_VERBOSE) \
pr_info("%s:%u:%s: " fmt, gpii->label, \
ch, __func__, ##__VA_ARGS__); \
if (gpii->ilctxt && gpii->ipc_log_lvl >= LOG_LVL_VERBOSE) \
ipc_log_string(gpii->ilctxt, \
"ch:%u %s: " fmt, ch, \
__func__, ##__VA_ARGS__); \
} while (0)

#else
Expand Down
5 changes: 1 addition & 4 deletions drivers/net/wireless/cnss2/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@

extern void *cnss_ipc_log_context;

#define cnss_ipc_log_string(_x...) do { \
if (cnss_ipc_log_context) \
ipc_log_string(cnss_ipc_log_context, _x); \
} while (0)
#define cnss_ipc_log_string(_x...) ((void)0)

#define cnss_pr_err(_fmt, ...) do { \
printk("%scnss: " _fmt, KERN_ERR, ##__VA_ARGS__); \
Expand Down
28 changes: 1 addition & 27 deletions drivers/pci/host/pci-msm.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,57 +235,31 @@
} while (0)

#define PCIE_DBG(dev, fmt, arg...) do { \
if ((dev) && (dev)->ipc_log_long) \
ipc_log_string((dev)->ipc_log_long, \
"DBG1:%s: " fmt, __func__, arg); \
if ((dev) && (dev)->ipc_log) \
ipc_log_string((dev)->ipc_log, "%s: " fmt, __func__, arg); \
if (msm_pcie_debug_mask) \
pr_alert("%s: " fmt, __func__, arg); \
} while (0)

#define PCIE_DBG2(dev, fmt, arg...) do { \
if ((dev) && (dev)->ipc_log) \
ipc_log_string((dev)->ipc_log, "DBG2:%s: " fmt, __func__, arg);\
if (msm_pcie_debug_mask) \
pr_alert("%s: " fmt, __func__, arg); \
} while (0)

#define PCIE_DBG3(dev, fmt, arg...) do { \
if ((dev) && (dev)->ipc_log) \
ipc_log_string((dev)->ipc_log, "DBG3:%s: " fmt, __func__, arg);\
if (msm_pcie_debug_mask) \
pr_alert("%s: " fmt, __func__, arg); \
} while (0)

#define PCIE_DUMP(dev, fmt, arg...) do { \
if ((dev) && (dev)->ipc_log_dump) \
ipc_log_string((dev)->ipc_log_dump, \
"DUMP:%s: " fmt, __func__, arg); \
} while (0)
#define PCIE_DUMP(dev, fmt, arg...) ((void)0)

#define PCIE_DBG_FS(dev, fmt, arg...) do { \
if ((dev) && (dev)->ipc_log_dump) \
ipc_log_string((dev)->ipc_log_dump, \
"DBG_FS:%s: " fmt, __func__, arg); \
pr_alert("%s: " fmt, __func__, arg); \
} while (0)

#define PCIE_INFO(dev, fmt, arg...) do { \
if ((dev) && (dev)->ipc_log_long) \
ipc_log_string((dev)->ipc_log_long, \
"INFO:%s: " fmt, __func__, arg); \
if ((dev) && (dev)->ipc_log) \
ipc_log_string((dev)->ipc_log, "%s: " fmt, __func__, arg); \
pr_info("%s: " fmt, __func__, arg); \
} while (0)

#define PCIE_ERR(dev, fmt, arg...) do { \
if ((dev) && (dev)->ipc_log_long) \
ipc_log_string((dev)->ipc_log_long, \
"ERR:%s: " fmt, __func__, arg); \
if ((dev) && (dev)->ipc_log) \
ipc_log_string((dev)->ipc_log, "%s: " fmt, __func__, arg); \
pr_err("%s: " fmt, __func__, arg); \
} while (0)

Expand Down
21 changes: 0 additions & 21 deletions drivers/platform/msm/ep_pcie/ep_pcie_com.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,48 +181,27 @@
} while (0)

#define EP_PCIE_DBG(dev, fmt, arg...) do { \
if ((dev)->ipc_log_ful) \
ipc_log_string((dev)->ipc_log_ful, "%s: " fmt, __func__, arg); \
if (ep_pcie_get_debug_mask()) \
pr_alert("%s: " fmt, __func__, arg); \
} while (0)

#define EP_PCIE_DBG2(dev, fmt, arg...) do { \
if ((dev)->ipc_log_sel) \
ipc_log_string((dev)->ipc_log_sel, \
"DBG1:%s: " fmt, __func__, arg); \
if ((dev)->ipc_log_ful) \
ipc_log_string((dev)->ipc_log_ful, \
"DBG2:%s: " fmt, __func__, arg); \
if (ep_pcie_get_debug_mask()) \
pr_alert("%s: " fmt, __func__, arg); \
} while (0)

#define EP_PCIE_DBG_FS(fmt, arg...) pr_alert("%s: " fmt, __func__, arg)

#define EP_PCIE_DUMP(dev, fmt, arg...) do { \
if ((dev)->ipc_log_dump) \
ipc_log_string((dev)->ipc_log_dump, \
"DUMP:%s: " fmt, __func__, arg); \
if (ep_pcie_get_debug_mask()) \
pr_alert("%s: " fmt, __func__, arg); \
} while (0)

#define EP_PCIE_INFO(dev, fmt, arg...) do { \
if ((dev)->ipc_log_sel) \
ipc_log_string((dev)->ipc_log_sel, \
"INFO:%s: " fmt, __func__, arg); \
if ((dev)->ipc_log_ful) \
ipc_log_string((dev)->ipc_log_ful, "%s: " fmt, __func__, arg); \
pr_info("%s: " fmt, __func__, arg); \
} while (0)

#define EP_PCIE_ERR(dev, fmt, arg...) do { \
if ((dev)->ipc_log_sel) \
ipc_log_string((dev)->ipc_log_sel, \
"ERR:%s: " fmt, __func__, arg); \
if ((dev)->ipc_log_ful) \
ipc_log_string((dev)->ipc_log_ful, "%s: " fmt, __func__, arg); \
pr_err("%s: " fmt, __func__, arg); \
} while (0)

Expand Down
7 changes: 1 addition & 6 deletions drivers/platform/msm/gsi/gsi.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,7 @@
#define gsi_readl(c) ({ u32 __v = readl_relaxed(c); __iormb(); __v; })
#define gsi_writel(v, c) ({ __iowmb(); writel_relaxed((v), (c)); })

#define GSI_IPC_LOGGING(buf, fmt, args...) \
do { \
if (buf) \
ipc_log_string((buf), fmt, __func__, __LINE__, \
## args); \
} while (0)
#define GSI_IPC_LOGGING(buf, fmt, args...) ((void)0)

#define GSIDBG(fmt, args...) \
do { \
Expand Down
7 changes: 1 addition & 6 deletions drivers/platform/msm/ipa/ipa_common_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -347,12 +347,7 @@ struct ipa_hdr_offset_entry {

extern const char *ipa_clients_strings[];

#define IPA_IPC_LOGGING(buf, fmt, args...) \
do { \
if (buf) \
ipc_log_string((buf), fmt, __func__, __LINE__, \
## args); \
} while (0)
#define IPA_IPC_LOGGING(buf, fmt, args...) ((void)0)

void ipa_inc_client_enable_clks(struct ipa_active_client_logging_info *id);
void ipa_dec_client_disable_clks(struct ipa_active_client_logging_info *id);
Expand Down
4 changes: 0 additions & 4 deletions drivers/platform/msm/mhi_dev/mhi.h
Original file line number Diff line number Diff line change
Expand Up @@ -615,10 +615,6 @@ extern void *mhi_ipc_log;
if (_msg_lvl >= mhi_msg_lvl) { \
pr_err("[%s] "_msg, __func__, ##__VA_ARGS__); \
} \
if (mhi_ipc_log && (_msg_lvl >= mhi_ipc_msg_lvl)) { \
ipc_log_string(mhi_ipc_log, \
"[0x%x %s] " _msg, bhi_imgtxdb, __func__, ##__VA_ARGS__); \
} \
} while (0)


Expand Down
8 changes: 3 additions & 5 deletions drivers/platform/msm/mhi_dev/mhi_dev_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,6 @@ struct mhi_dev_net_chan_attr {
if (_msg_lvl >= mhi_net_msg_lvl) { \
pr_err("[%s] "_msg, __func__, ##__VA_ARGS__); \
} \
if (mhi_net_ipc_log && (_msg_lvl >= mhi_net_ipc_log_lvl)) { \
ipc_log_string(mhi_net_ipc_log, \
"[%s] " _msg, __func__, ##__VA_ARGS__); \
} \
} while (0)

module_param(mhi_net_msg_lvl, uint, 0644);
Expand Down Expand Up @@ -611,7 +607,9 @@ static int mhi_dev_net_close(void)
}
/* freeing mhi client and IPC context */
kfree(client);
kfree(mhi_net_ipc_log);
if (mhi_net_ipc_log)
kfree(mhi_net_ipc_log);

return 0;
}

Expand Down
4 changes: 0 additions & 4 deletions drivers/platform/msm/mhi_dev/mhi_uci.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,10 +376,6 @@ struct mhi_uci_ctxt_t {
if (_msg_lvl >= mhi_uci_msg_lvl) { \
pr_err("[%s] "_msg, __func__, ##__VA_ARGS__); \
} \
if (mhi_uci_ipc_log && (_msg_lvl >= mhi_uci_ipc_log_lvl)) { \
ipc_log_string(mhi_uci_ipc_log, \
"[%s] " _msg, __func__, ##__VA_ARGS__); \
} \
} while (0)


Expand Down
45 changes: 1 addition & 44 deletions drivers/platform/msm/sps/spsi.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,33 +117,8 @@ extern u8 logging_option;
extern u8 debug_level_option;
extern u8 print_limit_option;

#define SPS_IPC(idx, dev, msg, args...) do { \
if (dev) { \
if ((idx == 0) && (dev)->ipc_log0) \
ipc_log_string((dev)->ipc_log0, \
"%s: " msg, __func__, args); \
else if ((idx == 1) && (dev)->ipc_log1) \
ipc_log_string((dev)->ipc_log1, \
"%s: " msg, __func__, args); \
else if ((idx == 2) && (dev)->ipc_log2) \
ipc_log_string((dev)->ipc_log2, \
"%s: " msg, __func__, args); \
else if ((idx == 3) && (dev)->ipc_log3) \
ipc_log_string((dev)->ipc_log3, \
"%s: " msg, __func__, args); \
else if ((idx == 4) && (dev)->ipc_log4) \
ipc_log_string((dev)->ipc_log4, \
"%s: " msg, __func__, args); \
else \
pr_debug("sps: no such IPC logging index!\n"); \
} \
} while (0)
#define SPS_DUMP(msg, args...) do { \
SPS_IPC(4, sps, msg, args); \
if (sps) { \
if (sps->ipc_log4 == NULL) \
pr_info(msg, ##args); \
} \
pr_info(msg, ##args); \
} while (0)
#define SPS_ERR(dev, msg, args...) do { \
if (logging_option != 1) { \
Expand All @@ -152,7 +127,6 @@ extern u8 print_limit_option;
else \
pr_err(msg, ##args); \
} \
SPS_IPC(3, dev, msg, args); \
} while (0)
#define SPS_INFO(dev, msg, args...) do { \
if (logging_option != 1) { \
Expand All @@ -161,7 +135,6 @@ extern u8 print_limit_option;
else \
pr_info(msg, ##args); \
} \
SPS_IPC(3, dev, msg, args); \
} while (0)
#define SPS_DBG(dev, msg, args...) do { \
if ((unlikely(logging_option > 1)) \
Expand All @@ -172,10 +145,6 @@ extern u8 print_limit_option;
pr_info(msg, ##args); \
} else \
pr_debug(msg, ##args); \
if (dev) { \
if ((dev)->ipc_loglevel <= 0) \
SPS_IPC(0, dev, msg, args); \
} \
} while (0)
#define SPS_DBG1(dev, msg, args...) do { \
if ((unlikely(logging_option > 1)) \
Expand All @@ -186,10 +155,6 @@ extern u8 print_limit_option;
pr_info(msg, ##args); \
} else \
pr_debug(msg, ##args); \
if (dev) { \
if ((dev)->ipc_loglevel <= 1) \
SPS_IPC(1, dev, msg, args); \
} \
} while (0)
#define SPS_DBG2(dev, msg, args...) do { \
if ((unlikely(logging_option > 1)) \
Expand All @@ -200,10 +165,6 @@ extern u8 print_limit_option;
pr_info(msg, ##args); \
} else \
pr_debug(msg, ##args); \
if (dev) { \
if ((dev)->ipc_loglevel <= 2) \
SPS_IPC(2, dev, msg, args); \
} \
} while (0)
#define SPS_DBG3(dev, msg, args...) do { \
if ((unlikely(logging_option > 1)) \
Expand All @@ -214,10 +175,6 @@ extern u8 print_limit_option;
pr_info(msg, ##args); \
} else \
pr_debug(msg, ##args); \
if (dev) { \
if ((dev)->ipc_loglevel <= 3) \
SPS_IPC(3, dev, msg, args); \
} \
} while (0)
#else
#define SPS_DBG3(x...) pr_debug(x)
Expand Down
Loading

0 comments on commit 93f42b6

Please sign in to comment.