[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250613082157.50040-4-panchuang@vivo.com>
Date: Fri, 13 Jun 2025 16:21:57 +0800
From: Pan Chuang <panchuang@...o.com>
To: mchehab@...nel.org
Cc: linux-media@...r.kernel.org,
linux-kernel@...r.kernel.org,
Pan Chuang <panchuang@...o.com>
Subject: [PATCH 3/3] pci: cx23885: cx23888-ir: Use str_yes_no() and str_enabled_disabled() helper
Remove hard-coded strings by using the str_yes_no() and
str_enabled_disabled() helper.
Signed-off-by: Pan Chuang <panchuang@...o.com>
---
drivers/media/pci/cx23885/cx23888-ir.c | 36 +++++++++++++-------------
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/drivers/media/pci/cx23885/cx23888-ir.c b/drivers/media/pci/cx23885/cx23888-ir.c
index 222d04421468..85ca564fd3ab 100644
--- a/drivers/media/pci/cx23885/cx23888-ir.c
+++ b/drivers/media/pci/cx23885/cx23888-ir.c
@@ -930,11 +930,11 @@ static int cx23888_ir_log_status(struct v4l2_subdev *sd)
v4l2_info(sd, "IR Receiver:\n");
v4l2_info(sd, "\tEnabled: %s\n",
- cntrl & CNTRL_RXE ? "yes" : "no");
+ str_yes_no(cntrl & CNTRL_RXE));
v4l2_info(sd, "\tDemodulation from a carrier: %s\n",
- cntrl & CNTRL_DMD ? "enabled" : "disabled");
+ str_enabled_disabled(cntrl & CNTRL_DMD));
v4l2_info(sd, "\tFIFO: %s\n",
- cntrl & CNTRL_RFE ? "enabled" : "disabled");
+ str_enabled_disabled(cntrl & CNTRL_RFE));
switch (cntrl & CNTRL_EDG) {
case CNTRL_EDG_NONE:
s = "disabled";
@@ -993,37 +993,37 @@ static int cx23888_ir_log_status(struct v4l2_subdev *sd)
pulse_width_count_to_us(FIFO_RXTX, rxclk),
pulse_width_count_to_ns(FIFO_RXTX, rxclk));
v4l2_info(sd, "\tLow pass filter: %s\n",
- filtr ? "enabled" : "disabled");
+ str_enabled_disabled(filtr));
if (filtr)
v4l2_info(sd, "\tMin acceptable pulse width (LPF): %u us, %u ns\n",
lpf_count_to_us(filtr),
lpf_count_to_ns(filtr));
v4l2_info(sd, "\tPulse width timer timed-out: %s\n",
- stats & STATS_RTO ? "yes" : "no");
+ str_yes_no(stats & STATS_RTO));
v4l2_info(sd, "\tPulse width timer time-out intr: %s\n",
- irqen & IRQEN_RTE ? "enabled" : "disabled");
+ str_enabled_disabled(irqen & IRQEN_RTE));
v4l2_info(sd, "\tFIFO overrun: %s\n",
- stats & STATS_ROR ? "yes" : "no");
+ str_yes_no(stats & STATS_ROR));
v4l2_info(sd, "\tFIFO overrun interrupt: %s\n",
- irqen & IRQEN_ROE ? "enabled" : "disabled");
+ str_enabled_disabled(irqen & IRQEN_ROE));
v4l2_info(sd, "\tBusy: %s\n",
- stats & STATS_RBY ? "yes" : "no");
+ str_yes_no(stats & STATS_RBY));
v4l2_info(sd, "\tFIFO service requested: %s\n",
- stats & STATS_RSR ? "yes" : "no");
+ str_yes_no(stats & STATS_RSR));
v4l2_info(sd, "\tFIFO service request interrupt: %s\n",
- irqen & IRQEN_RSE ? "enabled" : "disabled");
+ str_enabled_disabled(irqen & IRQEN_RSE));
v4l2_info(sd, "IR Transmitter:\n");
v4l2_info(sd, "\tEnabled: %s\n",
- cntrl & CNTRL_TXE ? "yes" : "no");
+ str_yes_no(cntrl & CNTRL_TXE));
v4l2_info(sd, "\tModulation onto a carrier: %s\n",
- cntrl & CNTRL_MOD ? "enabled" : "disabled");
+ str_enabled_disabled(cntrl & CNTRL_MOD));
v4l2_info(sd, "\tFIFO: %s\n",
- cntrl & CNTRL_TFE ? "enabled" : "disabled");
+ str_enabled_disabled(cntrl & CNTRL_TFE));
v4l2_info(sd, "\tFIFO interrupt watermark: %s\n",
cntrl & CNTRL_TIC ? "not empty" : "half full or less");
v4l2_info(sd, "\tOutput pin level inversion %s\n",
- cntrl & CNTRL_IVO ? "yes" : "no");
+ str_yes_no(cntrl & CNTRL_IVO));
v4l2_info(sd, "\tCarrier polarity: %s\n",
cntrl & CNTRL_CPL ? "space:burst mark:noburst"
: "space:noburst mark:burst");
@@ -1037,11 +1037,11 @@ static int cx23888_ir_log_status(struct v4l2_subdev *sd)
pulse_width_count_to_us(FIFO_RXTX, txclk),
pulse_width_count_to_ns(FIFO_RXTX, txclk));
v4l2_info(sd, "\tBusy: %s\n",
- stats & STATS_TBY ? "yes" : "no");
+ str_yes_no(stats & STATS_TBY));
v4l2_info(sd, "\tFIFO service requested: %s\n",
- stats & STATS_TSR ? "yes" : "no");
+ str_yes_no(stats & STATS_TSR));
v4l2_info(sd, "\tFIFO service request interrupt: %s\n",
- irqen & IRQEN_TSE ? "enabled" : "disabled");
+ str_enabled_disabled(irqen & IRQEN_TSE));
return 0;
}
--
2.39.0
Powered by blists - more mailing lists