From 828ddeb6144bf75992262d2ea320daf6b1bf25c6 Mon Sep 17 00:00:00 2001 From: Dustin Brown Date: Wed, 11 Jul 2018 10:19:34 -0700 Subject: [PATCH] qcacmn: Add QDF_DEBUG_PANIC_FL macro For logic that builds on top of QDF_DEBUG_PANIC(), it would be useful to be able to specify function and line number explicitly. Add QDF_DEBUG_PANIC_FL(), which is QDF_DEBUG_PANIC with explicit function and line number parameters. Change-Id: Idc79f2fb0e769930167766f21a54a82c4b7ff40a CRs-Fixed: 2276964 --- qdf/linux/src/i_qdf_trace.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/qdf/linux/src/i_qdf_trace.h b/qdf/linux/src/i_qdf_trace.h index 0c71acfcf3e4..99ae039a20b5 100644 --- a/qdf/linux/src/i_qdf_trace.h +++ b/qdf/linux/src/i_qdf_trace.h @@ -235,12 +235,21 @@ static inline void __qdf_bug(void) * * Return: None */ -#define QDF_DEBUG_PANIC(reason...) __QDF_DEBUG_PANIC("" reason) +#define QDF_DEBUG_PANIC(reason...) \ + QDF_DEBUG_PANIC_FL(__func__, __LINE__, "" reason) -#define __QDF_DEBUG_PANIC(ftm, args...) \ +/** + * QDF_DEBUG_PANIC_FL() - In debug builds, panic, otherwise do nothing + * @func: origin function name to be logged + * @line: origin line number to be logged + * @fmt: printf compatible format string to be logged + * @args: zero or more printf compatible logging arguments + * + * Return: None + */ +#define QDF_DEBUG_PANIC_FL(func, line, fmt, args...) \ do { \ - pr_err("WLAN Panic @ %s:%d: " ftm "\n", \ - __func__, __LINE__, ##args); \ + pr_err("WLAN Panic @ %s:%d: " fmt "\n", func, line, ##args); \ __qdf_bug(); \ } while (false)