summaryrefslogtreecommitdiffstats
path: root/lib/4a-hal-utilities/4a-hal-utilities-data.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/4a-hal-utilities/4a-hal-utilities-data.c')
-rw-r--r--lib/4a-hal-utilities/4a-hal-utilities-data.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/lib/4a-hal-utilities/4a-hal-utilities-data.c b/lib/4a-hal-utilities/4a-hal-utilities-data.c
index 314190f..26bbd23 100644
--- a/lib/4a-hal-utilities/4a-hal-utilities-data.c
+++ b/lib/4a-hal-utilities/4a-hal-utilities-data.c
@@ -96,16 +96,14 @@ int8_t HalUtlRemoveSelectedMixerData(struct InternalHalMixerData **mixerDataList
int64_t HalUtlRemoveAllMixerData(struct InternalHalMixerData **mixerDataList)
{
- int8_t ret;
int64_t mixerDataRemoved = 0;
if(! mixerDataList)
return -1;
while(*mixerDataList) {
- ret = HalUtlRemoveSelectedMixerData(mixerDataList, *mixerDataList);
- if(ret)
- return (int64_t) ret;
+ if(HalUtlRemoveSelectedMixerData(mixerDataList, *mixerDataList))
+ return -2;
mixerDataRemoved++;
}
@@ -134,11 +132,10 @@ struct InternalHalMixerData *HalUtlSearchMixerDataByProperties(struct InternalHa
{
struct InternalHalMixerData *currentMixerData;
- if(! mixerDataList || ! verb)
+ if(! mixerDataList || ! *mixerDataList || ! verb)
return NULL;
currentMixerData = *mixerDataList;
-
while(currentMixerData) {
if((! strcmp(verb, currentMixerData->verb)) &&
(! strcmp(verbToCall, currentMixerData->verbToCall)) &&
@@ -152,7 +149,7 @@ struct InternalHalMixerData *HalUtlSearchMixerDataByProperties(struct InternalHa
}
/*******************************************************************************
- * Hal data handling functions *
+ * Hal data handling functions *
******************************************************************************/
struct HalData *HalUtlAddHalToHalList(struct HalData **halDataList)
@@ -233,16 +230,14 @@ int8_t HalUtlRemoveSelectedHalFromList(struct HalData **halDataList, struct HalD
int64_t HalUtlRemoveAllHalFromList(struct HalData **halDataList)
{
- int8_t ret;
int64_t halRemoved = 0;
if(! halDataList)
return -1;
while(*halDataList) {
- ret = HalUtlRemoveSelectedHalFromList(halDataList, *halDataList);
- if(ret)
- return (int64_t) ret;
+ if(HalUtlRemoveSelectedHalFromList(halDataList, *halDataList))
+ return -2;
halRemoved++;
}
@@ -259,7 +254,6 @@ int64_t HalUtlGetNumberOfHalInList(struct HalData **halDataList)
return -1;
currentHalData = *halDataList;
-
while(currentHalData) {
currentHalData = currentHalData->next;
numberOfHal++;
@@ -276,7 +270,6 @@ struct HalData *HalUtlSearchHalDataByApiName(struct HalData **halDataList, char
return NULL;
currentHalData = *halDataList;
-
while(currentHalData) {
if(! strcmp(apiName, currentHalData->apiName))
return currentHalData;
@@ -295,7 +288,6 @@ struct HalData *HalUtlSearchReadyHalDataByCardId(struct HalData **halDataList, i
return NULL;
currentHalData = *halDataList;
-
while(currentHalData) {
if(currentHalData->status == HAL_STATUS_READY && currentHalData->sndCardId == cardId)
return currentHalData;