From patchwork Mon Sep 30 12:04:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816098 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 4CD23CF64A0 for ; Mon, 30 Sep 2024 12:32:46 +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=w+lDXyICIHcG+x83IY7Td9H+I+izyCveuIAoXyx8Crg=; b=i1m0cqV0kSMk0kR7UmKluHGmwz 9ucUkBZ7McBm4r/ukx1vYQTbGec2Ls0g2e3BxczTjlUwFPK+Fg+W97d4LyS179DzxAGvIvvtBWDYw FE9kfwczNuMUwfM+GF4gpi8pxyqwJ9JayvFxfiAUebSZRI/uzEIXp+tWHyR2272knw1rOLeuCFGDA Wu/Owp23MNeg+f6vHqY96Ig4YfG9Eg318iuzwKEzai243qmSHhWfEw8jvi4lH09py1w1fWgiIs/Xw 5NubUmf3TmGahPpA0ocKQ7WGWVMDTzq8FvOJAXfTxSqbxfXPDcYGHGPaKS7JyZploWyoZR9N8I5uy EFALYbDg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svFZs-0000000H3rT-2dL6; Mon, 30 Sep 2024 12:32:36 +0000 Received: from mail-ot1-x336.google.com ([2607:f8b0:4864:20::336]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svF99-0000000GwX8-3P1Q for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 12:05:01 +0000 Received: by mail-ot1-x336.google.com with SMTP id 46e09a7af769-710e489860bso2171857a34.1 for ; Mon, 30 Sep 2024 05:04:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697898; x=1728302698; 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=w+lDXyICIHcG+x83IY7Td9H+I+izyCveuIAoXyx8Crg=; b=ThaGIFVs/ydyGfSiJesHHJNC6FC/9EEpRqy0Ui9UEdv4RAfnxJYdLG4BUBI7zLYoJJ Q8Qtvrd/Us8PIhtxRv1rEfIVUtHcv8V5WFJw4bflo+KdEYy+/xqPGnLkul81hN8ngp5G 0Ilo3qbuoZROkip+nsYyuQtK90zkiuWB7UTC8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697898; x=1728302698; 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=w+lDXyICIHcG+x83IY7Td9H+I+izyCveuIAoXyx8Crg=; b=Zhajl7HqtS4g481FqqYm9hB2LOKF5Z/kgo3yfc2xCyzJH+rehSn+mMeDomNVrHXfxf HyAGCu3prbkl4MgB1GzHYqalnUIutqpx37G4cTvJuvwLJYFZQPqWWHfyL1JXnPLZLZVr fiocTMBpuC7ReXsWgxZBiwP/4pxW/p+SuA5TN3TI4fVwe7PjIyAkgS8733DTQHZpwYpS LAjAq+oOfb0EkWkEd5sryRCv2xZjSVILgKZC1awaBXePzsHcV3cunjidAiJzv+xUHOP1 xUhe8R7VZfOz6bKFgqP+u7pPCidLe3H6s5cx/KxI/r+At8UyfD3O357aff+QjSZpMoNI 2rVA== X-Forwarded-Encrypted: i=1; AJvYcCVW4xHZqWu5FYIPRZY4FWu4IUifuBC9t0UQYFZjyTwqf51PJKxzzX6/D3DwnDbkOzacKi11WVpnXHvKJmy8brGa@lists.infradead.org X-Gm-Message-State: AOJu0YwOkdTsbY96KmhHUXgxxv2Oh8qBTL602TUj5pgiclgx+llD2uft XoUst5njpfaRQdw2hLeEmz3HARJIWrt338+Uz6wAiV7XzGI+vmjA0sysa7VNhA== X-Google-Smtp-Source: AGHT+IHpSAOikj0Pw9qUy/ufav5/H94vhYgLdOZ5ZWws6VuRg45Il/9rM3D70mqQT4nS8RcavrRJ/g== X-Received: by 2002:a05:6358:7254:b0:1b8:322e:3db with SMTP id e5c5f4694b2df-1becbc887d8mr566945055d.14.1727697898629; Mon, 30 Sep 2024 05:04:58 -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.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:58 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:22 +0000 Subject: [PATCH 27/45] media: cec: Use string_choices helpers MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-27-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_050459_934044_A55DC1F8 X-CRM114-Status: GOOD ( 12.49 ) 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/cec/usb/pulse8/pulse8-cec.c:698:2-9: opportunity for str_on_off(data [ 0 ]) drivers/media/cec/usb/pulse8/pulse8-cec.c:705:4-11: opportunity for str_on_off(data [ 0 ]) drivers/media/cec/platform/cec-gpio/cec-gpio.c:138:6-22: opportunity for str_high_low(cec -> hpd_is_high) drivers/media/cec/platform/cec-gpio/cec-gpio.c:141:6-21: opportunity for str_high_low(cec -> v5_is_high) Signed-off-by: Ricardo Ribalda --- drivers/media/cec/platform/cec-gpio/cec-gpio.c | 4 ++-- drivers/media/cec/usb/pulse8/pulse8-cec.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/cec/platform/cec-gpio/cec-gpio.c b/drivers/media/cec/platform/cec-gpio/cec-gpio.c index 98dacb0919b6..49160a15272b 100644 --- a/drivers/media/cec/platform/cec-gpio/cec-gpio.c +++ b/drivers/media/cec/platform/cec-gpio/cec-gpio.c @@ -135,10 +135,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 ba67587bd43e..0167f21cb116 100644 --- a/drivers/media/cec/usb/pulse8/pulse8-cec.c +++ b/drivers/media/cec/usb/pulse8/pulse8-cec.c @@ -695,14 +695,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;