summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChih-Hung Hsieh <chh@google.com>2020-04-21 11:52:14 -0700
committerGeorge Chang <georgekgchang@google.com>2020-04-22 10:44:12 +0800
commit42574fdfa1783ff3b218a0b1a28a0fd4e8956898 (patch)
treedeb3041729a79fcc8b5e053540100ead9d6dde5a
parent2225c0cb3fd6386f9e9cf3a843fb417e455ef9d2 (diff)
downloadplatform_hardware_nxp_nfc-android11-mainline-media-release.tar.gz
platform_hardware_nxp_nfc-android11-mainline-media-release.tar.bz2
platform_hardware_nxp_nfc-android11-mainline-media-release.zip
Test: WITH_TIDY=1 make Bug: 154629561 Merged-In: Id8d8973aa66c4ef1553392411a523f00696fb466 Change-Id: Id8d8973aa66c4ef1553392411a523f00696fb466
-rwxr-xr-xhalimpl/tml/phDal4Nfc_messageQueueLib.cc2
-rw-r--r--halimpl/tml/phTmlNfc.cc2
-rw-r--r--halimpl/utils/phNxpNciHal_utils.cc8
3 files changed, 6 insertions, 6 deletions
diff --git a/halimpl/tml/phDal4Nfc_messageQueueLib.cc b/halimpl/tml/phDal4Nfc_messageQueueLib.cc
index f43774d..e3c70b8 100755
--- a/halimpl/tml/phDal4Nfc_messageQueueLib.cc
+++ b/halimpl/tml/phDal4Nfc_messageQueueLib.cc
@@ -59,7 +59,7 @@ intptr_t phDal4Nfc_msgget(key_t key, int msgflg) {
(phDal4Nfc_message_queue_t*)malloc(sizeof(phDal4Nfc_message_queue_t));
if (pQueue == NULL) return -1;
memset(pQueue, 0, sizeof(phDal4Nfc_message_queue_t));
- if (pthread_mutex_init(&pQueue->nCriticalSectionMutex, NULL) == -1) {
+ if (pthread_mutex_init(&pQueue->nCriticalSectionMutex, NULL) != 0) {
free(pQueue);
return -1;
}
diff --git a/halimpl/tml/phTmlNfc.cc b/halimpl/tml/phTmlNfc.cc
index 643764d..b3135c1 100644
--- a/halimpl/tml/phTmlNfc.cc
+++ b/halimpl/tml/phTmlNfc.cc
@@ -113,7 +113,7 @@ NFCSTATUS phTmlNfc_Init(pphTmlNfc_Config_t pConfig) {
gpphTmlNfc_Context->tReadInfo.bThreadBusy = false;
gpphTmlNfc_Context->tWriteInfo.bThreadBusy = false;
if (pthread_mutex_init(&gpphTmlNfc_Context->readInfoUpdateMutex,
- NULL) == -1) {
+ NULL) != 0) {
wInitStatus = NFCSTATUS_FAILED;
} else if (0 != sem_init(&gpphTmlNfc_Context->rxSemaphore, 0, 0)) {
wInitStatus = NFCSTATUS_FAILED;
diff --git a/halimpl/utils/phNxpNciHal_utils.cc b/halimpl/utils/phNxpNciHal_utils.cc
index c1a14f4..57aa819 100644
--- a/halimpl/utils/phNxpNciHal_utils.cc
+++ b/halimpl/utils/phNxpNciHal_utils.cc
@@ -36,7 +36,7 @@
*******************************************************************************/
int listInit(struct listHead* pList) {
pList->pFirst = NULL;
- if (pthread_mutex_init(&pList->mutex, NULL) == -1) {
+ if (pthread_mutex_init(&pList->mutex, NULL) != 0) {
NXPLOG_NCIHAL_E("Mutex creation failed (errno=0x%08x)", errno);
return 0;
}
@@ -59,7 +59,7 @@ int listDestroy(struct listHead* pList) {
bListNotEmpty = listGetAndRemoveNext(pList, NULL);
}
- if (pthread_mutex_destroy(&pList->mutex) == -1) {
+ if (pthread_mutex_destroy(&pList->mutex) != 0) {
NXPLOG_NCIHAL_E("Mutex destruction failed (errno=0x%08x)", errno);
return 0;
}
@@ -266,12 +266,12 @@ phNxpNciHal_Monitor_t* phNxpNciHal_init_monitor(void) {
if (nxpncihal_monitor != NULL) {
memset(nxpncihal_monitor, 0x00, sizeof(phNxpNciHal_Monitor_t));
- if (pthread_mutex_init(&nxpncihal_monitor->reentrance_mutex, NULL) == -1) {
+ if (pthread_mutex_init(&nxpncihal_monitor->reentrance_mutex, NULL) != 0) {
NXPLOG_NCIHAL_E("reentrance_mutex creation returned 0x%08x", errno);
goto clean_and_return;
}
- if (pthread_mutex_init(&nxpncihal_monitor->concurrency_mutex, NULL) == -1) {
+ if (pthread_mutex_init(&nxpncihal_monitor->concurrency_mutex, NULL) != 0) {
NXPLOG_NCIHAL_E("concurrency_mutex creation returned 0x%08x", errno);
pthread_mutex_destroy(&nxpncihal_monitor->reentrance_mutex);
goto clean_and_return;