tests: drivers: counter: Fix coverity issue
Fix issue reported by Coverity - return value not checked. Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
parent
2d8f71049e
commit
46aae2e86a
|
@ -130,15 +130,19 @@ static bool set_top_value_capable(const char *dev_name)
|
|||
struct counter_top_cfg cfg = {
|
||||
.ticks = counter_get_top_value(dev) - 1
|
||||
};
|
||||
int err;
|
||||
|
||||
int err = counter_set_top_value(dev, &cfg);
|
||||
|
||||
err = counter_set_top_value(dev, &cfg);
|
||||
if (err == -ENOTSUP) {
|
||||
return false;
|
||||
}
|
||||
|
||||
cfg.ticks++;
|
||||
counter_set_top_value(dev, &cfg);
|
||||
err = counter_set_top_value(dev, &cfg);
|
||||
if (err == -ENOTSUP) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue