Skip to content

Commit fe450a6

Browse files
committed
powercap: idle_inject: Simplify if condition
JIRA: https://issues.redhat.com/browse/RHEL-53594 commit e5753da Author: Thorsten Blum <thorsten.blum@toblux.com> Date: Wed Jun 5 15:58:42 2024 +0200 powercap: idle_inject: Simplify if condition The if condition !A || A && B can be simplified to !A || B. Fixes the following Coccinelle/coccicheck warning reported by excluded_middle.cocci: WARNING !A || A && B is equivalent to !A || B Compile-tested only. Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: David Arcari <darcari@redhat.com>
1 parent de6f13f commit fe450a6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/powercap/idle_inject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ static enum hrtimer_restart idle_inject_timer_fn(struct hrtimer *timer)
128128
struct idle_inject_device *ii_dev =
129129
container_of(timer, struct idle_inject_device, timer);
130130

131-
if (!ii_dev->update || (ii_dev->update && ii_dev->update()))
131+
if (!ii_dev->update || ii_dev->update())
132132
idle_inject_wakeup(ii_dev);
133133

134134
duration_us = READ_ONCE(ii_dev->run_duration_us);

0 commit comments

Comments
 (0)