qcacmn: Add QDF_DEBUG_PANIC API
A very common pattern in the Wlan driver is to test for a fatal condition, and then call QDF_BUG with some falsy value. Add a sugar API for these cases, which effectively does 'QDF_BUG(false)'. Additionally, include 'debug' in the name to remind consumers that the panic will not occur on end user devices. Current syntax: if (fatal_condition) QDF_BUG(false); New syntax: if (fatal_condition) QDF_DEBUG_PANIC(); Change-Id: Ifa03e9109be5efdbd061ca32363d5719fb91da0f CRs-Fixed: 2191582
This commit is contained in:
@@ -117,9 +117,12 @@ static inline void qdf_trace_msg(QDF_MODULE_ID module, QDF_TRACE_LEVEL level,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PANIC_ON_BUG
|
#ifdef PANIC_ON_BUG
|
||||||
#define __qdf_do_bug() BUG_ON(1)
|
static inline void QDF_DEBUG_PANIC(void)
|
||||||
|
{
|
||||||
|
BUG();
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
#define __qdf_do_bug()
|
static inline void QDF_DEBUG_PANIC(void) { }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define QDF_BUG(_condition) \
|
#define QDF_BUG(_condition) \
|
||||||
@@ -127,7 +130,7 @@ static inline void qdf_trace_msg(QDF_MODULE_ID module, QDF_TRACE_LEVEL level,
|
|||||||
if (!(_condition)) { \
|
if (!(_condition)) { \
|
||||||
pr_err("QDF BUG in %s Line %d: Failed assertion '" \
|
pr_err("QDF BUG in %s Line %d: Failed assertion '" \
|
||||||
#_condition "'\n", __func__, __LINE__); \
|
#_condition "'\n", __func__, __LINE__); \
|
||||||
__qdf_do_bug();\
|
QDF_DEBUG_PANIC(); \
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2014-2017 The Linux Foundation. All rights reserved.
|
* Copyright (c) 2014-2018 The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
|
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
|
||||||
*
|
*
|
||||||
@@ -174,7 +174,7 @@ EXPORT_SYMBOL(qdf_mc_timer_manager_init);
|
|||||||
|
|
||||||
static inline void qdf_mc_timer_panic(void)
|
static inline void qdf_mc_timer_panic(void)
|
||||||
{
|
{
|
||||||
QDF_BUG(0);
|
QDF_DEBUG_PANIC();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void qdf_mc_timer_print_list(qdf_list_t *timers)
|
static void qdf_mc_timer_print_list(qdf_list_t *timers)
|
||||||
|
Reference in New Issue
Block a user