mirror of
https://github.com/espressif/openthread.git
synced 2026-08-01 08:37:47 +00:00
[clang-tidy] readability-else-after-return (#5808)
This commit is contained in:
@@ -124,6 +124,7 @@ modernize-use-equals-default,\
|
||||
modernize-use-equals-delete,\
|
||||
modernize-use-nullptr,\
|
||||
readability-avoid-const-params-in-decls,\
|
||||
readability-else-after-return,\
|
||||
readability-inconsistent-declaration-parameter-name,\
|
||||
readability-make-member-function-const,\
|
||||
readability-redundant-member-init,\
|
||||
|
||||
@@ -4230,10 +4230,8 @@ bool MleRouter::HasOneNeighborWithComparableConnectivity(const RouteTlv &aRoute,
|
||||
routerCount++;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
ExitNow(rval = false);
|
||||
}
|
||||
|
||||
ExitNow(rval = false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -140,16 +140,16 @@ void otPlatAlarmMilliStartAt(otInstance *aInstance, uint32_t aT0, uint32_t aDt)
|
||||
|
||||
uint32_t otPlatAlarmMilliGetNow(void)
|
||||
{
|
||||
struct timeval tv;
|
||||
|
||||
if (g_testPlatAlarmGetNow)
|
||||
{
|
||||
return g_testPlatAlarmGetNow();
|
||||
}
|
||||
else
|
||||
{
|
||||
struct timeval tv;
|
||||
gettimeofday(&tv, nullptr);
|
||||
return (uint32_t)((tv.tv_sec * 1000) + (tv.tv_usec / 1000) + 123456);
|
||||
}
|
||||
|
||||
gettimeofday(&tv, nullptr);
|
||||
|
||||
return (uint32_t)((tv.tv_sec * 1000) + (tv.tv_usec / 1000) + 123456);
|
||||
}
|
||||
|
||||
void otPlatAlarmMicroStop(otInstance *aInstance)
|
||||
@@ -179,16 +179,16 @@ void otPlatAlarmMicroStartAt(otInstance *aInstance, uint32_t aT0, uint32_t aDt)
|
||||
|
||||
uint32_t otPlatAlarmMicroGetNow(void)
|
||||
{
|
||||
struct timeval tv;
|
||||
|
||||
if (g_testPlatAlarmGetNow)
|
||||
{
|
||||
return g_testPlatAlarmGetNow();
|
||||
}
|
||||
else
|
||||
{
|
||||
struct timeval tv;
|
||||
gettimeofday(&tv, nullptr);
|
||||
return (uint32_t)((tv.tv_sec * 1000000) + tv.tv_usec + 123456);
|
||||
}
|
||||
|
||||
gettimeofday(&tv, nullptr);
|
||||
|
||||
return (uint32_t)((tv.tv_sec * 1000000) + tv.tv_usec + 123456);
|
||||
}
|
||||
|
||||
//
|
||||
@@ -233,10 +233,8 @@ bool otPlatRadioIsEnabled(otInstance *aInstance)
|
||||
{
|
||||
return g_testPlatRadioIsEnabled(aInstance);
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
otError otPlatRadioEnable(otInstance *aInstance)
|
||||
@@ -245,10 +243,8 @@ otError otPlatRadioEnable(otInstance *aInstance)
|
||||
{
|
||||
return g_testPlatRadioEnable(aInstance);
|
||||
}
|
||||
else
|
||||
{
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
otError otPlatRadioDisable(otInstance *aInstance)
|
||||
@@ -257,10 +253,8 @@ otError otPlatRadioDisable(otInstance *aInstance)
|
||||
{
|
||||
return g_testPlatRadioDisable(aInstance);
|
||||
}
|
||||
else
|
||||
{
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
otError otPlatRadioSleep(otInstance *)
|
||||
@@ -274,10 +268,8 @@ otError otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel)
|
||||
{
|
||||
return g_testPlatRadioReceive(aInstance, aChannel);
|
||||
}
|
||||
else
|
||||
{
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
otError otPlatRadioTransmit(otInstance *aInstance, otRadioFrame *aFrame)
|
||||
@@ -288,10 +280,8 @@ otError otPlatRadioTransmit(otInstance *aInstance, otRadioFrame *aFrame)
|
||||
{
|
||||
return g_testPlatRadioTransmit(aInstance);
|
||||
}
|
||||
else
|
||||
{
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
otRadioFrame *otPlatRadioGetTransmitBuffer(otInstance *aInstance)
|
||||
@@ -300,10 +290,8 @@ otRadioFrame *otPlatRadioGetTransmitBuffer(otInstance *aInstance)
|
||||
{
|
||||
return g_testPlatRadioGetTransmitBuffer(aInstance);
|
||||
}
|
||||
else
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
int8_t otPlatRadioGetRssi(otInstance *)
|
||||
|
||||
Reference in New Issue
Block a user