Skip to content

Commit

Permalink
staging: prima: Fix non-debug build and switch to it
Browse files Browse the repository at this point in the history
Enable the forward declaration of debug functions in non-debug
builds and disable a piece of code used only to print some info.
-Wno-unused-variable is now required because of all the variables
used in debug functions that aren't left out in non-debug builds.

Change-Id: I7069f8859e4965ee82ce65c29c35349c887fd673
  • Loading branch information
Gabriele M authored and mikeNG committed Jun 2, 2017
1 parent d6ba030 commit dc256c2
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 10 deletions.
2 changes: 2 additions & 0 deletions drivers/staging/prima/CORE/HDD/src/wlan_hdd_wext.c
Original file line number Diff line number Diff line change
Expand Up @@ -7065,6 +7065,7 @@ static int __iw_get_char_setnone(struct net_device *dev,
*And currently it only checks P2P_CLIENT adapter.
*P2P_DEVICE and P2P_GO have not been added as of now.
*/
#ifdef TRACE_RECORD
case WE_GET_STATES:
{
int buf = 0, len = 0;
Expand Down Expand Up @@ -7201,6 +7202,7 @@ static int __iw_get_char_setnone(struct net_device *dev,
wrqu->data.length = strlen(extra)+1;
break;
}
#endif

case WE_GET_CFG:
{
Expand Down
5 changes: 0 additions & 5 deletions drivers/staging/prima/CORE/MAC/inc/macTrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@

#include "aniGlobal.h"


#ifdef TRACE_RECORD

#define MAC_TRACE_GET_MODULE_ID(data) ((data >> 8) & 0xff)
#define MAC_TRACE_GET_MSG_ID(data) (data & 0xffff)

Expand Down Expand Up @@ -80,5 +77,3 @@ tANI_U8* macTraceGetTLState(tANI_U16 tlState);

#endif

#endif

2 changes: 1 addition & 1 deletion drivers/staging/prima/CORE/MAC/src/pe/lim/limApi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1063,8 +1063,8 @@ tSirRetStatus peOpen(tpAniSirGlobal pMac, tMacOpenParameters *pMacOpenParam)
*/
#ifdef LIM_TRACE_RECORD
MTRACE(limTraceInit(pMac));
#endif
lim_register_debug_callback();
#endif
return eSIR_SUCCESS;
}

Expand Down
5 changes: 5 additions & 0 deletions drivers/staging/prima/CORE/SME/inc/smsDebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,15 @@
#define __printf(a,b)
#endif

#ifdef WLAN_DEBUG
void __printf(3,4)
smsLog(tpAniSirGlobal pMac, tANI_U32 loglevel, const char *pString, ...);

void __printf(3,4)
pmcLog(tpAniSirGlobal pMac, tANI_U32 loglevel, const char *pString, ...);
#else
#define smsLog(arg...)
#define pmcLog(arg...)
#endif

#endif // __SMS_DEBUG_H__
6 changes: 4 additions & 2 deletions drivers/staging/prima/CORE/SME/src/sme_common/sme_Api.c
Original file line number Diff line number Diff line change
Expand Up @@ -1439,7 +1439,9 @@ eHalStatus sme_Open(tHalHandle hHal)
#endif
sme_p2pOpen(pMac);
smeTraceInit(pMac);
#ifdef SME_TRACE_RECORD
sme_register_debug_callback();
#endif

}while (0);

Expand Down Expand Up @@ -6674,6 +6676,7 @@ VOS_STATUS sme_DbgWriteMemory(tHalHandle hHal, v_U32_t memAddr, v_U8_t *pBuf, v_
}


#ifdef WLAN_DEBUG
void pmcLog(tpAniSirGlobal pMac, tANI_U32 loglevel, const char *pString, ...)
{
VOS_TRACE_LEVEL vosDebugLevel;
Expand All @@ -6694,7 +6697,6 @@ void pmcLog(tpAniSirGlobal pMac, tANI_U32 loglevel, const char *pString, ...)

void smsLog(tpAniSirGlobal pMac, tANI_U32 loglevel, const char *pString,...)
{
#ifdef WLAN_DEBUG
// Verify against current log level
if ( loglevel > pMac->utils.gLogDbgLevel[LOG_INDEX_FOR_MODULE( SIR_SMS_MODULE_ID )] )
return;
Expand All @@ -6708,8 +6710,8 @@ void smsLog(tpAniSirGlobal pMac, tANI_U32 loglevel, const char *pString,...)

va_end( marker ); /* Reset variable arguments. */
}
#endif
}
#endif

/* ---------------------------------------------------------------------------
\fn sme_GetWcnssWlanCompiledVersion
Expand Down
1 change: 1 addition & 0 deletions drivers/staging/prima/CORE/VOSS/inc/vos_trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ typedef enum

#else
#define MTRACE(p) { }
#define CASE_RETURN_STRING( str ) { }

#endif

Expand Down
4 changes: 2 additions & 2 deletions drivers/staging/prima/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ CONFIG_QCOM_ESE_UPLOAD := n
# Feature flags which are not (currently) configurable via Kconfig

#Whether to build debug version
BUILD_DEBUG_VERSION := 1
BUILD_DEBUG_VERSION := 0

#Enable this flag to build driver in diag version
BUILD_DIAG_VERSION := 1
Expand Down Expand Up @@ -673,7 +673,7 @@ CDEFINES += -DEXISTS_MSM_SMSM
endif

# Fix build for GCC 4.7
EXTRA_CFLAGS += -Wno-maybe-uninitialized -Wno-unused-function
EXTRA_CFLAGS += -Wno-maybe-uninitialized -Wno-unused-function -Wno-unused-variable

ifeq ($(CONFIG_WLAN_OFFLOAD_PACKETS),y)
CDEFINES += -DWLAN_FEATURE_OFFLOAD_PACKETS
Expand Down

0 comments on commit dc256c2

Please sign in to comment.