mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 11:50:43 +09:00
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 <yingyuan.zhu@amlogic.com>
This commit is contained in:
committed by
Jianxin Pan
parent
e11c1a802a
commit
343d627172
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user