summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNishank Aggarwal <naggar@codeaurora.org>2017-04-03 12:53:24 +0530
committerSandeep Puligilla <spuligil@codeaurora.org>2017-04-06 14:10:56 -0700
commit122872deb4116aff49e76dd37702d55340a5534f (patch)
treef2f317b4da6a93bdcb01a742863808e27e732a2a
parent955cb2458a5fb60dc21810e90fda7b14f0d2e2bd (diff)
qcacld-3.0: Fix kernel checkpatch warnings in csr_link_list.c
Fix kernel checkpatch warnings in csr_link_list.c Change-Id: I05ae3798dae5cbe3bc602aa3e99762303c1e12f3 CRs-Fixed: 2025503
-rw-r--r--core/sme/src/csr/csr_link_list.c137
1 files changed, 55 insertions, 82 deletions
diff --git a/core/sme/src/csr/csr_link_list.c b/core/sme/src/csr/csr_link_list.c
index 8f5e8570e636..a51014f9ec2f 100644
--- a/core/sme/src/csr/csr_link_list.c
+++ b/core/sme/src/csr/csr_link_list.c
@@ -25,13 +25,11 @@
* to the Linux Foundation.
*/
-/** ------------------------------------------------------------------------- *
- ------------------------------------------------------------------------- *
- \file csr_link_list.c
-
- Implementation for the Common link list interfaces.
- ========================================================================== */
-
+/*
+ * DOC: csr_link_list.c
+ *
+ * Implementation for the Common link list interfaces.
+ */
#include "csr_link_list.h"
#include "qdf_lock.h"
#include "qdf_mem.h"
@@ -106,6 +104,7 @@ static inline void csr_list_insert_head(tListElem *pHead, tListElem *pEntry)
static void csr_list_insert_entry(tListElem *pEntry, tListElem *pNewEntry)
{
tListElem *pLast;
+
if (!pEntry) {
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
"%s: Error!! pEntry is Null", __func__);
@@ -129,9 +128,8 @@ uint32_t csr_ll_count(tDblLinkList *pList)
return c;
}
- if (pList && (LIST_FLAG_OPEN == pList->Flag)) {
+ if (pList && (LIST_FLAG_OPEN == pList->Flag))
c = pList->Count;
- }
return c;
}
@@ -145,9 +143,8 @@ void csr_ll_lock(tDblLinkList *pList)
return;
}
- if (LIST_FLAG_OPEN == pList->Flag) {
+ if (LIST_FLAG_OPEN == pList->Flag)
qdf_mutex_acquire(&pList->Lock);
- }
}
void csr_ll_unlock(tDblLinkList *pList)
@@ -159,9 +156,8 @@ void csr_ll_unlock(tDblLinkList *pList)
return;
}
- if (LIST_FLAG_OPEN == pList->Flag) {
+ if (LIST_FLAG_OPEN == pList->Flag)
qdf_mutex_release(&pList->Lock);
- }
}
bool csr_ll_is_list_empty(tDblLinkList *pList, bool fInterlocked)
@@ -175,15 +171,13 @@ bool csr_ll_is_list_empty(tDblLinkList *pList, bool fInterlocked)
}
if (LIST_FLAG_OPEN == pList->Flag) {
- if (fInterlocked) {
+ if (fInterlocked)
csr_ll_lock(pList);
- }
fEmpty = csrIsListEmpty(&pList->ListHead);
- if (fInterlocked) {
+ if (fInterlocked)
csr_ll_unlock(pList);
- }
}
return fEmpty;
}
@@ -202,8 +196,9 @@ bool csr_ll_find_entry(tDblLinkList *pList, tListElem *pEntryToFind)
if (LIST_FLAG_OPEN == pList->Flag) {
pEntry = csr_ll_peek_head(pList, LL_ACCESS_NOLOCK);
- /* Have to make sure we don't loop back to the head of the list, which will */
- /* happen if the entry is NOT on the list... */
+ /* Have to make sure we don't loop back to the head of the list,
+ * which will happen if the entry is NOT on the list.
+ */
while (pEntry && (pEntry != &pList->ListHead)) {
if (pEntry == pEntryToFind) {
@@ -237,9 +232,8 @@ QDF_STATUS csr_ll_open(tHddHandle hHdd, tDblLinkList *pList)
csr_list_init(&pList->ListHead);
pList->Flag = LIST_FLAG_OPEN;
pList->hHdd = hHdd;
- } else {
+ } else
status = QDF_STATUS_E_FAILURE;
- }
}
return status;
}
@@ -270,14 +264,13 @@ void csr_ll_insert_tail(tDblLinkList *pList, tListElem *pEntry,
}
if (LIST_FLAG_OPEN == pList->Flag) {
- if (fInterlocked) {
+ if (fInterlocked)
csr_ll_lock(pList);
- }
+
csr_list_insert_tail(&pList->ListHead, pEntry);
pList->Count++;
- if (fInterlocked) {
+ if (fInterlocked)
csr_ll_unlock(pList);
- }
}
}
@@ -292,19 +285,18 @@ void csr_ll_insert_head(tDblLinkList *pList, tListElem *pEntry,
}
if (LIST_FLAG_OPEN == pList->Flag) {
- if (fInterlocked) {
+ if (fInterlocked)
csr_ll_lock(pList);
- }
+
csr_list_insert_head(&pList->ListHead, pEntry);
pList->Count++;
- if (fInterlocked) {
+ if (fInterlocked)
csr_ll_unlock(pList);
- }
- if (pList->cmdTimeoutTimer && pList->cmdTimeoutDuration) {
+
+ if (pList->cmdTimeoutTimer && pList->cmdTimeoutDuration)
/* timer to detect pending command in activelist */
qdf_mc_timer_start(pList->cmdTimeoutTimer,
pList->cmdTimeoutDuration);
- }
}
}
@@ -318,14 +310,13 @@ void csr_ll_insert_entry(tDblLinkList *pList, tListElem *pEntry,
}
if (LIST_FLAG_OPEN == pList->Flag) {
- if (fInterlocked) {
+ if (fInterlocked)
csr_ll_lock(pList);
- }
+
csr_list_insert_entry(pEntry, pNewEntry);
pList->Count++;
- if (fInterlocked) {
+ if (fInterlocked)
csr_ll_unlock(pList);
- }
}
}
@@ -340,18 +331,15 @@ tListElem *csr_ll_remove_tail(tDblLinkList *pList, bool fInterlocked)
}
if (LIST_FLAG_OPEN == pList->Flag) {
- if (fInterlocked) {
+ if (fInterlocked)
csr_ll_lock(pList);
- }
if (!csrIsListEmpty(&pList->ListHead)) {
-
pEntry = csr_list_remove_tail(&pList->ListHead);
pList->Count--;
}
- if (fInterlocked) {
+ if (fInterlocked)
csr_ll_unlock(pList);
- }
}
return pEntry;
@@ -368,16 +356,14 @@ tListElem *csr_ll_peek_tail(tDblLinkList *pList, bool fInterlocked)
}
if (LIST_FLAG_OPEN == pList->Flag) {
- if (fInterlocked) {
+ if (fInterlocked)
csr_ll_lock(pList);
- }
- if (!csrIsListEmpty(&pList->ListHead)) {
+ if (!csrIsListEmpty(&pList->ListHead))
pEntry = pList->ListHead.last;
- }
- if (fInterlocked) {
+
+ if (fInterlocked)
csr_ll_unlock(pList);
- }
}
return pEntry;
@@ -394,18 +380,16 @@ tListElem *csr_ll_remove_head(tDblLinkList *pList, bool fInterlocked)
}
if (LIST_FLAG_OPEN == pList->Flag) {
- if (fInterlocked) {
+ if (fInterlocked)
csr_ll_lock(pList);
- }
if (!csrIsListEmpty(&pList->ListHead)) {
pEntry = csr_list_remove_head(&pList->ListHead);
pList->Count--;
}
- if (fInterlocked) {
+ if (fInterlocked)
csr_ll_unlock(pList);
- }
}
return pEntry;
@@ -422,16 +406,14 @@ tListElem *csr_ll_peek_head(tDblLinkList *pList, bool fInterlocked)
}
if (LIST_FLAG_OPEN == pList->Flag) {
- if (fInterlocked) {
+ if (fInterlocked)
csr_ll_lock(pList);
- }
- if (!csrIsListEmpty(&pList->ListHead)) {
+ if (!csrIsListEmpty(&pList->ListHead))
pEntry = pList->ListHead.next;
- }
- if (fInterlocked) {
+
+ if (fInterlocked)
csr_ll_unlock(pList);
- }
}
return pEntry;
@@ -448,16 +430,14 @@ void csr_ll_purge(tDblLinkList *pList, bool fInterlocked)
}
if (LIST_FLAG_OPEN == pList->Flag) {
- if (fInterlocked) {
+ if (fInterlocked)
csr_ll_lock(pList);
- }
- while ((pEntry = csr_ll_remove_head(pList, LL_ACCESS_NOLOCK))) {
+
+ while ((pEntry = csr_ll_remove_head(pList, LL_ACCESS_NOLOCK)))
/* just remove everything from the list until */
/* nothing left on the list. */
- }
- if (fInterlocked) {
+ if (fInterlocked)
csr_ll_unlock(pList);
- }
}
}
@@ -474,14 +454,14 @@ bool csr_ll_remove_entry(tDblLinkList *pList, tListElem *pEntryToRemove,
}
if (LIST_FLAG_OPEN == pList->Flag) {
- if (fInterlocked) {
+ if (fInterlocked)
csr_ll_lock(pList);
- }
pEntry = csr_ll_peek_head(pList, LL_ACCESS_NOLOCK);
- /* Have to make sure we don't loop back to the head of the list, which will */
- /* happen if the entry is NOT on the list... */
+ /* Have to make sure we don't loop back to the head of the
+ * list, which will happen if the entry is NOT on the list.
+ */
while (pEntry && (pEntry != &pList->ListHead)) {
if (pEntry == pEntryToRemove) {
csr_list_remove_entry(pEntry);
@@ -493,12 +473,11 @@ bool csr_ll_remove_entry(tDblLinkList *pList, tListElem *pEntryToRemove,
pEntry = pEntry->next;
}
- if (fInterlocked) {
+ if (fInterlocked)
csr_ll_unlock(pList);
- }
- if (pList->cmdTimeoutTimer) {
+
+ if (pList->cmdTimeoutTimer)
qdf_mc_timer_stop(pList->cmdTimeoutTimer);
- }
}
return fFound;
@@ -516,22 +495,19 @@ tListElem *csr_ll_next(tDblLinkList *pList, tListElem *pEntry,
}
if (LIST_FLAG_OPEN == pList->Flag) {
- if (fInterlocked) {
+ if (fInterlocked)
csr_ll_lock(pList);
- }
if (!csrIsListEmpty(&pList->ListHead)
&& csr_ll_find_entry(pList, pEntry)) {
pNextEntry = pEntry->next;
/* Make sure we don't walk past the head */
- if (pNextEntry == &pList->ListHead) {
+ if (pNextEntry == &pList->ListHead)
pNextEntry = NULL;
- }
}
- if (fInterlocked) {
+ if (fInterlocked)
csr_ll_unlock(pList);
- }
}
return pNextEntry;
@@ -549,22 +525,19 @@ tListElem *csr_ll_previous(tDblLinkList *pList, tListElem *pEntry,
}
if (LIST_FLAG_OPEN == pList->Flag) {
- if (fInterlocked) {
+ if (fInterlocked)
csr_ll_lock(pList);
- }
if (!csrIsListEmpty(&pList->ListHead)
&& csr_ll_find_entry(pList, pEntry)) {
pNextEntry = pEntry->last;
/* Make sure we don't walk past the head */
- if (pNextEntry == &pList->ListHead) {
+ if (pNextEntry == &pList->ListHead)
pNextEntry = NULL;
- }
}
- if (fInterlocked) {
+ if (fInterlocked)
csr_ll_unlock(pList);
- }
}
return pNextEntry;