diff --git a/script/make-pretty b/script/make-pretty index 1aabc3e07..506717ace 100755 --- a/script/make-pretty +++ b/script/make-pretty @@ -115,6 +115,7 @@ readonly OT_CLANG_TIDY_BUILD_OPTS=( '-DOT_SNTP_CLIENT=ON' '-DOT_SRP_CLIENT=ON' '-DOT_THREAD_VERSION=1.2' + '-DOT_TREL=ON' '-DOT_COVERAGE=ON' '-DOT_LOG_LEVEL_DYNAMIC=ON' '-DOT_COMPILE_WARNING_AS_ERROR=ON' diff --git a/src/core/api/multi_radio_api.cpp b/src/core/api/multi_radio_api.cpp index 6995148a3..15d84b65e 100644 --- a/src/core/api/multi_radio_api.cpp +++ b/src/core/api/multi_radio_api.cpp @@ -47,7 +47,7 @@ using namespace ot; otError otMultiRadioGetNeighborInfo(otInstance * aInstance, const otExtAddress * aExtAddress, - otMultiRadioNeighborInfo *aInfo) + otMultiRadioNeighborInfo *aNeighborInfo) { Error error = kErrorNone; Instance &instance = *static_cast(aInstance); @@ -55,9 +55,9 @@ otError otMultiRadioGetNeighborInfo(otInstance * aInstance, neighbor = instance.Get().FindNeighbor(*static_cast(aExtAddress), Neighbor::kInStateAnyExceptInvalid); - VerifyOrExit(neighbor != NULL, error = kErrorNotFound); + VerifyOrExit(neighbor != nullptr, error = kErrorNotFound); - neighbor->PopulateMultiRadioInfo(*aInfo); + neighbor->PopulateMultiRadioInfo(*aNeighborInfo); exit: return error; diff --git a/src/core/mac/mac_links.cpp b/src/core/mac/mac_links.cpp index bdad29bbc..dd2ce65cf 100644 --- a/src/core/mac/mac_links.cpp +++ b/src/core/mac/mac_links.cpp @@ -51,9 +51,6 @@ TxFrames::TxFrames(Instance &aInstance) #if OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE , mTxFrameTrel(aInstance.Get().GetTransmitFrame()) #endif -#if OPENTHREAD_CONFIG_MULTI_RADIO - , mSelectedRadioTypes() -#endif { } diff --git a/src/core/mac/mac_types.hpp b/src/core/mac/mac_types.hpp index a001d4f6d..e61427b6d 100644 --- a/src/core/mac/mac_types.hpp +++ b/src/core/mac/mac_types.hpp @@ -671,7 +671,7 @@ public: * @param[in] aMask A bit-mask representing the radio types (the first bit corresponds to radio type 0, and so on) * */ - RadioTypes(uint8_t aMask) + explicit RadioTypes(uint8_t aMask) : mBitMask(aMask) { } diff --git a/src/core/radio/trel_packet.cpp b/src/core/radio/trel_packet.cpp index 8ee081a56..ad2ae9848 100644 --- a/src/core/radio/trel_packet.cpp +++ b/src/core/radio/trel_packet.cpp @@ -116,14 +116,14 @@ void Packet::Init(uint8_t *aBuffer, uint16_t aLength) mLength = aLength; } -void Packet::Init(Header::Type aType, uint8_t *mPayload, uint16_t mPayloadLength) +void Packet::Init(Header::Type aType, uint8_t *aPayload, uint16_t aPayloadLength) { uint16_t headerSize = Header::GetSize(aType); // The payload buffer should reserve enough bytes for // header (depending on type) before the payload. - Init(mPayload - headerSize, mPayloadLength + headerSize); + Init(aPayload - headerSize, aPayloadLength + headerSize); GetHeader().Init(aType); } diff --git a/src/core/radio/trel_packet.hpp b/src/core/radio/trel_packet.hpp index 578cdaa43..34ec3f4ce 100644 --- a/src/core/radio/trel_packet.hpp +++ b/src/core/radio/trel_packet.hpp @@ -284,7 +284,6 @@ public: * @param[in] aPayloadLength The length (number of bytes) in the payload only (not including the header). * */ - void Init(Header::Type aType, uint8_t *aPayload, uint16_t aPayloadLength); /** diff --git a/src/core/thread/mesh_forwarder.hpp b/src/core/thread/mesh_forwarder.hpp index 643a4bce4..a7da96785 100644 --- a/src/core/thread/mesh_forwarder.hpp +++ b/src/core/thread/mesh_forwarder.hpp @@ -314,11 +314,11 @@ public: * on the radio link. * * @param[in] aNeighbor The neighbor for which the deferred ack status is being reported. - * @param[in] aTxError The deferred ack error status: `kErrorNone` to indicate a deferred ack was received, + * @param[in] aError The deferred ack error status: `kErrorNone` to indicate a deferred ack was received, * `kErrorNoAck` to indicate an ack timeout. * */ - void HandleDeferredAck(Neighbor &aNeighbor, Error aTxError); + void HandleDeferredAck(Neighbor &aNeighbor, Error aError); #endif private: diff --git a/src/core/thread/radio_selector.hpp b/src/core/thread/radio_selector.hpp index b244a60eb..e1766a0dc 100644 --- a/src/core/thread/radio_selector.hpp +++ b/src/core/thread/radio_selector.hpp @@ -114,7 +114,7 @@ public: * @param[in] aInstance A reference to the OpenThread instance. * */ - RadioSelector(Instance &aInstance); + explicit RadioSelector(Instance &aInstance); /** * This method updates the neighbor info (for multi radio support) on a received frame event. @@ -173,13 +173,13 @@ public: * The `aTxFrames` will also be updated to indicate which radio links are to be used. * * @param[inout] aMessage The message to send. - * @param[in] aDest The MAC destination address. + * @param[in] aMacDest The MAC destination address. * @param[inout] aTxFrames The set of TxFrames for all radio links. * * @returns A reference to `mTxFrame` to use when preparing the frame for tx. * */ - Mac::TxFrame &SelectRadio(Message &aMessage, const Mac::Address &aDest, Mac::TxFrames &aTxFrames); + Mac::TxFrame &SelectRadio(Message &aMessage, const Mac::Address &aMacDest, Mac::TxFrames &aTxFrames); private: enum