From 343d62717201c76796f7bbc0aea9211aa945f33c Mon Sep 17 00:00:00 2001 From: Yingyuan Zhu Date: Wed, 29 Aug 2018 16:03:36 +0800 Subject: [PATCH] meson: pwm: fix coverity warning 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 --- drivers/amlogic/pwm/pwm_meson_sysfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/amlogic/pwm/pwm_meson_sysfs.c b/drivers/amlogic/pwm/pwm_meson_sysfs.c index 46ef47898222..e50788584315 100644 --- a/drivers/amlogic/pwm/pwm_meson_sysfs.c +++ b/drivers/amlogic/pwm/pwm_meson_sysfs.c @@ -129,7 +129,7 @@ int pwm_set_times(struct meson_pwm *meson, { 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; @@ -297,7 +297,7 @@ int pwm_set_blink_times(struct meson_pwm *meson, { 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;