Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

staging: media: ipu3: use string_choices API instead of ternary operator

Use string_choices API instead of manually determining the output using
ternary operator to improve code readability and consistency.

This also fixes cocci warning.

Signed-off-by: Nai-Chen Cheng <bleach1827@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>

authored by

Nai-Chen Cheng and committed by
Hans Verkuil
955c993d 0125d9e1

+5 -3
+2 -1
drivers/staging/media/ipu3/ipu3-css.c
··· 4 4 #include <linux/device.h> 5 5 #include <linux/iopoll.h> 6 6 #include <linux/slab.h> 7 + #include <linux/string_choices.h> 7 8 8 9 #include "ipu3.h" 9 10 #include "ipu3-css.h" ··· 227 226 state = readl(base + IMGU_REG_STATE); 228 227 229 228 dev_dbg(dev, "CSS pm_ctrl 0x%x state 0x%x (power %s)\n", 230 - pm_ctrl, state, state & IMGU_STATE_POWER_DOWN ? "down" : "up"); 229 + pm_ctrl, state, str_down_up(state & IMGU_STATE_POWER_DOWN)); 231 230 232 231 /* Power up CSS using wrapper */ 233 232 if (state & IMGU_STATE_POWER_DOWN) {
+3 -2
drivers/staging/media/ipu3/ipu3-v4l2.c
··· 3 3 4 4 #include <linux/module.h> 5 5 #include <linux/pm_runtime.h> 6 + #include <linux/string_choices.h> 6 7 7 8 #include <media/v4l2-event.h> 8 9 #include <media/v4l2-ioctl.h> ··· 288 287 WARN_ON(pad >= IMGU_NODE_NUM); 289 288 290 289 dev_dbg(&imgu->pci_dev->dev, "pipe %u pad %u is %s", pipe, pad, 291 - flags & MEDIA_LNK_FL_ENABLED ? "enabled" : "disabled"); 290 + str_enabled_disabled(flags & MEDIA_LNK_FL_ENABLED)); 292 291 293 292 imgu_pipe = &imgu->imgu_pipe[pipe]; 294 293 imgu_pipe->nodes[pad].enabled = flags & MEDIA_LNK_FL_ENABLED; ··· 303 302 __clear_bit(pipe, imgu->css.enabled_pipes); 304 303 305 304 dev_dbg(&imgu->pci_dev->dev, "pipe %u is %s", pipe, 306 - flags & MEDIA_LNK_FL_ENABLED ? "enabled" : "disabled"); 305 + str_enabled_disabled(flags & MEDIA_LNK_FL_ENABLED)); 307 306 308 307 return 0; 309 308 }