qcacmn: Fix compliation error when disable CONFIG_LEAK_DETECTION

Fix error when disable CONFIG_LEAK_DETECTION.

Change-Id: I16d85b596ef64ad45e9fb0bb594b0a3287554e8f
CRs-Fixed: 3080460
This commit is contained in:
Jingxiang Ge
2021-11-23 14:17:41 +08:00
committed by Madan Koyyalamudi
parent 823c259075
commit 2ed71bd979
4 changed files with 49 additions and 3 deletions

View File

@@ -1,5 +1,7 @@
/* /*
* Copyright (c) 2019 The Linux Foundation. All rights reserved. * Copyright (c) 2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
*
* *
* Permission to use, copy, modify, and/or distribute this software for * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -60,6 +62,7 @@ struct qdf_tracker name = { \
.ht = qdf_ptr_hash_ptr(name ## _ht), \ .ht = qdf_ptr_hash_ptr(name ## _ht), \
} }
#ifdef CONFIG_LEAK_DETECTION
/** /**
* qdf_tracker_init() - initialize a qdf_tracker * qdf_tracker_init() - initialize a qdf_tracker
* @tracker: the qdf_tracker to initialize * @tracker: the qdf_tracker to initialize
@@ -125,6 +128,42 @@ qdf_must_check bool
qdf_tracker_lookup(struct qdf_tracker *tracker, void *ptr, qdf_tracker_lookup(struct qdf_tracker *tracker, void *ptr,
char (*out_func)[QDF_TRACKER_FUNC_SIZE], char (*out_func)[QDF_TRACKER_FUNC_SIZE],
uint32_t *out_line); uint32_t *out_line);
#else
static inline
void qdf_tracker_init(struct qdf_tracker *tracker)
{
}
static inline
void qdf_tracker_deinit(struct qdf_tracker *tracker)
{
}
static inline qdf_must_check QDF_STATUS
qdf_tracker_track(struct qdf_tracker *tracker, void *ptr,
const char *func, uint32_t line)
{
return QDF_STATUS_SUCCESS;
}
static inline
void qdf_tracker_untrack(struct qdf_tracker *tracker, void *ptr,
const char *func, uint32_t line)
{
}
static inline
void qdf_tracker_check_for_leaks(struct qdf_tracker *tracker)
{
}
static inline qdf_must_check bool
qdf_tracker_lookup(struct qdf_tracker *tracker, void *ptr,
char (*out_func)[QDF_TRACKER_FUNC_SIZE],
uint32_t *out_line)
{
return false;
}
#endif
#endif /* __QDF_TRACKER_H */ #endif /* __QDF_TRACKER_H */

View File

@@ -1,5 +1,6 @@
/* /*
* Copyright (c) 2019, 2021 The Linux Foundation. All rights reserved. * Copyright (c) 2019, 2021 The Linux Foundation. All rights reserved.
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
* *
* Permission to use, copy, modify, and/or distribute this software for * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -26,6 +27,7 @@
#include "qdf_tracker.h" #include "qdf_tracker.h"
#include "qdf_types.h" #include "qdf_types.h"
#ifdef CONFIG_LEAK_DETECTION
struct qdf_tracker_node { struct qdf_tracker_node {
struct qdf_ptr_hash_entry entry; struct qdf_ptr_hash_entry entry;
enum qdf_debug_domain domain; enum qdf_debug_domain domain;
@@ -186,4 +188,4 @@ bool qdf_tracker_lookup(struct qdf_tracker *tracker, void *ptr,
return !!node; return !!node;
} }
#endif

View File

@@ -1,5 +1,7 @@
/* /*
* Copyright (c) 2019 The Linux Foundation. All rights reserved. * Copyright (c) 2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
*
* *
* Permission to use, copy, modify, and/or distribute this software for * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -21,6 +23,7 @@
#include "qdf_trace.h" #include "qdf_trace.h"
#include "qdf_types.h" #include "qdf_types.h"
#if defined(CONFIG_LEAK_DETECTION) && defined(WLAN_TRACKER_TEST)
#define qdf_ut_tracker_bits 4 /* 16 buckets */ #define qdf_ut_tracker_bits 4 /* 16 buckets */
#define qdf_ut_tracker_item_count 3 #define qdf_ut_tracker_item_count 3
#define qdf_ut_tracker_declare(name) \ #define qdf_ut_tracker_declare(name) \
@@ -92,4 +95,4 @@ uint32_t qdf_tracker_unit_test(void)
return errors; return errors;
} }
#endif

View File

@@ -1,5 +1,7 @@
/* /*
* Copyright (c) 2019 The Linux Foundation. All rights reserved. * Copyright (c) 2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
*
* *
* Permission to use, copy, modify, and/or distribute this software for * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -19,7 +21,7 @@
#ifndef __QDF_TRACKER_TEST #ifndef __QDF_TRACKER_TEST
#define __QDF_TRACKER_TEST #define __QDF_TRACKER_TEST
#ifdef WLAN_TRACKER_TEST #if defined(CONFIG_LEAK_DETECTION) && defined(WLAN_TRACKER_TEST)
/** /**
* qdf_tracker_unit_test() - run the qdf tracker unit test suite * qdf_tracker_unit_test() - run the qdf tracker unit test suite
* *