Fix bugprone-posix-return warnings am: 42574fdfa1 am: c66fe564f2
Change-Id: Icd3c2dc147b978f1b479cb374f86add3f0b2e0aa
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 @@
(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 @@
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 @@
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 @@
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;