diff options
author | Chih-Hung Hsieh <chh@google.com> | 2020-04-21 11:52:14 -0700 |
---|---|---|
committer | George Chang <georgekgchang@google.com> | 2020-04-22 10:44:12 +0800 |
commit | 42574fdfa1783ff3b218a0b1a28a0fd4e8956898 (patch) | |
tree | deb3041729a79fcc8b5e053540100ead9d6dde5a | |
parent | 2225c0cb3fd6386f9e9cf3a843fb417e455ef9d2 (diff) | |
download | platform_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 |
Fix bugprone-posix-return warningsandroid-mainline-11.0.0_r44android-mainline-11.0.0_r43android-mainline-11.0.0_r42android-mainline-11.0.0_r41android-mainline-11.0.0_r40android-mainline-11.0.0_r39android-mainline-11.0.0_r38android-mainline-11.0.0_r37android-mainline-11.0.0_r36android-mainline-11.0.0_r35android-mainline-11.0.0_r34android-mainline-11.0.0_r32android-mainline-11.0.0_r31android-mainline-11.0.0_r30android-mainline-11.0.0_r28android-mainline-11.0.0_r27android-mainline-11.0.0_r26android-mainline-11.0.0_r25android-mainline-11.0.0_r24android-mainline-11.0.0_r23android-mainline-11.0.0_r22android-mainline-11.0.0_r21android-mainline-11.0.0_r20android-mainline-11.0.0_r18android-mainline-11.0.0_r17android-mainline-11.0.0_r16android-mainline-11.0.0_r15android-mainline-11.0.0_r14android-mainline-11.0.0_r13android-mainline-11.0.0_r12android11-mainline-tethering-releaseandroid11-mainline-permission-releaseandroid11-mainline-os-statsd-releaseandroid11-mainline-networkstack-releaseandroid11-mainline-media-swcodec-releaseandroid11-mainline-media-releaseandroid11-mainline-extservices-releaseandroid11-mainline-documentsui-releaseandroid11-mainline-conscrypt-releaseandroid11-mainline-cellbroadcast-releaseandroid11-mainline-captiveportallogin-releaseandroid11-dev
Test: WITH_TIDY=1 make
Bug: 154629561
Merged-In: Id8d8973aa66c4ef1553392411a523f00696fb466
Change-Id: Id8d8973aa66c4ef1553392411a523f00696fb466
-rwxr-xr-x | halimpl/tml/phDal4Nfc_messageQueueLib.cc | 2 | ||||
-rw-r--r-- | halimpl/tml/phTmlNfc.cc | 2 | ||||
-rw-r--r-- | halimpl/utils/phNxpNciHal_utils.cc | 8 |
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; |