PD#172718: meson: pwm: fix coverity warning
"value < 0" and "value > 255", two conditions cannot be
met simultaneously.So that the if statement cannot be executed.
This causes "Logically dead code".
Change-Id: I55930eb7ae9c6b44aa3b20b85aab6fbae9b04210
Signed-off-by: Yingyuan Zhu <yingyuan.zhu@amlogic.com>
{
unsigned int clear_val, val;
- if ((value < 0) && (value > 255)) {
+ if ((value < 0) || (value > 255)) {
dev_err(meson->chip.dev,
"index or value is not within the scope!\n");
return -EINVAL;
{
unsigned int clear_val, val;
- if ((value < 0) && (value > 15)) {
+ if ((value < 0) || (value > 15)) {
dev_err(meson->chip.dev,
"value or index is not within the scope!\n");
return -EINVAL;