diff mbox series

[2/3] staging: media: ipu3:Use str_down_up()

Message ID 20240927-cocci-6-12-v1-2-a318d4e6a19d@chromium.org
State New
Headers show
Series media: static-analyzers: Fix 6.12-rc1 cocci warnings | expand

Commit Message

Ricardo Ribalda Sept. 27, 2024, 9:42 a.m. UTC
The str_down_up() helper simplifies the code and fixes the following cocci
warning:

drivers/staging/media/ipu3/ipu3-css.c:229:18-47: opportunity for str_down_up(state & IMGU_STATE_POWER_DOWN)

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
 drivers/staging/media/ipu3/ipu3-css.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andy Shevchenko Sept. 27, 2024, 9:55 a.m. UTC | #1
On Fri, Sep 27, 2024 at 09:42:14AM +0000, Ricardo Ribalda wrote:
> The str_down_up() helper simplifies the code and fixes the following cocci
> warning:
> 
> drivers/staging/media/ipu3/ipu3-css.c:229:18-47: opportunity for str_down_up(state & IMGU_STATE_POWER_DOWN)

With a space after the colon in the subject it seems fine to me,
Reviewed-by: Andy Shevchenko <andy@kernel.org>
diff mbox series

Patch

diff --git a/drivers/staging/media/ipu3/ipu3-css.c b/drivers/staging/media/ipu3/ipu3-css.c
index 1b0a59b78949..bb22375481a0 100644
--- a/drivers/staging/media/ipu3/ipu3-css.c
+++ b/drivers/staging/media/ipu3/ipu3-css.c
@@ -226,7 +226,7 @@  int imgu_css_set_powerup(struct device *dev, void __iomem *base,
 	state = readl(base + IMGU_REG_STATE);
 
 	dev_dbg(dev, "CSS pm_ctrl 0x%x state 0x%x (power %s)\n",
-		pm_ctrl, state, state & IMGU_STATE_POWER_DOWN ? "down" : "up");
+		pm_ctrl, state, str_down_up(state & IMGU_STATE_POWER_DOWN));
 
 	/* Power up CSS using wrapper */
 	if (state & IMGU_STATE_POWER_DOWN) {