From patchwork Tue Jan 14 19:46:17 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 857383 Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 539542080D0 for ; Tue, 14 Jan 2025 19:46:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736883998; cv=none; b=hMxwA0ElCtqo1lj1j7tEgbWHQTVMGosfhyJT/OJ5KqXVT14jZMboRs0XPqy4zIvl+ConZanSwfbHfDlgfSn4Ak7P+qixoNaaVcd0nbdUIU6JUPN0Jn8eR72KjBtAY85JpT9y1sWaFwpNgVjlBvhd+2D8fmEiQPvFT2iB2D1YU58= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736883998; c=relaxed/simple; bh=mtlbO5pD3OH1lj6OMF21FLzICL+OBIxNoR/be1QT+nA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gDS+FH67TxPZl8zFdown3H01WrNqOgtoHdxMa3/JS4Jvf0KOb/xZLQ1yvsBtFrz8vveTJ25BtZny6OYGmJgK6xLMqo+/r7z0a+41whTGqEGyZqyWh+HH4102f4O+M90nj/7hbvWAtY/ovI3CV+jVVDgluC1csehIrF7t1EgreNo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=BW5Cjdrt; arc=none smtp.client-ip=209.85.221.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="BW5Cjdrt" Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-385dc85496dso290733f8f.3 for ; Tue, 14 Jan 2025 11:46:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736883994; x=1737488794; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=vxDB2Wb8JUamL19cl9GDthbDMznKMMo1W7TNxgSukcs=; b=BW5CjdrtYVwLrZj23QrSV2+Gtcg4LbG+OJgIKLRSqdPdPU5IvwHIhqTOLGJkZcmw9H aXUW1DRUxVFBd4HE7wTQqDscbiWlhOM5tQGz/zjMU/kVSm/R1inLws4Z74HqI5K5SBxw grXb6DZupsnWgNRLJ4Hz0A+MchSke5s6s3UPbjrrHZMJQ4dy4Te5QCQCkb8Lxrq2SLof ybnl88QMlHHg+USzK0lXuaGiH9bZyx5fcFz/M+QmdGQ9ck5ksGop/DNAztgQaK5P2JSh eR7uEAVAUXPefZq31uI5LkpgLVa1R/NS3ewN4bk1kYVn/KrrT3tsNT2LkpIiFhLfiTO0 tstg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736883994; x=1737488794; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vxDB2Wb8JUamL19cl9GDthbDMznKMMo1W7TNxgSukcs=; b=KlrXy02+DjOWOG6nqnd9I9hjuwGHL5+wTa2Art3wvYhwhjBX+/dR6LfpvjHyom3fjl /dFP0jCm+p3PAaUZOP8V4punQ5FmWqZl+K/71HwQRpG3MCvo8ze+ncXCRGyD+i75rOP5 Cimz+cYa0OtRo9/aw0VRYNH/Nm9KI6+kJ64TDWgA2tZW3u7Cfdlc142/G9/FvH2knJPl 10ENdEP2DmSSFT0XStk1Il9bDp4wmAm95ipH3vt/BRMKSEESJGrcLWYwo0ddXUT63se2 YwdchN8h8IATtX8mwsGGw7EdbuF/Iysczu+AUCRF1QJBhmH+G0ms99zpsOrJBfkMh9WP hyYA== X-Gm-Message-State: AOJu0YxVxrRmngO2V2iUqJCk9CUxAmQVkkKt6jNESRUqdUYpsF9cZHWF z1+H1T/XMq/nVIkagsc0L3cPjHwispWAliK9VsLMqtxAvTCt+3Vka8Mtap5/CWg= X-Gm-Gg: ASbGncvj1xvu5EZ5rFkGWKgPbANL4AM2TpCEODv5ySGKyhnzJy9R1gWc6QduBxG8gab DJpVUUjJ7UB/C918aPp+BrvI8NeNbrq0xk4onjUKDQc4KPOg2avC93ppYt8b42864SC0OTUz1Hm YsHUpYswOqebZ1dhMRzgSwBWN2FXXZyP2ORtv3V5B36IJX1L70djXS8pb3xitroJDZtAn+/7zS0 //BK/RNW7gMyMnhKUW/A3Cfj3HF/rJTLgsoM6+PIy3LDc/r/TTUlcoaCCUwGXWo/Tk5au+n X-Google-Smtp-Source: AGHT+IER13mKPcCGVKuCMptsL9LazocaDj6jSmqEiz+kIc/LNX7GIxUpkepPagRdTlxs1DatTTSgcg== X-Received: by 2002:adf:b607:0:b0:385:e9ba:ace3 with SMTP id ffacd0b85a97d-38a872dc7b1mr7039415f8f.1.1736883994457; Tue, 14 Jan 2025 11:46:34 -0800 (PST) Received: from [127.0.1.1] ([178.197.223.165]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e9e37c2esm184337515e9.28.2025.01.14.11.46.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 11:46:33 -0800 (PST) From: Krzysztof Kozlowski Date: Tue, 14 Jan 2025 20:46:17 +0100 Subject: [PATCH 1/6] media: Use str_enable_disable-like helpers Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250114-str-enable-disable-media-v1-1-9316270aa65f@linaro.org> References: <20250114-str-enable-disable-media-v1-0-9316270aa65f@linaro.org> In-Reply-To: <20250114-str-enable-disable-media-v1-0-9316270aa65f@linaro.org> To: Hans Verkuil , Mauro Carvalho Chehab , Tomasz Figa , Marek Szyprowski , Maxim Levitsky , Sean Young , Olli Salonen , Abylay Ospan , Jemma Denson , Patrick Boettcher , Jacopo Mondi , Kieran Bingham , Laurent Pinchart , =?utf-8?q?Ni?= =?utf-8?q?klas_S=C3=B6derlund?= , Tim Harvey , Andy Walls , Sakari Ailus , Bingbu Cao Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=11914; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=mtlbO5pD3OH1lj6OMF21FLzICL+OBIxNoR/be1QT+nA=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBnhr8PWzf8AUgl92d11XYLjAMWKfYLc6TOqLp97 cp7f+c1SvCJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZ4a/DwAKCRDBN2bmhouD 1zcZD/9AmyRI+aMgg+IZ1AfpEUHi9nIxVVnmut42zvTqRsfX7tDvjkNx6DMgTcpz0EcCBCUoU/A hRedawppay9QdgHE7vxgwENIa8mHj/a/WV3e/R7RxZ2d0tm7CmuoxUwSSja9EEikfALJzNbJvK3 wdUYaH8O7os7SD8ojy/xHm/HWi/733sPKhM/jgVHDDGwms3DWl1AS+NVXIXQM2GwVIj3cnPSSK0 mJIujjUOKEC2IfNGQU1RP0hL04KDL3Ec9l3S3nDwXEo6QcRVmKXa8loZplHMt9HQlF9t2CPQGDV ZUMQiNBi4EKmfAIYNnGmFueHgIIoKt0RB4wEwe4QuvlKI5eLoIzqFg/ot5O5QLPYOrwbU8MVfh1 PMAKA2Hu2AF48zQMrNKAgWol6+NFt7dYIiVKeqQ0OSvFn7JojMjj33dMRa7wxCX5gQ0n7OxMJBn NMMoMWThN9pUgxUPMtVKk0KvlejKDD9ZfLwLz7MGYbm+GYfce3HR25l/uxuXD57OI4WRiiU4114 olebe44PwuVbDIEo3Xv+C15Usv5N2VKgiilLFoNXHpC5XzzU5Lb+SojiCzSajVklCTMH4QogK/f biEEtLpQxpckgfVcDHpnnqSjkupaGc3S+IFcGhxK08SyJLG7Ifa+DTvP7tvBHHuAz7cgqWRvKGX HIUGUHIkY5LWnFA== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B Replace ternary (condition ? "enable" : "disable") syntax with helpers from string_choices.h because: 1. Simple function call with one argument is easier to read. Ternary operator has three arguments and with wrapping might lead to quite long code. 2. Is slightly shorter thus also easier to read. 3. It brings uniformity in the text - same string. 4. Allows deduping by the linker, which results in a smaller binary file. Signed-off-by: Krzysztof Kozlowski --- drivers/media/cec/platform/cec-gpio/cec-gpio.c | 5 +++-- drivers/media/cec/usb/pulse8/pulse8-cec.c | 5 +++-- drivers/media/common/b2c2/flexcop-hw-filter.c | 5 +++-- drivers/media/common/siano/sms-cards.c | 3 ++- drivers/media/common/videobuf2/videobuf2-core.c | 6 ++++-- drivers/media/rc/ene_ir.c | 3 ++- drivers/media/rc/mceusb.c | 3 ++- drivers/media/rc/serial_ir.c | 5 +++-- drivers/media/tuners/tda18250.c | 3 ++- drivers/media/tuners/tda9887.c | 11 ++++++----- 10 files changed, 30 insertions(+), 19 deletions(-) diff --git a/drivers/media/cec/platform/cec-gpio/cec-gpio.c b/drivers/media/cec/platform/cec-gpio/cec-gpio.c index 50cdc557c9430a2625ae615a1f469d2b2b02e6be..c75c48c07b7fb42254ba82abaab5f3602ef6cd97 100644 --- a/drivers/media/cec/platform/cec-gpio/cec-gpio.c +++ b/drivers/media/cec/platform/cec-gpio/cec-gpio.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include @@ -136,10 +137,10 @@ static void cec_gpio_status(struct cec_adapter *adap, struct seq_file *file) seq_printf(file, "using irq: %d\n", cec->cec_irq); if (cec->hpd_gpio) seq_printf(file, "hpd: %s\n", - cec->hpd_is_high ? "high" : "low"); + str_high_low(cec->hpd_is_high)); if (cec->v5_gpio) seq_printf(file, "5V: %s\n", - cec->v5_is_high ? "high" : "low"); + str_high_low(cec->v5_is_high)); } static int cec_gpio_read_hpd(struct cec_adapter *adap) diff --git a/drivers/media/cec/usb/pulse8/pulse8-cec.c b/drivers/media/cec/usb/pulse8/pulse8-cec.c index 171366fe35443b19f4791ffada46c83ed5e4fe06..c0b48b526cd7c86d046386184a036fbadde51306 100644 --- a/drivers/media/cec/usb/pulse8/pulse8-cec.c +++ b/drivers/media/cec/usb/pulse8/pulse8-cec.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -695,14 +696,14 @@ static int pulse8_setup(struct pulse8 *pulse8, struct serio *serio, return err; pulse8->autonomous = data[0]; dev_dbg(pulse8->dev, "Autonomous mode: %s", - data[0] ? "on" : "off"); + str_on_off(data[0])); if (pulse8->vers >= 10) { cmd[0] = MSGCODE_GET_AUTO_POWER_ON; err = pulse8_send_and_wait(pulse8, cmd, 1, cmd[0], 1); if (!err) dev_dbg(pulse8->dev, "Auto Power On: %s", - data[0] ? "on" : "off"); + str_on_off(data[0])); } cmd[0] = MSGCODE_GET_DEVICE_TYPE; diff --git a/drivers/media/common/b2c2/flexcop-hw-filter.c b/drivers/media/common/b2c2/flexcop-hw-filter.c index c5a3345c99e9ee4b39dfe453eeaa5f59eae93cfa..f0969af79311181404811857bf209a45b9014cd5 100644 --- a/drivers/media/common/b2c2/flexcop-hw-filter.c +++ b/drivers/media/common/b2c2/flexcop-hw-filter.c @@ -5,11 +5,12 @@ * see flexcop.c for copyright information */ #include "flexcop.h" +#include static void flexcop_rcv_data_ctrl(struct flexcop_device *fc, int onoff) { flexcop_set_ibi_value(ctrl_208, Rcv_Data_sig, onoff); - deb_ts("rcv_data is now: '%s'\n", onoff ? "on" : "off"); + deb_ts("rcv_data is now: '%s'\n", str_on_off(onoff)); } void flexcop_smc_ctrl(struct flexcop_device *fc, int onoff) @@ -116,7 +117,7 @@ static void flexcop_pid_control(struct flexcop_device *fc, return; deb_ts("setting pid: %5d %04x at index %d '%s'\n", - pid, pid, index, onoff ? "on" : "off"); + pid, pid, index, str_on_off(onoff)); /* First 6 can be buggy - skip over them if option set */ if (fc->skip_6_hw_pid_filter) diff --git a/drivers/media/common/siano/sms-cards.c b/drivers/media/common/siano/sms-cards.c index d4a116ab6c888609800aeedf9a6c4e268205f3a3..e9aa95233ff178c126cc1e621ab2e096637cb27c 100644 --- a/drivers/media/common/siano/sms-cards.c +++ b/drivers/media/common/siano/sms-cards.c @@ -8,6 +8,7 @@ #include "sms-cards.h" #include "smsir.h" #include +#include static struct sms_board sms_boards[] = { [SMS_BOARD_UNKNOWN] = { @@ -326,7 +327,7 @@ int sms_board_lna_control(struct smscore_device_t *coredev, int onoff) int board_id = smscore_get_board_id(coredev); struct sms_board *board = sms_get_board(board_id); - pr_debug("%s: LNA %s\n", __func__, onoff ? "enabled" : "disabled"); + pr_debug("%s: LNA %s\n", __func__, str_enabled_disabled(onoff)); switch (board_id) { case SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD_R2: diff --git a/drivers/media/common/videobuf2/videobuf2-core.c b/drivers/media/common/videobuf2/videobuf2-core.c index 2df566f409b65eb99fa7fbe308b8e3afe1bdcbca..19fa5c133c28db9c3766aded8e123a621a34ff88 100644 --- a/drivers/media/common/videobuf2/videobuf2-core.c +++ b/drivers/media/common/videobuf2/videobuf2-core.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -2874,7 +2875,8 @@ static int __vb2_init_fileio(struct vb2_queue *q, int read) return -EBUSY; dprintk(q, 3, "setting up file io: mode %s, count %d, read_once %d, write_immediately %d\n", - (read) ? "read" : "write", q->min_reqbufs_allocation, q->fileio_read_once, + str_read_write(read), q->min_reqbufs_allocation, + q->fileio_read_once, q->fileio_write_immediately); fileio = kzalloc(sizeof(*fileio), GFP_KERNEL); @@ -3022,7 +3024,7 @@ static size_t __vb2_perform_fileio(struct vb2_queue *q, char __user *data, size_ int ret; dprintk(q, 3, "mode %s, offset %ld, count %zd, %sblocking\n", - read ? "read" : "write", (long)*ppos, count, + str_read_write(read), (long)*ppos, count, nonblock ? "non" : ""); if (!data) diff --git a/drivers/media/rc/ene_ir.c b/drivers/media/rc/ene_ir.c index 67722e2e47ff78e504c55054480f0619e050f093..90bee860a8a13dda52e1efebfa42a30a26fb93fe 100644 --- a/drivers/media/rc/ene_ir.c +++ b/drivers/media/rc/ene_ir.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include "ene_ir.h" @@ -1118,7 +1119,7 @@ static void ene_remove(struct pnp_dev *pnp_dev) /* enable wake on IR (wakes on specific button on original remote) */ static void ene_enable_wake(struct ene_device *dev, bool enable) { - dbg("wake on IR %s", enable ? "enabled" : "disabled"); + dbg("wake on IR %s", str_enabled_disabled(enable)); ene_set_clear_reg_mask(dev, ENE_FW1, ENE_FW1_WAKE, enable); } diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c index 044767eb3a38c9354bdf4185bfb16521ddfceb91..fcf9e1559aea8b890e33ae6c9cdd951642ccdd44 100644 --- a/drivers/media/rc/mceusb.c +++ b/drivers/media/rc/mceusb.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -1126,7 +1127,7 @@ static int mceusb_set_rx_carrier_report(struct rc_dev *dev, int enable) MCE_CMD_SETIRRXPORTEN, 0x00 }; dev_dbg(ir->dev, "%s short-range receiver carrier reporting", - enable ? "enable" : "disable"); + str_enable_disable(enable)); if (enable) { ir->carrier_report_enabled = true; if (!ir->learning_active) { diff --git a/drivers/media/rc/serial_ir.c b/drivers/media/rc/serial_ir.c index fc5fd39271772013c78c466a5c322b4a04ec8d69..f9ec2f043529cbed1e3f4dfd805c3d27919954d4 100644 --- a/drivers/media/rc/serial_ir.c +++ b/drivers/media/rc/serial_ir.c @@ -25,6 +25,7 @@ #include #include #include +#include #include struct serial_ir_hw { @@ -588,10 +589,10 @@ static int serial_ir_probe(struct platform_device *dev) } sense = nlow >= nhigh ? 1 : 0; dev_info(&dev->dev, "auto-detected active %s receiver\n", - sense ? "low" : "high"); + str_low_high(sense)); } else dev_info(&dev->dev, "Manually using active %s receiver\n", - sense ? "low" : "high"); + str_low_high(sense)); dev_dbg(&dev->dev, "Interrupt %d, port %04x obtained\n", irq, io); diff --git a/drivers/media/tuners/tda18250.c b/drivers/media/tuners/tda18250.c index 68d0275f29e1b789ca1687283996c43ea3bacafc..1cfc0e3bfab455faee1da44de0ac5a473c68edc5 100644 --- a/drivers/media/tuners/tda18250.c +++ b/drivers/media/tuners/tda18250.c @@ -7,6 +7,7 @@ #include "tda18250_priv.h" #include +#include static const struct dvb_tuner_ops tda18250_ops; @@ -107,7 +108,7 @@ static int tda18250_wait_for_irq(struct dvb_frontend *fe, dev_dbg(&client->dev, "waited IRQ (0x%02x) %d ms, triggered: %s", irq, jiffies_to_msecs(jiffies) - (jiffies_to_msecs(timeout) - maxwait), - triggered ? "true" : "false"); + str_true_false(triggered)); if (!triggered) return -ETIMEDOUT; diff --git a/drivers/media/tuners/tda9887.c b/drivers/media/tuners/tda9887.c index b2f7054c1832cef3610f38f2ff1421b01e7892c7..d1f9ef30782b5244083a1345def8cb8c2f343f44 100644 --- a/drivers/media/tuners/tda9887.c +++ b/drivers/media/tuners/tda9887.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -291,11 +292,11 @@ static void dump_read_message(struct dvb_frontend *fe, unsigned char *buf) "+ 12.5 kHz", }; tuner_info("read: 0x%2x\n", buf[0]); - tuner_info(" after power on : %s\n", (buf[0] & 0x01) ? "yes" : "no"); + tuner_info(" after power on : %s\n", str_yes_no(buf[0] & 0x01)); tuner_info(" afc : %s\n", afc[(buf[0] >> 1) & 0x0f]); - tuner_info(" fmif level : %s\n", (buf[0] & 0x20) ? "high" : "low"); + tuner_info(" fmif level : %s\n", str_high_low(buf[0] & 0x20)); tuner_info(" afc window : %s\n", (buf[0] & 0x40) ? "in" : "out"); - tuner_info(" vfi level : %s\n", (buf[0] & 0x80) ? "high" : "low"); + tuner_info(" vfi level : %s\n", str_high_low(buf[0] & 0x80)); } static void dump_write_message(struct dvb_frontend *fe, unsigned char *buf) @@ -344,13 +345,13 @@ static void dump_write_message(struct dvb_frontend *fe, unsigned char *buf) tuner_info(" B0 video mode : %s\n", (buf[1] & 0x01) ? "video trap" : "sound trap"); tuner_info(" B1 auto mute fm : %s\n", - (buf[1] & 0x02) ? "yes" : "no"); + str_yes_no(buf[1] & 0x02)); tuner_info(" B2 carrier mode : %s\n", (buf[1] & 0x04) ? "QSS" : "Intercarrier"); tuner_info(" B3-4 tv sound/radio : %s\n", sound[(buf[1] & 0x18) >> 3]); tuner_info(" B5 force mute audio: %s\n", - (buf[1] & 0x20) ? "yes" : "no"); + str_yes_no(buf[1] & 0x20)); tuner_info(" B6 output port 1 : %s\n", (buf[1] & 0x40) ? "high (inactive)" : "low (active)"); tuner_info(" B7 output port 2 : %s\n", From patchwork Tue Jan 14 19:46:20 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 857382 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BA83120C037 for ; Tue, 14 Jan 2025 19:46:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736884005; cv=none; b=FZN0bGArZEUf/hmTJqe925MI+4Oexl8XFPgok9vwd+al5VTM0nag1CP/EXiv5kb94wmOCIFAeWFrXYg3RO6iKUdGuRpRqZSVmPYo6yZYGUtQvJAxdwh7JpiTDMHzoLPF1NCfXEVORoFICB6TXAHLcQBpdKCWKv4qKbRNtyfonRo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736884005; c=relaxed/simple; bh=WbLymYMShlzUKl2D3s6BMuVinKFHumRl83lJ3jM2rGI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Dpw8I+kfCTrpnHc3xH6PBcsgbtYAe0fZvhvbwbWPgFjAsJFgK215hc/kJNoB7EteVo+YOyUnWvj+vpqoFjPiZPGAExiKwLdS35ctAVE2sJPok7eOqHH/2BvU5eEIUxcnHjUG2DbcwMWtNGuWA7lGDiUl10DG4eYg0wl90R++DlU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=oxCwXJ5o; arc=none smtp.client-ip=209.85.128.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="oxCwXJ5o" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-4363299010dso6378725e9.1 for ; Tue, 14 Jan 2025 11:46:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736884001; x=1737488801; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=lW1RPdJO28XgohYSkXkEoEhTdTmjERSuMwVKq1h1f3I=; b=oxCwXJ5oLOJk6ZEPX8t6Ywv9/X/NT5z2VuU925tm5Fzz4qfIMyU8ErE0kL8Qvjrn6V jrJo7s/jxMVlzOhs16/Bh7GvYdsprCv7p5KWOyTNmCIrPVgHX+v+aXp/YikkQp3Yw8aB 3W7zW40mX/kf41K/CnV4gk02o/qp9yb93PAkjOgpJ3xg+KSWc4yIUwbfQ0Nx5FcWgEDa wI/VOJDpiJDxm4bZ/BmQhSYsnVXYvLTx5iBL7Sfqi9dpWs7OzO5x48wLka6Kpn2re63w iyt/uduO5BKI2uCF3pQWwlFcAGT/Lg3z6msbzrfv5uJfHLRf1xETCmWyth11cI8jHJyB pE2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736884001; x=1737488801; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lW1RPdJO28XgohYSkXkEoEhTdTmjERSuMwVKq1h1f3I=; b=Ve+TArSCAyv2fvcB5cXdgOFg0/ebEZD5TNTYtkivVRtJtvm3ACOqPlseKsa4nBsKjZ UiTQ8Q1SoMp/acg66BPzYZ3As+Gw6ZTW0I85CnY6lrm0CKcKlKWKhPF9g68CjIKPJ2Qw mTkOhqXuQbktlxwhJiA+yNN74nij6bJ5nrh8Qsx4Pz4E/WYvJtS/wmiIajPkmIuyN/eA xpmvrvJ6pdUm3CdX+EqXZe4mTpPzfhqEMl9WPURwmelPrzKi8TqGNWt+hYuB1YrY+lJ3 aFhQHH2WgIbI6F9Y5dqAIKBnNwnN9Qy52Cv74bfl4g5BmualVWRKtXY5Z8k0U97ImII9 e+5w== X-Gm-Message-State: AOJu0YxtGkx/GgFC2s6FdjLHXZa9I4JVLBtjTZKMRR5qSgwZ24gi4K3v q3Wssp0fUCs6U4OTMrE5/+qytIUIAMkZJHaf98jjcJGf46w5vnBxd+oPMvrZX4M= X-Gm-Gg: ASbGncvGCIJOTS4FKghzjRFppJflVRAJmzFDUUqmAIvIhZ+fqilZBzv+te4DYdVPqkj O+O4yLY9HbQalFX83fRkh+YhPL1skBpS4dTXkUSkiuyVTFRRuzMuz2grNBiCc16RldtJTuFekcC ohRg80N0+KY2kQhjvbc71OQrXDkRvYG3/S0BR3n0hRHko4/Rg1BZB3qmr/wfo8oYUS6PLj/p9Sz YN4HhwpynnR/gvgsnVjPt1Rklp8en/wWbiWd3VT7+E9+sOnhXqUjUX3XaTXNbOSPhb3M4A/ X-Google-Smtp-Source: AGHT+IGGG5GPUhMo1YJf0Z9vXxXLjktJfiE6m89IiYFvnQlQEPy8Ey1Xhvo+Kexsjl7OSohZcbwJpA== X-Received: by 2002:a05:600c:4e52:b0:434:a339:ec67 with SMTP id 5b1f17b1804b1-436eba35780mr82786225e9.3.1736884000979; Tue, 14 Jan 2025 11:46:40 -0800 (PST) Received: from [127.0.1.1] ([178.197.223.165]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e9e37c2esm184337515e9.28.2025.01.14.11.46.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 11:46:40 -0800 (PST) From: Krzysztof Kozlowski Date: Tue, 14 Jan 2025 20:46:20 +0100 Subject: [PATCH 4/6] media: pci: Use str_enable_disable-like helpers Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250114-str-enable-disable-media-v1-4-9316270aa65f@linaro.org> References: <20250114-str-enable-disable-media-v1-0-9316270aa65f@linaro.org> In-Reply-To: <20250114-str-enable-disable-media-v1-0-9316270aa65f@linaro.org> To: Hans Verkuil , Mauro Carvalho Chehab , Tomasz Figa , Marek Szyprowski , Maxim Levitsky , Sean Young , Olli Salonen , Abylay Ospan , Jemma Denson , Patrick Boettcher , Jacopo Mondi , Kieran Bingham , Laurent Pinchart , =?utf-8?q?Ni?= =?utf-8?q?klas_S=C3=B6derlund?= , Tim Harvey , Andy Walls , Sakari Ailus , Bingbu Cao Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=18328; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=WbLymYMShlzUKl2D3s6BMuVinKFHumRl83lJ3jM2rGI=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBnhr8SZ3nNtwMjkF+RaV9wL2nhTZvxvg9kpg65C 1b37w46FHqJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZ4a/EgAKCRDBN2bmhouD 16UUD/0Vf5yzQubPciAGEQ5MQ4cu7mYiBSfcPM18nfEu1AuCnN2OTZ3AuaIKrsIsHj4l3q6t5v/ h7UfNhL36kFAjwKtZugGN4Ijsf1xmDauFQMukuGki2+cXwFZJBs2mC+UnXAZJ94jYmWrSoCc8e4 g/ZmyKbgM7pMWxgraymA6VJj9InTaWcB4rHoDHaCsmlde7/vFBycWSs8KMe6ajog91fmSjSKNSJ f0oGe74Tka2oLNVx6J7hgQUSbzSvJ6VYi25VKivqb7RIAlsOmmIyAPl9p74iUYnh/EyVAn2BtA8 NZg0N5TwmBvB1XGK6V9C5i+JFnGGOYQj7mH+ywW9CpEflz7IMVZFyCMZVxe7Y2KJzywcvWobj9z ZGqeCSu+sEfQss6sJIkjWpjogchvhUS4GND39W9mlopvY6Btw20EyBmETzr+sSMuaQRMaMMGvdt 9Qh7Xctu4EaJyCGPLVRcf6AEOtoqAQR0IQb06Ie6NUCH1MCsfgTX2xzXQSLc2gwfnob+mXnS2l6 RnFfMCBKFET/LHj80Jxal6JkLWiT7eOuveAl8Q8PyIKcloS7ipAVLwPVYySrlNOUyji0Ojj8wpp wfPHJ2TyxgJHb/CzABCfD1g+haZsG34lGBLRIsRS+ER7cTkWoZJabs1JGuRj5BHwWVmypFUkpOc 0oYR9VK6HCtuF0Q== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B Replace ternary (condition ? "enable" : "disable") syntax with helpers from string_choices.h because: 1. Simple function call with one argument is easier to read. Ternary operator has three arguments and with wrapping might lead to quite long code. 2. Is slightly shorter thus also easier to read. 3. It brings uniformity in the text - same string. 4. Allows deduping by the linker, which results in a smaller binary file. Signed-off-by: Krzysztof Kozlowski --- drivers/media/pci/bt8xx/bttv-cards.c | 17 ++++++------ drivers/media/pci/bt8xx/bttv-driver.c | 7 +++-- drivers/media/pci/cobalt/cobalt-driver.c | 3 ++- drivers/media/pci/cx18/cx18-av-core.c | 5 ++-- drivers/media/pci/cx23885/altera-ci.c | 3 ++- drivers/media/pci/cx23885/cimax2.c | 3 ++- drivers/media/pci/cx23885/cx23888-ir.c | 37 ++++++++++++++------------- drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c | 3 ++- drivers/media/pci/ivtv/ivtv-ioctl.c | 3 ++- drivers/media/pci/saa7134/saa7134-cards.c | 4 +-- drivers/media/pci/saa7134/saa7134-dvb.c | 3 ++- drivers/media/pci/saa7134/saa7134-input.c | 7 ++--- drivers/media/pci/saa7134/saa7134-video.c | 3 ++- 13 files changed, 54 insertions(+), 44 deletions(-) diff --git a/drivers/media/pci/bt8xx/bttv-cards.c b/drivers/media/pci/bt8xx/bttv-cards.c index 365b04e5ae4d27e7f7b092ce69575d938381570c..5d1b08aae077090221d7a284a3614c12db9dc495 100644 --- a/drivers/media/pci/bt8xx/bttv-cards.c +++ b/drivers/media/pci/bt8xx/bttv-cards.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -3036,12 +3037,12 @@ static void flyvideo_gpio(struct bttv *btv) tuner_type = TUNER_ABSENT; /* No tuner present */ pr_info("%d: FlyVideo Radio=%s RemoteControl=%s Tuner=%d gpio=0x%06x\n", - btv->c.nr, has_radio ? "yes" : "no", - has_remote ? "yes" : "no", tuner_type, gpio); + btv->c.nr, str_yes_no(has_radio), + str_yes_no(has_remote), tuner_type, gpio); pr_info("%d: FlyVideo LR90=%s tda9821/tda9820=%s capture_only=%s\n", - btv->c.nr, is_lr90 ? "yes" : "no", - has_tda9820_tda9821 ? "yes" : "no", - is_capture_only ? "yes" : "no"); + btv->c.nr, str_yes_no(is_lr90), + str_yes_no(has_tda9820_tda9821), + str_yes_no(is_capture_only)); if (tuner_type != UNSET) /* only set if known tuner autodetected, else let insmod option through */ btv->tuner_type = tuner_type; @@ -3137,7 +3138,7 @@ static void miro_pinnacle_gpio(struct bttv *btv) if (-1 != msp) btv->c.type = BTTV_BOARD_PINNACLEPRO; pr_info("%d: pinnacle/mt: id=%d info=\"%s\" radio=%s\n", - btv->c.nr, id, info, btv->has_radio ? "yes" : "no"); + btv->c.nr, id, info, str_yes_no(btv->has_radio)); btv->tuner_type = TUNER_MT2032; } } @@ -4077,8 +4078,8 @@ static void avermedia_eeprom(struct bttv *btv) } else pr_cont("Unknown type"); pr_cont(" radio:%s remote control:%s\n", - tuner_tv_fm ? "yes" : "no", - btv->has_remote ? "yes" : "no"); + str_yes_no(tuner_tv_fm), + str_yes_no(btv->has_remote)); } /* diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c index 2782832f5eb8f272cf9acf29d7b4c31620c99227..33921a636b86d9eccf5fbd9792e3fe716de5c65a 100644 --- a/drivers/media/pci/bt8xx/bttv-driver.c +++ b/drivers/media/pci/bt8xx/bttv-driver.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include "bttvp.h" @@ -2983,12 +2984,10 @@ static irqreturn_t bttv_irq(int irq, void *dev_id) bttv_print_irqbits(stat,astat); if (stat & BT848_INT_HLOCK) pr_cont(" HLOC => %s", - dstat & BT848_DSTATUS_HLOC - ? "yes" : "no"); + str_yes_no(dstat & BT848_DSTATUS_HLOC)); if (stat & BT848_INT_VPRES) pr_cont(" PRES => %s", - dstat & BT848_DSTATUS_PRES - ? "yes" : "no"); + str_yes_no(dstat & BT848_DSTATUS_PRES)); if (stat & BT848_INT_FMTCHG) pr_cont(" NUML => %s", dstat & BT848_DSTATUS_NUML diff --git a/drivers/media/pci/cobalt/cobalt-driver.c b/drivers/media/pci/cobalt/cobalt-driver.c index 39e25cc53edb976795319c63c91164bca31edc6f..7fadf588a20c033e80686d02ca79b8b6a16713aa 100644 --- a/drivers/media/pci/cobalt/cobalt-driver.c +++ b/drivers/media/pci/cobalt/cobalt-driver.c @@ -10,6 +10,7 @@ #include #include +#include #include #include #include @@ -260,7 +261,7 @@ static void msi_config_show(struct cobalt *cobalt, struct pci_dev *pci_dev) u32 adrs_l, adrs_h; pci_read_config_word(pci_dev, 0x52, &ctrl); - cobalt_info("MSI %s\n", ctrl & 1 ? "enable" : "disable"); + cobalt_info("MSI %s\n", str_enable_disable(ctrl & 1)); cobalt_info("MSI multiple message: Capable %u. Enable %u\n", (1 << ((ctrl >> 1) & 7)), (1 << ((ctrl >> 4) & 7))); if (ctrl & 0x80) diff --git a/drivers/media/pci/cx18/cx18-av-core.c b/drivers/media/pci/cx18/cx18-av-core.c index ee6e71157786ed04ddc5228dac1608bfdf56a7da..ad7bb4d9a8fa78d726f9892bf94be4c56747cc82 100644 --- a/drivers/media/pci/cx18/cx18-av-core.c +++ b/drivers/media/pci/cx18/cx18-av-core.c @@ -8,6 +8,7 @@ * Copyright (C) 2008 Andy Walls */ +#include #include "cx18-driver.h" #include "cx18-io.h" #include "cx18-cards.h" @@ -1010,7 +1011,7 @@ static int cx18_av_s_stream(struct v4l2_subdev *sd, int enable) { struct cx18 *cx = v4l2_get_subdevdata(sd); - CX18_DEBUG_INFO_DEV(sd, "%s output\n", enable ? "enable" : "disable"); + CX18_DEBUG_INFO_DEV(sd, "%s output\n", str_enable_disable(enable)); if (enable) { cx18_av_write(cx, 0x115, 0x8c); cx18_av_write(cx, 0x116, 0x07); @@ -1115,7 +1116,7 @@ static void log_audio_status(struct cx18 *cx) } CX18_INFO_DEV(sd, "Detected audio standard: %s\n", p); CX18_INFO_DEV(sd, "Audio muted: %s\n", - (mute_ctl & 0x2) ? "yes" : "no"); + str_yes_no(mute_ctl & 0x2)); CX18_INFO_DEV(sd, "Audio microcontroller: %s\n", (download_ctl & 0x10) ? "running" : "stopped"); diff --git a/drivers/media/pci/cx23885/altera-ci.c b/drivers/media/pci/cx23885/altera-ci.c index 0dc348215b72d0666fd43ddc87629441784484ab..cf490d2bd476e641a163ca5c079112f90f4ee916 100644 --- a/drivers/media/pci/cx23885/altera-ci.c +++ b/drivers/media/pci/cx23885/altera-ci.c @@ -41,6 +41,7 @@ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt +#include #include #include #include "altera-ci.h" @@ -282,7 +283,7 @@ static int altera_ci_op_cam(struct dvb_ca_en50221 *en50221, int slot, mutex_unlock(&inter->fpga_mutex); ci_dbg_print("%s: %s: addr=[0x%02x], %s=%x\n", __func__, - (read) ? "read" : "write", addr, + str_read_write(read), addr, (flag == NETUP_CI_FLG_CTL) ? "ctl" : "mem", (read) ? mem : val); diff --git a/drivers/media/pci/cx23885/cimax2.c b/drivers/media/pci/cx23885/cimax2.c index 06e41f92092dd0283bc04aeef58a207a18c962bc..8d76b436dea2f598a48c166bfadbaa3bb604c30f 100644 --- a/drivers/media/pci/cx23885/cimax2.c +++ b/drivers/media/pci/cx23885/cimax2.c @@ -11,6 +11,7 @@ #include "cx23885.h" #include "cimax2.h" +#include #include /* Max transfer size done by I2C transfer functions */ @@ -224,7 +225,7 @@ static int netup_ci_op_cam(struct dvb_ca_en50221 *en50221, int slot, return -EREMOTEIO; ci_dbg_print("%s: %s: chipaddr=[0x%x] addr=[0x%02x], %s=%x\n", __func__, - (read) ? "read" : "write", state->ci_i2c_addr, addr, + str_read_write(read), state->ci_i2c_addr, addr, (flag == NETUP_CI_CTL) ? "ctl" : "mem", (read) ? mem : data); diff --git a/drivers/media/pci/cx23885/cx23888-ir.c b/drivers/media/pci/cx23885/cx23888-ir.c index 222d04421468e998dd02fdcf0784bce9fb7f2794..8d24f059cc8cc5f6dcebc229f0f76e9336ac6ff1 100644 --- a/drivers/media/pci/cx23885/cx23888-ir.c +++ b/drivers/media/pci/cx23885/cx23888-ir.c @@ -12,6 +12,7 @@ #include #include +#include #include #include @@ -930,11 +931,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 +994,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 +1038,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; } diff --git a/drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c b/drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c index 051898ce53f439a68aff72c6c01978f7ce1de6fa..029561d84ad53c057c839f9cfaf0777f314c3738 100644 --- a/drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c +++ b/drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -244,7 +245,7 @@ static int ipu6_isys_csi2_set_stream(struct v4l2_subdev *sd, u32 mask = 0; u32 i; - dev_dbg(dev, "stream %s CSI2-%u with %u lanes\n", enable ? "on" : "off", + dev_dbg(dev, "stream %s CSI2-%u with %u lanes\n", str_on_off(enable), csi2->port, nlanes); cfg.port = csi2->port; diff --git a/drivers/media/pci/ivtv/ivtv-ioctl.c b/drivers/media/pci/ivtv/ivtv-ioctl.c index 7947dcd615e882da5240ed6b10dde8449036d019..ea8bb4f3669544780ad7b5502756ff382b27c8dd 100644 --- a/drivers/media/pci/ivtv/ivtv-ioctl.c +++ b/drivers/media/pci/ivtv/ivtv-ioctl.c @@ -20,6 +20,7 @@ #include "ivtv-gpio.h" #include "ivtv-controls.h" #include "ivtv-cards.h" +#include #include #include #include @@ -1558,7 +1559,7 @@ static int ivtv_log_status(struct file *file, void *fh) ivtv_vapi_result(itv, data, CX2341X_OSD_GET_STATE, 0); data[0] |= (read_reg(0x2a00) >> 7) & 0x40; IVTV_INFO("Overlay: %s, Alpha: %s, Pixel Format: %s\n", - data[0] & 1 ? "On" : "Off", + str_on_off(data[0] & 1), alpha_mode[(data[0] >> 1) & 0x3], pixel_format[(data[0] >> 3) & 0xf]); } diff --git a/drivers/media/pci/saa7134/saa7134-cards.c b/drivers/media/pci/saa7134/saa7134-cards.c index e80fb4ebfda61b614c73c5273b51acd4edf279bd..148cd43612a2df74135a2441a975c545ebdcc6ec 100644 --- a/drivers/media/pci/saa7134/saa7134-cards.c +++ b/drivers/media/pci/saa7134/saa7134-cards.c @@ -14,6 +14,7 @@ #include #include #include +#include #include "xc2028.h" #include @@ -7980,8 +7981,7 @@ int saa7134_board_init2(struct saa7134_dev *dev) msg.flags = I2C_M_RD; rc = i2c_transfer(&dev->i2c_adap, &msg, 1); pr_info("%s: probe IR chip @ i2c 0x%02x: %s\n", - dev->name, msg.addr, - (1 == rc) ? "yes" : "no"); + dev->name, msg.addr, str_yes_no(rc == 1)); if (rc == 1) dev->has_remote = SAA7134_REMOTE_I2C; } diff --git a/drivers/media/pci/saa7134/saa7134-dvb.c b/drivers/media/pci/saa7134/saa7134-dvb.c index 6de8a02314af6a68e74c8c271e4d4e687a24576f..2827ae660632ed453d6bd556ceb3a32cf57e1d0a 100644 --- a/drivers/media/pci/saa7134/saa7134-dvb.c +++ b/drivers/media/pci/saa7134/saa7134-dvb.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -90,7 +91,7 @@ static int pinnacle_antenna_pwr(struct saa7134_dev *dev, int on) saa_setl(SAA7134_GPIO_GPSTATUS0 >> 2, (1 << 28)); udelay(10); ok = saa_readl(SAA7134_GPIO_GPSTATUS0) & (1 << 27); - pr_debug("%s %s\n", __func__, ok ? "on" : "off"); + pr_debug("%s %s\n", __func__, str_on_off(ok)); if (!ok) saa_clearl(SAA7134_GPIO_GPSTATUS0 >> 2, (1 << 26)); diff --git a/drivers/media/pci/saa7134/saa7134-input.c b/drivers/media/pci/saa7134/saa7134-input.c index 8610eb473b39e1e33e13abb21bcb985760f0221f..23c92a566a603ecb27397b01c184a418dd094849 100644 --- a/drivers/media/pci/saa7134/saa7134-input.c +++ b/drivers/media/pci/saa7134/saa7134-input.c @@ -12,6 +12,7 @@ #include #include #include +#include #define MODULE_NAME "saa7134" @@ -895,7 +896,7 @@ void saa7134_probe_i2c_ir(struct saa7134_dev *dev) rc = i2c_transfer(&dev->i2c_adap, &msg_msi, 1); input_dbg("probe 0x%02x @ %s: %s\n", msg_msi.addr, dev->i2c_adap.name, - (1 == rc) ? "yes" : "no"); + str_yes_no(rc == 1)); break; case SAA7134_BOARD_SNAZIO_TVPVR_PRO: dev->init_data.name = "SnaZio* TVPVR PRO"; @@ -916,7 +917,7 @@ void saa7134_probe_i2c_ir(struct saa7134_dev *dev) rc = i2c_transfer(&dev->i2c_adap, &msg_msi, 1); input_dbg("probe 0x%02x @ %s: %s\n", msg_msi.addr, dev->i2c_adap.name, - (rc == 1) ? "yes" : "no"); + str_yes_no(rc == 1)); break; case SAA7134_BOARD_KWORLD_PC150U: /* copied and modified from MSI TV@nywhere Plus */ @@ -931,7 +932,7 @@ void saa7134_probe_i2c_ir(struct saa7134_dev *dev) rc = i2c_transfer(&dev->i2c_adap, &msg_msi, 1); input_dbg("probe 0x%02x @ %s: %s\n", msg_msi.addr, dev->i2c_adap.name, - (1 == rc) ? "yes" : "no"); + str_yes_no(rc == 1)); break; case SAA7134_BOARD_HAUPPAUGE_HVR1110: dev->init_data.name = saa7134_boards[dev->board].name; diff --git a/drivers/media/pci/saa7134/saa7134-video.c b/drivers/media/pci/saa7134/saa7134-video.c index 43e7b006eb596740771cf893d8fda39df0e4aff4..f36a666103b17d8c8b4d793c864d90fc003c17d0 100644 --- a/drivers/media/pci/saa7134/saa7134-video.c +++ b/drivers/media/pci/saa7134/saa7134-video.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -619,7 +620,7 @@ static int saa7134_enable_analog_tuner(struct saa7134_dev *dev) if (ret) { pr_err("Couldn't change link %s->%s to %s. Error %d\n", source->name, sink->name, - flags ? "enabled" : "disabled", + str_enabled_disabled(flags), ret); return ret; } From patchwork Tue Jan 14 19:46:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 857381 Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6A8B020C49E for ; Tue, 14 Jan 2025 19:46:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736884007; cv=none; b=TPsADE7XFOMSVebNds9hQvNlZuAg/dPB3sDHElHbOkstn8XBnBUdlnbabwCFFdLMcB+O31ycGJNP7VMwF++Ub7EOAgNA3/060jRYidgB3hMiItBjEv8fVFEkvGb8LeZFAjuPuhuzzDeS0MaKQZdxBtGCPARNzdK7zQWcU9x2oRg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736884007; c=relaxed/simple; bh=480j+MHZAugg7Y5+zl78Q0vJCjVjz+/xf8ocMQtjZNs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ZyL+18OPG+1z+hQXzGeDTsrmgfH4PJJELiFFSjGW39Itbsc6r9FZO9fpiFVoL94yIHOf75rcFOBE09nPyAxkzeYt8uODlkYWKwZpM5z+JG38KfkJuoF1rKc05275kMduKRdknjh1J4qkvlUl4i0TwKSxcyJgSPrc+2wAVXrhKEY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=p9D+xOh5; arc=none smtp.client-ip=209.85.221.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="p9D+xOh5" Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-385e0d47720so436830f8f.0 for ; Tue, 14 Jan 2025 11:46:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736884004; x=1737488804; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=QKxFhfTb4yo1YxqMn8taGRsFCw+s7rIE5P4nCcJaV/s=; b=p9D+xOh5fiCp/awCwd/TlQSMpM8hIZdRhf6+u2eUjKyqj72wSxwKLFSb2h3N/bMt1k KQ2XLtZeiuopLBjbtX4JX02D8/nU2PvDCMyqrk2ONnN9mir4WmJSrvSikOMSz2CDxK50 WzVrFjeKQmKD/Z+H24u+JIvK9PR14neuug113lWI4dRw2YFlpJpWo4PreR9tOYl/8NGJ 4V7v19YUr0+wWyUxrJBxXgSqe+vaqj0oYKU2HeF+ojbYXlhFalwFsS/sMpOtLRI3vMWD xLwkgqXS/apD2gFMo7Zjy9g6G2BvlOQuO+01yWdisyLv/k0wXqFanZ3yH7WyFOiINust eXtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736884004; x=1737488804; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QKxFhfTb4yo1YxqMn8taGRsFCw+s7rIE5P4nCcJaV/s=; b=rx/YEMAyyYAsvGXc3cNLsP4nZGTfuOHUoB2cBRhfEBIYQ4qIGBEwVFs7x8HN5LFYzr jQTTnNx5dfGS43MRNgApsBRo0JiZlXPn3W2lUAuzcpJZcOySDn94C86zpkLfh79eOrB9 xBv6Q0hGqwIDv+c4nHZQcB9scrN2IEGIc0X+g6xs58UzlxSK1xO8S2zMLq1EeDZvCKVP fHGbhmOHmBlEvtO5A/Als3DiIZ3VoWxARCSgX9bXQF/+XrOJ+Q/8lyn7OT7yJ4vRQMqV DPK/J/KLYSgjlTYwkrKAFBWVZNEVwlLGedSkJBjTOmmquEeU0Kcy7jtTBwUrfvFnLpo0 t2Sg== X-Gm-Message-State: AOJu0YwIDN5WvLZ3q8TIlIG1h/KBT/1LJZlWNxYVazENH0D4KhPdMmfa xGoSCws++IIFtuWbO1XvS8TeMzk7clgrtPh4e4BG4mf/P526LTqGsCkjuVzzYns= X-Gm-Gg: ASbGncsoXLngRWlrO0nnt8U9kk7iyUtbltdWd8ihSW9eYxawbX7/z9tjlsZM4bBk3Nq fy5iISNvC8aSw8/jfoYOo1X89MZhMtZUJVDDMhz47tEwxDy0ALKMlId7N5QYOPxTFY2dCv6/JHN llaGVMuWymGFyNt+wPQX1bBmnr2DZyipnnibATDocQ3jjPg4P8URAgtC203U+2/Uv2hkr14Iam3 IIJ+37SnSDasXtpSEmBbXwppCQKQCSZCrwE4zmQKIkHzSSEOj2xM//p0dgkj9OQl0Gt6cB+ X-Google-Smtp-Source: AGHT+IHIqPJR45ZJSofiCkjdiL+75NeCbiFkrzobmUhQ6+Goug5A0DldQrwST77JXwNbfHZhZKFFqA== X-Received: by 2002:a05:600c:3b08:b0:42c:c0d8:bf49 with SMTP id 5b1f17b1804b1-436e2560720mr96529645e9.0.1736884003626; Tue, 14 Jan 2025 11:46:43 -0800 (PST) Received: from [127.0.1.1] ([178.197.223.165]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e9e37c2esm184337515e9.28.2025.01.14.11.46.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 11:46:42 -0800 (PST) From: Krzysztof Kozlowski Date: Tue, 14 Jan 2025 20:46:21 +0100 Subject: [PATCH 5/6] media: platform: Use str_enable_disable-like helpers Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250114-str-enable-disable-media-v1-5-9316270aa65f@linaro.org> References: <20250114-str-enable-disable-media-v1-0-9316270aa65f@linaro.org> In-Reply-To: <20250114-str-enable-disable-media-v1-0-9316270aa65f@linaro.org> To: Hans Verkuil , Mauro Carvalho Chehab , Tomasz Figa , Marek Szyprowski , Maxim Levitsky , Sean Young , Olli Salonen , Abylay Ospan , Jemma Denson , Patrick Boettcher , Jacopo Mondi , Kieran Bingham , Laurent Pinchart , =?utf-8?q?Ni?= =?utf-8?q?klas_S=C3=B6derlund?= , Tim Harvey , Andy Walls , Sakari Ailus , Bingbu Cao Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=11675; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=480j+MHZAugg7Y5+zl78Q0vJCjVjz+/xf8ocMQtjZNs=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBnhr8TVLOLDoSwzOCF05fTFhUsAfhINRWcwUoRL QqE4tGn4WKJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZ4a/EwAKCRDBN2bmhouD 1zBuEACYkrjaDpY2dKwB8LHyFzrGMOiPT2fOt6Ssapvan1y2YKzJFX487gbdEK5iYBeOZiHXIwP DDFEhlCLLa0JmLYIQMPFEC0GAxcLiXs9gZFp9z8jt/50Du0AxlX+7Ni5E9vPfG+9uGmFqYIM2DG G8lCTyunu/2/SJnQQvtjf+ojCurrqlR6VkbjakHBhqtbtvo+MilBLyJuognXQqbVwJa/j6iSkco H5nrY5aMKr8GwREBxvmCkz1Asn3PEktepExjQlvyTD6Q4oAR2ULMqqNkGr49HDv1yOjhzaCrblz DHU8xcnwTlU5Jdw4MpL7/bBWjgnCO8fLGFWIZPLj50wMTR9zHxGiepg09+FQyMXA8O6vTEVKEw/ DgGX6BidEorNlbrzCFBSPkOxyBU1K9XrYr2Jw6QCrGtQB0+Xp5NRIqyu3LUZVeOps81G+f7L9dS HaZmkpseLX++JL2s913XyhMQJ0tMhG4WL3kZRuHcDTb2oIwCwcjyd2PDn5iRlUQSknRWiw+A0Sb JzPnFwTCu+hxgfNm5ZYFXvmuXp8JzqRdIfVnvCInGfzAtQmTOH4pdCQkLUCTaNaSBb2bCtdwdZu OtEPQRlBQyBa6bo51/Za+5OrtcgfSDnWF9lr30Q8rx8qk/LRDcJP0jICDa/slDgegYy69LjN9od cJnDXh8sQFcGZVQ== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B Replace ternary (condition ? "enable" : "disable") syntax with helpers from string_choices.h because: 1. Simple function call with one argument is easier to read. Ternary operator has three arguments and with wrapping might lead to quite long code. 2. Is slightly shorter thus also easier to read. 3. It brings uniformity in the text - same string. 4. Allows deduping by the linker, which results in a smaller binary file. Signed-off-by: Krzysztof Kozlowski --- drivers/media/platform/amphion/venc.c | 3 ++- drivers/media/platform/amphion/vpu_dbg.c | 3 ++- drivers/media/platform/aspeed/aspeed-video.c | 5 +++-- drivers/media/platform/chips-media/coda/coda-bit.c | 3 ++- drivers/media/platform/chips-media/coda/imx-vdoa.c | 3 ++- drivers/media/platform/st/sti/hva/hva-debugfs.c | 7 ++++--- drivers/media/platform/ti/cal/cal-camerarx.c | 3 ++- drivers/media/platform/ti/omap3isp/ispstat.c | 3 ++- drivers/media/platform/xilinx/xilinx-csi2rxss.c | 19 ++++++++++--------- 9 files changed, 29 insertions(+), 20 deletions(-) diff --git a/drivers/media/platform/amphion/venc.c b/drivers/media/platform/amphion/venc.c index c5c1f1fbaa80366d5b18b8f24699eb9c3a18ef92..65b1665eece8cd6efc535281b3be593abaf9ba64 100644 --- a/drivers/media/platform/amphion/venc.c +++ b/drivers/media/platform/amphion/venc.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -1215,7 +1216,7 @@ static int venc_get_debug_info(struct vpu_inst *inst, char *str, u32 size, u32 i break; case 8: num = scnprintf(str, size, "rc: %s, mode = %d, bitrate = %d(%d), qp = %d\n", - venc->params.rc_enable ? "enable" : "disable", + str_enable_disable(venc->params.rc_enable), venc->params.rc_mode, venc->params.bitrate, venc->params.bitrate_max, diff --git a/drivers/media/platform/amphion/vpu_dbg.c b/drivers/media/platform/amphion/vpu_dbg.c index 940e5bda5fa391c47552c275bd1266f47d57f475..b726d884086d306cd4298dc46440a2235b311b86 100644 --- a/drivers/media/platform/amphion/vpu_dbg.c +++ b/drivers/media/platform/amphion/vpu_dbg.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include "vpu.h" @@ -256,7 +257,7 @@ static int vpu_dbg_core(struct seq_file *s, void *data) return 0; num = scnprintf(str, sizeof(str), "power %s\n", - vpu_iface_get_power_state(core) ? "on" : "off"); + str_on_off(vpu_iface_get_power_state(core))); if (seq_write(s, str, num)) return 0; num = scnprintf(str, sizeof(str), "state = %d\n", core->state); diff --git a/drivers/media/platform/aspeed/aspeed-video.c b/drivers/media/platform/aspeed/aspeed-video.c index 54cae0da9aca3fd74800b51f79136a261aec241a..d9cf12af05b75c76c506f6e7d72dfc41c9e05317 100644 --- a/drivers/media/platform/aspeed/aspeed-video.c +++ b/drivers/media/platform/aspeed/aspeed-video.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -1227,7 +1228,7 @@ static void aspeed_video_update_regs(struct aspeed_video *video) v4l2_dbg(1, debug, &video->v4l2_dev, "compression quality(%d)\n", video->jpeg_quality); v4l2_dbg(1, debug, &video->v4l2_dev, "hq_mode(%s) hq_quality(%d)\n", - video->hq_mode ? "on" : "off", video->jpeg_hq_quality); + str_on_off(video->hq_mode), video->jpeg_hq_quality); if (video->format == VIDEO_FMT_ASPEED) aspeed_video_update(video, VE_BCD_CTRL, 0, VE_BCD_CTRL_EN_BCD); @@ -1939,7 +1940,7 @@ static int aspeed_video_debugfs_show(struct seq_file *s, void *data) seq_printf(s, " %-20s:\t%d\n", "Quality", v->jpeg_quality); if (v->format == VIDEO_FMT_ASPEED) { seq_printf(s, " %-20s:\t%s\n", "HQ Mode", - v->hq_mode ? "on" : "off"); + str_on_off(v->hq_mode)); seq_printf(s, " %-20s:\t%d\n", "HQ Quality", v->hq_mode ? v->jpeg_hq_quality : 0); } diff --git a/drivers/media/platform/chips-media/coda/coda-bit.c b/drivers/media/platform/chips-media/coda/coda-bit.c index 84ded154adfe37147218d60278a1c1fac88ecadc..2cb0c04003da750f7108578e274da31778c3f2d2 100644 --- a/drivers/media/platform/chips-media/coda/coda-bit.c +++ b/drivers/media/platform/chips-media/coda/coda-bit.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -1881,7 +1882,7 @@ static int __coda_decoder_seq_init(struct coda_ctx *ctx) lockdep_assert_held(&dev->coda_mutex); coda_dbg(1, ctx, "Video Data Order Adapter: %s\n", - ctx->use_vdoa ? "Enabled" : "Disabled"); + str_enabled_disabled(ctx->use_vdoa)); /* Start decoding */ q_data_src = get_q_data(ctx, V4L2_BUF_TYPE_VIDEO_OUTPUT); diff --git a/drivers/media/platform/chips-media/coda/imx-vdoa.c b/drivers/media/platform/chips-media/coda/imx-vdoa.c index c3561fcecb98c7d3cd741c28afcb2a3854eaa0e7..abdff181d417788460b7f6230ea54789b242d436 100644 --- a/drivers/media/platform/chips-media/coda/imx-vdoa.c +++ b/drivers/media/platform/chips-media/coda/imx-vdoa.c @@ -15,6 +15,7 @@ #include #include #include +#include #include "imx-vdoa.h" @@ -117,7 +118,7 @@ static irqreturn_t vdoa_irq_handler(int irq, void *data) writel(val, vdoa->regs + VDOAIST); if (val & VDOAIST_TERR) { val = readl(vdoa->regs + VDOASR) & VDOASR_ERRW; - dev_err(vdoa->dev, "AXI %s error\n", val ? "write" : "read"); + dev_err(vdoa->dev, "AXI %s error\n", str_write_read(val)); } else if (!(val & VDOAIST_EOT)) { dev_warn(vdoa->dev, "Spurious interrupt\n"); } diff --git a/drivers/media/platform/st/sti/hva/hva-debugfs.c b/drivers/media/platform/st/sti/hva/hva-debugfs.c index a86a07b6fbc792fc06db2dbbb3934694136a7813..1cb5bca44939606f39911a41e5f464be888848c2 100644 --- a/drivers/media/platform/st/sti/hva/hva-debugfs.c +++ b/drivers/media/platform/st/sti/hva/hva-debugfs.c @@ -6,6 +6,7 @@ */ #include +#include #include "hva.h" #include "hva-hw.h" @@ -71,12 +72,12 @@ static void format_ctx(struct seq_file *s, struct hva_ctx *ctx) " | |- SEI frame packing type=%s\n", v4l2_ctrl_get_menu(entropy)[ctrls->entropy_mode], ctrls->cpb_size, - ctrls->dct8x8 ? "true" : "false", + str_true_false(ctrls->dct8x8), ctrls->qpmin, ctrls->qpmax, - ctrls->vui_sar ? "true" : "false", + str_true_false(ctrls->vui_sar), v4l2_ctrl_get_menu(vui_sar)[ctrls->vui_sar_idc], - ctrls->sei_fp ? "true" : "false", + str_true_false(ctrls->sei_fp), v4l2_ctrl_get_menu(sei_fp)[ctrls->sei_fp_type]); } diff --git a/drivers/media/platform/ti/cal/cal-camerarx.c b/drivers/media/platform/ti/cal/cal-camerarx.c index 42dfe08b765f6bbdb0ab8cca0f7d6d87f2ff18eb..a70814cbada82654e926b12bcde73300107aaa8a 100644 --- a/drivers/media/platform/ti/cal/cal-camerarx.c +++ b/drivers/media/platform/ti/cal/cal-camerarx.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -191,7 +192,7 @@ static void cal_camerarx_power(struct cal_camerarx *phy, bool enable) if (i == 10) phy_err(phy, "Failed to power %s complexio\n", - enable ? "up" : "down"); + str_up_down(enable)); } static void cal_camerarx_wait_reset(struct cal_camerarx *phy) diff --git a/drivers/media/platform/ti/omap3isp/ispstat.c b/drivers/media/platform/ti/omap3isp/ispstat.c index 359a846205b0ffe9e736c7ed37c22677991cc9f2..f1293d412415d3fe36a87e7aa93a60e7daf693d8 100644 --- a/drivers/media/platform/ti/omap3isp/ispstat.c +++ b/drivers/media/platform/ti/omap3isp/ispstat.c @@ -14,6 +14,7 @@ #include #include +#include #include #include @@ -768,7 +769,7 @@ int omap3isp_stat_enable(struct ispstat *stat, u8 enable) unsigned long irqflags; dev_dbg(stat->isp->dev, "%s: user wants to %s module.\n", - stat->subdev.name, enable ? "enable" : "disable"); + stat->subdev.name, str_enable_disable(enable)); /* Prevent enabling while configuring */ mutex_lock(&stat->ioctl_lock); diff --git a/drivers/media/platform/xilinx/xilinx-csi2rxss.c b/drivers/media/platform/xilinx/xilinx-csi2rxss.c index 146131b8f37e5a30b168164d4eaedc9641d6af31..a5074f05cee50e117256fdb8496b977332757e27 100644 --- a/drivers/media/platform/xilinx/xilinx-csi2rxss.c +++ b/drivers/media/platform/xilinx/xilinx-csi2rxss.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -400,19 +401,19 @@ static int xcsi2rxss_log_status(struct v4l2_subdev *sd) dev_info(dev, "***** Core Status *****\n"); data = xcsi2rxss_read(xcsi2rxss, XCSI_CSR_OFFSET); dev_info(dev, "Short Packet FIFO Full = %s\n", - data & XCSI_CSR_SPFIFOFULL ? "true" : "false"); + str_true_false(data & XCSI_CSR_SPFIFOFULL)); dev_info(dev, "Short Packet FIFO Not Empty = %s\n", - data & XCSI_CSR_SPFIFONE ? "true" : "false"); + str_true_false(data & XCSI_CSR_SPFIFONE)); dev_info(dev, "Stream line buffer full = %s\n", - data & XCSI_CSR_SLBF ? "true" : "false"); + str_true_false(data & XCSI_CSR_SLBF)); dev_info(dev, "Soft reset/Core disable in progress = %s\n", - data & XCSI_CSR_RIPCD ? "true" : "false"); + str_true_false(data & XCSI_CSR_RIPCD)); /* Clk & Lane Info */ dev_info(dev, "******** Clock Lane Info *********\n"); data = xcsi2rxss_read(xcsi2rxss, XCSI_CLKINFR_OFFSET); dev_info(dev, "Clock Lane in Stop State = %s\n", - data & XCSI_CLKINFR_STOP ? "true" : "false"); + str_true_false(data & XCSI_CLKINFR_STOP)); dev_info(dev, "******** Data Lane Info *********\n"); dev_info(dev, "Lane\tSoT Error\tSoT Sync Error\tStop State\n"); @@ -421,9 +422,9 @@ static int xcsi2rxss_log_status(struct v4l2_subdev *sd) data = xcsi2rxss_read(xcsi2rxss, reg); dev_info(dev, "%d\t%s\t\t%s\t\t%s\n", i, - data & XCSI_DLXINFR_SOTERR ? "true" : "false", - data & XCSI_DLXINFR_SOTSYNCERR ? "true" : "false", - data & XCSI_DLXINFR_STOP ? "true" : "false"); + str_true_false(data & XCSI_DLXINFR_SOTERR), + str_true_false(data & XCSI_DLXINFR_SOTSYNCERR), + str_true_false(data & XCSI_DLXINFR_STOP)); reg += XCSI_NEXTREG_OFFSET; } @@ -889,7 +890,7 @@ static int xcsi2rxss_parse_of(struct xcsi2rxss_state *xcsi2rxss) fwnode_handle_put(ep); dev_dbg(dev, "vcx %s, %u data lanes (%s), data type 0x%02x\n", - xcsi2rxss->en_vcx ? "enabled" : "disabled", + str_enabled_disabled(xcsi2rxss->en_vcx), xcsi2rxss->max_num_lanes, xcsi2rxss->enable_active_lanes ? "dynamic" : "static", xcsi2rxss->datatype);