From patchwork Mon Sep 30 12:04:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816283 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3EDD2CF64A3 for ; Mon, 30 Sep 2024 12:53:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=D6BDeL6BkIVVZoPxqWDi9XtO0jTRkjdLrjdq1Zl6PH8=; b=yNttFGQPKU6fZHvmwwa+r7fihZ GSoAx8KoNV6WYIwdU1h5PkrFoygbNhbAKd7/L4VyOQx0TGb6S3z/oVY3ov3bs/SyRNw+HwYcSfzrF tj4pc58NhfJgnu4xwunBMY4TONHVUUMIoy0M62H2ZYfK++swXibeiM2QPg/FZB9JtR+P4vJRf+dqp mBqnV8bruSs4F/UFgdqidRiGsY836BLyCC57N+yaOS50dYFqzk2i7DQzuBS11ezpdYY0lZo9yd37E e2GmoN13eFU8X970iLyh6naTJsZIUnG1n6y50qyeO9eCr2mWBTIUf00qQTlqaCciApCeorp/CMseb d6IDy3rQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svFu3-0000000H9Ln-2a3e; Mon, 30 Sep 2024 12:53:27 +0000 Received: from mail-qv1-xf2a.google.com ([2607:f8b0:4864:20::f2a]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svF8i-0000000GwJG-21Fi for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 12:04:33 +0000 Received: by mail-qv1-xf2a.google.com with SMTP id 6a1803df08f44-6c582ca168fso30679066d6.2 for ; Mon, 30 Sep 2024 05:04:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697871; x=1728302671; darn=lists.infradead.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=D6BDeL6BkIVVZoPxqWDi9XtO0jTRkjdLrjdq1Zl6PH8=; b=HuTol52GXFR83gy/atC6TA1FIlteW8zUcu+oTAaFL6GUKxIYnptq0CipuxodFAyZeY 7oYhs0Rkl+Nhr9oQcQjL5uUKql87HNXeBZUdzDjQKUyRBI2l8Q/h9H0AYGW/Cxn11sno igLeNhjYL6XbP8X1tNOCsw/HHHFUzB4MRqJeM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697871; x=1728302671; 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=D6BDeL6BkIVVZoPxqWDi9XtO0jTRkjdLrjdq1Zl6PH8=; b=BLtcKW2AGv+w5N9gF5gi+U7VL+6mMUJuzsejWtzqdOb6O4s6w3j3MvHBZrLwzHC5ly D2gGlH9rulBtfpvBwc7hmNuJxVtIfscFqq70OiiEJ2cdIQ+hK7G0Uv1dcR8RoyOg8Y6R agnYS998vHxsDZr1oH2xyRyGj4BpmSP+REncqnnJnzYczgcTXkgoRLIyG/VXqvepEXei TpRgWzuJXBmoWQrMCKoWZ8vzW9/5mfGQi6gRdSOHbgjE4sXLcvIIH9/yh/Q/xuJwFmoT 9vA3CDwegIm3qMXw8YbzAJDo/ODLEJhByJeXVTuoY4Hv7fhG/OBhQKRrTgByRPS4LIHE +lrQ== X-Forwarded-Encrypted: i=1; AJvYcCVs3DfJGfnHfMzLzAaR6N+uZsu34BTqFdv21B2LA7ofokGjDxZ3adN6cLLpKN3R/5y+uSdVwyEWtVk888U5ED11@lists.infradead.org X-Gm-Message-State: AOJu0YwP3WFIcmc3cm4z7tzj3te3QxUhJRDqOTIF6kcmTamjb+rw6Ie9 i4Duq8NWdtpkIRPigD7/tn4O+qeENrmOgZeamYu+qh6/7AUTj+osWIWurHCZDQ== X-Google-Smtp-Source: AGHT+IFuhFd9qljS0j0XzT5b/G60bcWwlJPplwUn5ky0BXy/Gr7Rfi8yUN7cisKQypEqCOJiTUFoZA== X-Received: by 2002:a05:6214:448c:b0:6c4:6217:da9c with SMTP id 6a1803df08f44-6cb3b5da202mr213208266d6.17.1727697870958; Mon, 30 Sep 2024 05:04:30 -0700 (PDT) Received: from denia.c.googlers.com (76.224.245.35.bc.googleusercontent.com. [35.245.224.76]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6cb3b694369sm38822536d6.144.2024.09.30.05.04.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:29 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:08 +0000 Subject: [PATCH 13/45] media: pci: cx23885: Use string_choices helpers MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-13-81e137456ce0@chromium.org> References: <20240930-cocci-opportunity-v1-0-81e137456ce0@chromium.org> In-Reply-To: <20240930-cocci-opportunity-v1-0-81e137456ce0@chromium.org> To: Sakari Ailus , Bingbu Cao , Tianshu Qiu , Mauro Carvalho Chehab , Greg Kroah-Hartman , Hans de Goede , Andy Shevchenko , Hans Verkuil , Mike Isely , Olli Salonen , Maxim Levitsky , Sean Young , Sergey Kozlov , Abylay Ospan , Jemma Denson , Patrick Boettcher , Ming Qian , Zhou Peng , Andy Walls , Laurent Pinchart , Michal Simek , Jean-Christophe Trotin , Philipp Zabel , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Eddie James , Joel Stanley , Andrew Jeffery , Hans Verkuil , Tomasz Figa , Marek Szyprowski , Tim Harvey , Benjamin Mugnier , Sylvain Petinot , Jacopo Mondi , Kieran Bingham , Laurent Pinchart , =?utf-8?q?Ni?= =?utf-8?q?klas_S=C3=B6derlund?= Cc: linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, openbmc@lists.ozlabs.org, linux-aspeed@lists.ozlabs.org, Ricardo Ribalda X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240930_050432_570022_EEBCB75B X-CRM114-Status: GOOD ( 11.75 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The following cocci warnings are fixed: drivers/media/pci/cx23885/altera-ci.c:285:3-9: opportunity for str_read_write(( read )) drivers/media/pci/cx23885/cimax2.c:227:3-9: opportunity for str_read_write(( read )) drivers/media/pci/cx23885/cx23888-ir.c:996:4-9: opportunity for str_enabled_disabled(filtr) drivers/media/pci/cx23885/cx23888-ir.c:935:4-21: opportunity for str_enabled_disabled(cntrl & CNTRL_DMD) drivers/media/pci/cx23885/cx23888-ir.c:1020:4-21: opportunity for str_enabled_disabled(cntrl & CNTRL_MOD) drivers/media/pci/cx23885/cx23888-ir.c:937:4-21: opportunity for str_enabled_disabled(cntrl & CNTRL_RFE) drivers/media/pci/cx23885/cx23888-ir.c:1022:4-21: opportunity for str_enabled_disabled(cntrl & CNTRL_TFE) drivers/media/pci/cx23885/cx23888-ir.c:1008:4-21: opportunity for str_enabled_disabled(irqen & IRQEN_ROE) drivers/media/pci/cx23885/cx23888-ir.c:1014:4-21: opportunity for str_enabled_disabled(irqen & IRQEN_RSE) drivers/media/pci/cx23885/cx23888-ir.c:1004:4-21: opportunity for str_enabled_disabled(irqen & IRQEN_RTE) drivers/media/pci/cx23885/cx23888-ir.c:1044:4-21: opportunity for str_enabled_disabled(irqen & IRQEN_TSE) drivers/media/pci/cx23885/cx23888-ir.c:1026:4-21: opportunity for str_yes_no(cntrl & CNTRL_IVO) drivers/media/pci/cx23885/cx23888-ir.c:933:4-21: opportunity for str_yes_no(cntrl & CNTRL_RXE) drivers/media/pci/cx23885/cx23888-ir.c:1018:4-21: opportunity for str_yes_no(cntrl & CNTRL_TXE) drivers/media/pci/cx23885/cx23888-ir.c:1010:4-21: opportunity for str_yes_no(stats & STATS_RBY) drivers/media/pci/cx23885/cx23888-ir.c:1006:4-21: opportunity for str_yes_no(stats & STATS_ROR) drivers/media/pci/cx23885/cx23888-ir.c:1012:4-21: opportunity for str_yes_no(stats & STATS_RSR) drivers/media/pci/cx23885/cx23888-ir.c:1002:4-21: opportunity for str_yes_no(stats & STATS_RTO) drivers/media/pci/cx23885/cx23888-ir.c:1040:4-21: opportunity for str_yes_no(stats & STATS_TBY) drivers/media/pci/cx23885/cx23888-ir.c:1042:4-21: opportunity for str_yes_no(stats & STATS_TSR) Signed-off-by: Ricardo Ribalda --- drivers/media/pci/cx23885/altera-ci.c | 2 +- drivers/media/pci/cx23885/cimax2.c | 2 +- drivers/media/pci/cx23885/cx23888-ir.c | 36 +++++++++++++++++----------------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/drivers/media/pci/cx23885/altera-ci.c b/drivers/media/pci/cx23885/altera-ci.c index 0dc348215b72..e154a39d86ef 100644 --- a/drivers/media/pci/cx23885/altera-ci.c +++ b/drivers/media/pci/cx23885/altera-ci.c @@ -282,7 +282,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 06e41f92092d..458fa779274a 100644 --- a/drivers/media/pci/cx23885/cimax2.c +++ b/drivers/media/pci/cx23885/cimax2.c @@ -224,7 +224,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 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; }