From patchwork Mon Sep 30 12:04:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816051 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 3A54BCF6499 for ; Mon, 30 Sep 2024 12:14:07 +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=Oi1bEzb1SAt3y006RY0yDL5v/D/r838jI6u8v0CE/P0=; b=niIxXlvcW4wsPNQ9r5eJYHXD57 HRMRx4bPpiq+kNz+awk5ag3nxGgRtLpFtQqHEBeadCIQgsusgN6IEJx6I1I0XYbAvxUoFaLW407cq RNFkKFh2sx1DfQCPkcc6Ty+a/LLusv+HnYZ89rLiOzO9r/RHx/qkEOpLfMLjUQ5ohG7ckl1ZzHmSj sLvLQS0qBO8+M7UG+1znzem1J1f8pBHhCSw6fNFKLZEw0o3cO4ssOj9OqEuOWamkeA4aujf0IbTNS +Vo7kliOviy0oCFJc0hMWtMJSVQ+Yz/zo3meTJcRxLVQB6w1QIHhcc25dnzUu8TNo7Jw40BWygD3/ ubDgndsg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svFHq-0000000Gys1-0nDP; Mon, 30 Sep 2024 12:13:58 +0000 Received: from mail-qv1-xf2d.google.com ([2607:f8b0:4864:20::f2d]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svF8U-0000000GwE7-1G4M for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 12:04:19 +0000 Received: by mail-qv1-xf2d.google.com with SMTP id 6a1803df08f44-6cb3062d9b5so30251396d6.0 for ; Mon, 30 Sep 2024 05:04:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697857; x=1728302657; 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=Oi1bEzb1SAt3y006RY0yDL5v/D/r838jI6u8v0CE/P0=; b=i8jAFLtMts1fNnD1n9jIRhB+Ggn+0MekEc4LRuxSu/pIBxtLByG8jMBMJ5B707+5br ZdCPs3j1MI6M6SwG/KOBnv9vyMoSk29FQsKsj8ItpsqxfUl17iJJTshPjuVjf6AVvqCC bFULYDGYHZg+KRVh4EiutN8EcBLzQxHIc+bPQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697857; x=1728302657; 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=Oi1bEzb1SAt3y006RY0yDL5v/D/r838jI6u8v0CE/P0=; b=BenlovBT3OQXBFBF6sz+Hh7Byb/goayO9rGWj0Ak3NtzCiAsXZ+DI90Pzs1ik0Cqb5 DMScnssqSl63qh0BjiZj7CXKS2yBV81tYMr3w43/0a+o5MtfUXXDnq05AUlMqQx+gy9I aFnJYcqDBXUYcCJ12lV2hmO68xR8jTEMWosg5GQdKT+KPeIqKPFkTNgQ18jhbqwWCtf1 ZKGR4Sxr41nAAzKckHlc3304DVfuzkvJFobythyM4o0P3nSbY3hXJEq+oC3dGEVvLPlS b+sNQfSykmQ/LS86zUAZ5kPivda5VFl3F3gl/A/pxs44/A+Q7boP4rraEMp2d9B3QrNu ZVZA== X-Forwarded-Encrypted: i=1; AJvYcCWHE/CRJsptZYb66mThsP39LIdGRCBh67YrDSnOXlc3AqkUsvs2+WO3YJuayO4ZUjnGkct2CEBUYyQqz+gYlNlZ@lists.infradead.org X-Gm-Message-State: AOJu0YzFqa4tXpILrV6zGew5IsaaLfG/pigC5HVF4QWVfJHCGKltC9/e 27DfHcRhwThQetnlAL+5TVlkwNX3Q+8rFMjxLJsrM5XjUI2FZlVz8wselZwb0c3gCJv6R2d+Z7M = X-Google-Smtp-Source: AGHT+IEfJSXK0Wsel23PY6RuLEcqGR+eVsnaqOIyvQM277nf0XUs151BJ1cKdgq24SPhmJrtG19jVA== X-Received: by 2002:a05:6214:488f:b0:6cb:5fba:e006 with SMTP id 6a1803df08f44-6cb5fbae166mr61875236d6.29.1727697857240; Mon, 30 Sep 2024 05:04:17 -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.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:15 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:02 +0000 Subject: [PATCH 07/45] media: dvb-usb: Use string_choices helpers MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-7-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_050418_425485_564BEFAC X-CRM114-Status: GOOD ( 15.43 ) 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/usb/dvb-usb/opera1.c:326:26-31: opportunity for str_enable_disable(onoff) drivers/media/usb/dvb-usb/opera1.c:310:3-8: opportunity for str_on_off(onoff) drivers/media/usb/dvb-usb/opera1.c:283:19-24: opportunity for str_on_off(onoff) drivers/media/usb/dvb-usb/opera1.c:296:23-28: opportunity for str_on_off(onoff) drivers/media/usb/dvb-usb/dvb-usb-dvb.c:49:21-26: opportunity for str_on_off(onoff) drivers/media/usb/dvb-usb/dvb-usb-dvb.c:47:2-46: opportunity for str_yes_no(adap -> fe_adap [ adap -> active_fe ] . pid_filtering) drivers/media/usb/dvb-usb/af9005-fe.c:1282:27-31: opportunity for str_high_low(temp) drivers/media/usb/dvb-usb/af9005-fe.c:790:30-32: opportunity for str_on_off(on) Signed-off-by: Ricardo Ribalda --- drivers/media/usb/dvb-usb/af9005-fe.c | 4 ++-- drivers/media/usb/dvb-usb/dvb-usb-dvb.c | 6 +++--- drivers/media/usb/dvb-usb/opera1.c | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/media/usb/dvb-usb/af9005-fe.c b/drivers/media/usb/dvb-usb/af9005-fe.c index 404e56b32145..ea3aaf3a56cb 100644 --- a/drivers/media/usb/dvb-usb/af9005-fe.c +++ b/drivers/media/usb/dvb-usb/af9005-fe.c @@ -787,7 +787,7 @@ static int af9005_fe_power(struct dvb_frontend *fe, int on) struct af9005_fe_state *state = fe->demodulator_priv; u8 temp = on; int ret; - deb_info("power %s tuner\n", on ? "on" : "off"); + deb_info("power %s tuner\n", str_on_off(on)); ret = af9005_send_command(state->d, 0x03, &temp, 1, NULL, 0); return ret; } @@ -1279,7 +1279,7 @@ static int af9005_fe_get_frontend(struct dvb_frontend *fe, if (ret) return ret; /* if temp is set = high priority */ - deb_info("PRIORITY %s\n", temp ? "high" : "low"); + deb_info("PRIORITY %s\n", str_high_low(temp)); /* high coderate */ ret = diff --git a/drivers/media/usb/dvb-usb/dvb-usb-dvb.c b/drivers/media/usb/dvb-usb/dvb-usb-dvb.c index 0a7f8ba90992..b663c3dff25c 100644 --- a/drivers/media/usb/dvb-usb/dvb-usb-dvb.c +++ b/drivers/media/usb/dvb-usb/dvb-usb-dvb.c @@ -44,9 +44,9 @@ static int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff) /* activate the pid on the device specific pid_filter */ deb_ts("setting pid (%s): %5d %04x at index %d '%s'\n", - adap->fe_adap[adap->active_fe].pid_filtering ? - "yes" : "no", dvbdmxfeed->pid, dvbdmxfeed->pid, - dvbdmxfeed->index, onoff ? "on" : "off"); + str_yes_no(adap->fe_adap[adap->active_fe].pid_filtering), + dvbdmxfeed->pid, dvbdmxfeed->pid, + dvbdmxfeed->index, str_on_off(onoff)); if (adap->props.fe[adap->active_fe].caps & DVB_USB_ADAP_HAS_PID_FILTER && adap->fe_adap[adap->active_fe].pid_filtering && adap->props.fe[adap->active_fe].pid_filter != NULL) diff --git a/drivers/media/usb/dvb-usb/opera1.c b/drivers/media/usb/dvb-usb/opera1.c index 268f05fc8691..8412b64660d8 100644 --- a/drivers/media/usb/dvb-usb/opera1.c +++ b/drivers/media/usb/dvb-usb/opera1.c @@ -280,7 +280,7 @@ static int opera1_power_ctrl(struct dvb_usb_device *d, int onoff) u8 val = onoff ? 0x01 : 0x00; if (dvb_usb_opera1_debug) - info("power %s", onoff ? "on" : "off"); + info("power %s", str_on_off(onoff)); return opera1_xilinx_rw(d->udev, 0xb7, val, &val, 1, OPERA_WRITE_MSG); } @@ -293,7 +293,7 @@ static int opera1_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff) {.addr = ADDR_B1A6_STREAM_CTRL,.buf = onoff ? buf_start : buf_stop,.len = 2}, }; if (dvb_usb_opera1_debug) - info("streaming %s", onoff ? "on" : "off"); + info("streaming %s", str_on_off(onoff)); i2c_transfer(&adap->dev->i2c_adap, start_tuner, 1); return 0; } @@ -307,7 +307,7 @@ static int opera1_pid_filter(struct dvb_usb_adapter *adap, int index, u16 pid, }; if (dvb_usb_opera1_debug) info("pidfilter index: %d pid: %d %s", index, pid, - onoff ? "on" : "off"); + str_on_off(onoff)); b_pid[0] = (2 * index) + 4; b_pid[1] = onoff ? (pid & 0xff) : (0x00); b_pid[2] = onoff ? ((pid >> 8) & 0xff) : (0x00); @@ -323,7 +323,7 @@ static int opera1_pid_filter_control(struct dvb_usb_adapter *adap, int onoff) {.addr = ADDR_B1A6_STREAM_CTRL,.buf = b_pid,.len = 3}, }; if (dvb_usb_opera1_debug) - info("%s hw-pidfilter", onoff ? "enable" : "disable"); + info("%s hw-pidfilter", str_enable_disable(onoff)); for (; u < 0x7e; u += 2) { b_pid[0] = u; b_pid[1] = 0;