From 8a27e6da83ce1ddd4a740886de934b49b255ffb0 Mon Sep 17 00:00:00 2001 From: Jonathan Hui Date: Fri, 8 May 2020 15:25:25 -0700 Subject: [PATCH] [data-poll-sender] change StopFastPolls() to return void (#4941) --- src/core/mac/data_poll_sender.cpp | 8 +++----- src/core/mac/data_poll_sender.hpp | 5 +---- src/core/thread/mle.cpp | 2 +- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/core/mac/data_poll_sender.cpp b/src/core/mac/data_poll_sender.cpp index d5f9052cd..2fa5885e6 100644 --- a/src/core/mac/data_poll_sender.cpp +++ b/src/core/mac/data_poll_sender.cpp @@ -378,10 +378,8 @@ void DataPollSender::SendFastPolls(uint8_t aNumFastPolls) } } -otError DataPollSender::StopFastPolls(void) +void DataPollSender::StopFastPolls(void) { - otError error = OT_ERROR_NONE; - VerifyOrExit(mFastPollsUsers != 0, OT_NOOP); // If `mFastPollsUsers` hits the max, let it be cleared @@ -390,13 +388,13 @@ otError DataPollSender::StopFastPolls(void) mFastPollsUsers--; - VerifyOrExit(mFastPollsUsers == 0, error = OT_ERROR_BUSY); + VerifyOrExit(mFastPollsUsers == 0, OT_NOOP); mRemainingFastPolls = 0; ScheduleNextPoll(kRecalculatePollPeriod); exit: - return error; + return; } void DataPollSender::ResetKeepAliveTimer(void) diff --git a/src/core/mac/data_poll_sender.hpp b/src/core/mac/data_poll_sender.hpp index d99087016..0aa0403d6 100644 --- a/src/core/mac/data_poll_sender.hpp +++ b/src/core/mac/data_poll_sender.hpp @@ -215,11 +215,8 @@ public: /** * This method asks data poll sender to stop fast polls when the expecting response is received. * - * @retval OT_ERROR_NONE Successfully stopped fast polls when no other responses are expected. - * @retval OT_ERROR_BUSY There are other callers who are waiting for responses. - * */ - otError StopFastPolls(void); + void StopFastPolls(void); /** * This method gets the maximum data polling period in use. diff --git a/src/core/thread/mle.cpp b/src/core/thread/mle.cpp index f6aeb1de8..4e452a062 100644 --- a/src/core/thread/mle.cpp +++ b/src/core/thread/mle.cpp @@ -2955,7 +2955,7 @@ void Mle::HandleDataResponse(const Message &aMessage, const Ip6::MessageInfo &aM // running out the specified number. E.g. other component also trigger fast poll, and // is waiting for response; or the corner case where multiple Mle Data Request attempts // happened due to the retransmission mechanism. - IgnoreError(Get().StopFastPolls()); + Get().StopFastPolls(); } exit: