mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-08 20:01:36 +08:00
Fixed Clang tidy errors
This commit is contained in:
@@ -245,11 +245,7 @@ ByteSize SerialImpl::getBytesize() const
|
||||
|
||||
bool SerialImpl::setBytesize(ByteSize bytesize)
|
||||
{
|
||||
if (bytesize != ByteSize::EightBits) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
return bytesize == ByteSize::EightBits;
|
||||
}
|
||||
|
||||
Parity SerialImpl::getParity() const
|
||||
@@ -259,11 +255,7 @@ Parity SerialImpl::getParity() const
|
||||
|
||||
bool SerialImpl::setParity(Parity parity)
|
||||
{
|
||||
if (parity != Parity::None) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
return parity == Parity::None;
|
||||
}
|
||||
|
||||
StopBits SerialImpl::getStopbits() const
|
||||
@@ -273,11 +265,7 @@ StopBits SerialImpl::getStopbits() const
|
||||
|
||||
bool SerialImpl::setStopbits(StopBits stopbits)
|
||||
{
|
||||
if (stopbits != StopBits::One) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
return stopbits == StopBits::One;
|
||||
}
|
||||
|
||||
FlowControl SerialImpl::getFlowcontrol() const
|
||||
@@ -287,11 +275,7 @@ FlowControl SerialImpl::getFlowcontrol() const
|
||||
|
||||
bool SerialImpl::setFlowcontrol(FlowControl flowcontrol)
|
||||
{
|
||||
if (flowcontrol != FlowControl::Disabled) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
return flowcontrol == FlowControl::Disabled;
|
||||
}
|
||||
|
||||
} // namespace device
|
||||
|
||||
Reference in New Issue
Block a user