From: Thorsten Blum Date: Wed, 5 Jun 2024 13:58:42 +0000 (+0200) Subject: powercap: idle_inject: Simplify if condition X-Git-Tag: v6.11-rc1~173^2~1^3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e5753da31c61a049113be99d27e9f46755484577;p=thirdparty%2Flinux.git 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 Signed-off-by: Rafael J. Wysocki --- diff --git a/drivers/powercap/idle_inject.c b/drivers/powercap/idle_inject.c index e18a2cc4e46a0..bafc59904ed35 100644 --- a/drivers/powercap/idle_inject.c +++ b/drivers/powercap/idle_inject.c @@ -127,7 +127,7 @@ static enum hrtimer_restart idle_inject_timer_fn(struct hrtimer *timer) struct idle_inject_device *ii_dev = container_of(timer, struct idle_inject_device, timer); - if (!ii_dev->update || (ii_dev->update && ii_dev->update())) + if (!ii_dev->update || ii_dev->update()) idle_inject_wakeup(ii_dev); duration_us = READ_ONCE(ii_dev->run_duration_us);