OSDN Git Service

staging: qca-wifi-host-cmn: Featurize QDF_ASSERT
authorDustin Brown <dustinb@codeaurora.org>
Thu, 22 Mar 2018 19:40:00 +0000 (12:40 -0700)
committerArian <arian.kulmer@web.de>
Tue, 19 Nov 2019 14:32:09 +0000 (15:32 +0100)
QDF_ASSERT is not properly featurized with its own build time config
flag. This leads to unnecessary logs and increased driver size for
platforms which do not want the feature enabled. Use the newly
introduced WLAN_WARN_ON_ASSERT build time flag to decide if QDF_ASSERT
should be a no-op.

Change-Id: I39e3ab6499210569b6ce09d77ee72f0081741989
CRs-Fixed: 2211983

drivers/staging/qca-wifi-host-cmn/qdf/linux/src/i_qdf_trace.h

index 8b21cd7..1fafc1a 100644 (file)
@@ -83,6 +83,7 @@
 
 #ifdef QDF_ENABLE_TRACING
 
+#ifdef WLAN_WARN_ON_ASSERT
 #define QDF_ASSERT(_condition) \
        do { \
                if (!(_condition)) { \
                        WARN_ON(1); \
                } \
        } while (0)
+#else
+#define QDF_ASSERT(_condition) \
+       do { \
+               if (!(_condition)) { \
+                       /* no-op */ \
+               } \
+       } while (0)
+#endif /* WLAN_WARN_ON_ASSERT */
 
 #else