Ver código fonte

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
Dustin Brown 6 anos atrás
pai
commit
828ddeb614
1 arquivos alterados com 13 adições e 4 exclusões
  1. 13 4
      qdf/linux/src/i_qdf_trace.h

+ 13 - 4
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)