diff options
author | Andrew Jeffery <andrew@aj.id.au> | 2018-05-25 15:45:38 +0930 |
---|---|---|
committer | Andrew Jeffery <andrew@aj.id.au> | 2019-04-08 13:48:50 +0930 |
commit | 2332e91ff6b0758026ce68f049a74cda6e13b702 (patch) | |
tree | 3c5788670f673bfd1c7aa6bf208125f7e16e297f | |
parent | bf0b0a929025255da9ef1b53982b51f034e9566d (diff) | |
download | phosphor-led-sysfs-2332e91ff6b0758026ce68f049a74cda6e13b702.tar.gz phosphor-led-sysfs-2332e91ff6b0758026ce68f049a74cda6e13b702.zip |
physical: Avoid unreachable statement in driveLED()
This also slightly improves the branch coverage statistics
Change-Id: I27d5168994831789a8f8dafeecc843242a7e406a
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
-rw-r--r-- | physical.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/physical.cpp b/physical.cpp index 77d3d4f..ae9ff1c 100644 --- a/physical.cpp +++ b/physical.cpp @@ -16,6 +16,7 @@ #include "physical.hpp" +#include <cassert> #include <iostream> #include <string> namespace phosphor @@ -77,16 +78,13 @@ void Physical::driveLED(Action current, Action request) return; } - if (request == Action::Blink) - { - return blinkOperation(); - } - if (request == Action::On || request == Action::Off) { return stableStateOperation(request); } - return; + + assert(request == Action::Blink); + blinkOperation(); } void Physical::stableStateOperation(Action action) |