diff --git a/script/make-pretty b/script/make-pretty index 28214113f..b824f5a23 100755 --- a/script/make-pretty +++ b/script/make-pretty @@ -119,6 +119,7 @@ readonly OT_CLANG_TIDY_CHECKS="\ modernize-use-bool-literals,\ modernize-use-nullptr,\ readability-make-member-function-const,\ +readability-simplify-boolean-expr,\ " #performance-for-range-copy\ diff --git a/src/core/mac/mac.cpp b/src/core/mac/mac.cpp index 64df219fd..abe7010d4 100644 --- a/src/core/mac/mac.cpp +++ b/src/core/mac/mac.cpp @@ -2291,7 +2291,7 @@ void Mac::SetCslChannel(uint8_t aChannel) VerifyOrExit(GetCslChannel() != aChannel); mSubMac.SetCslChannel(aChannel); - mSubMac.SetCslChannelSpecified(aChannel != 0 ? true : false); + mSubMac.SetCslChannelSpecified(aChannel != 0); if (IsCslEnabled()) { diff --git a/src/ncp/ncp_base_mtd.cpp b/src/ncp/ncp_base_mtd.cpp index 10c123c07..b5371bb4f 100644 --- a/src/ncp/ncp_base_mtd.cpp +++ b/src/ncp/ncp_base_mtd.cpp @@ -277,9 +277,9 @@ template <> otError NcpBase::HandlePropertySet(void) SuccessOrExit(error = mDecoder.ReadBool(enabled)); // If the value has changed... - if ((enabled != false) != (otThreadGetDeviceRole(mInstance) != OT_DEVICE_ROLE_DISABLED)) + if (enabled != (otThreadGetDeviceRole(mInstance) != OT_DEVICE_ROLE_DISABLED)) { - if (enabled != false) + if (enabled) { error = otThreadSetEnabled(mInstance, true); StartLegacy(); @@ -679,7 +679,7 @@ template <> otError NcpBase::HandlePropertySet otError NcpBase::HandlePropertySet otError NcpBase::HandlePropertySet otError NcpBase::HandlePropertySet(void) SuccessOrExit(error = mDecoder.ReadBool(value)); - if (value == false) + if (!value) { error = otLinkRawSetReceiveDone(mInstance, nullptr); }