From patchwork Mon Sep 30 12:04:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816281 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 CB0D7CF64A3 for ; Mon, 30 Sep 2024 12:51:10 +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=t2tB8sFg/5a2I4zeaxxZR6pf56+tHkpHPezEUEsu9lc=; b=uT50sTcZVExa4rSa6z8w+gwMFI v85m3WwJ1CnHDB9S6QsBixmJpTmANRsl6a4YtYKKxQ9Yn2XbkxyPhp7nVooz3cP4E7NSQ7OhsMvjE x1UEeK2KqtRX3xqVYk6JOpu2Iq5EUJDiPpM9yCTq5DcEWK5Px8rumssEhaw/3U11s3s/8oUl+uZqY hpP+DFBW5/u4yBuaXGjHcgNdmUPsHCqBPL6rCqrxoJrt0L6J2X+2PaxF3GJi/9SUsCSzWlGW4JfKq nh3SKUGRSPiq8aOfNthBlReiVzlAJPMoKYLf8V2TNIvRU+g8S7oMluulY8MnLnm7NvQpvIwM8pDzk h3nfW77w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svFri-0000000H8s9-0uQL; Mon, 30 Sep 2024 12:51:02 +0000 Received: from mail-qv1-xf33.google.com ([2607:f8b0:4864:20::f33]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svF8c-0000000GwHr-3BbH for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 12:04:28 +0000 Received: by mail-qv1-xf33.google.com with SMTP id 6a1803df08f44-6cb3bbb9cf5so31771426d6.1 for ; Mon, 30 Sep 2024 05:04:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697865; x=1728302665; 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=t2tB8sFg/5a2I4zeaxxZR6pf56+tHkpHPezEUEsu9lc=; b=JquE66Cy2QowMYEblo8iiqvtjcHyUdZMAKNwDGZnniC9+wEazq85cma9Tp6On3Iw7+ LXtZeK3+cFGLqN7Fp0VXUS3V2Q4BFq28jaho2rc5SGK9gYIHU0nWvGt8ftITxU4azz2N lRS8A4JlPG368efcLdaTV1D/8kp/N9NPOdjVk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697865; x=1728302665; 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=t2tB8sFg/5a2I4zeaxxZR6pf56+tHkpHPezEUEsu9lc=; b=hTLo42QJN1vfouqrnG2wktzg8/GRX985s/D9f45n5qsfc0GxpSffeMRyLAiyxJZ32U xGOe3KqvrBWCXmzRHMwJTbCLkU5WHcmy49SpXXqqrkQtCZ6YwtB4gxSgHKlOcyeNtjvC V0aIx2fH8O8PsD4hpeu246H/rG9Om7iE7oXhozpU+5ZJ9BWeKL4dmoIKLxFKvcJX2j53 oGQoaq4hDqE8Qtip8DkL7xbWzGA0kgBPnaOOAmkKqYisRnPrEOluN5D/+0HsJjDOlILJ BuTdZOBxPlj2B3bobTyopzV0mTW9vRK5NRbRTY2vLLGOWLjXdP5RKFg+MTg+zZsp08bH PFeA== X-Forwarded-Encrypted: i=1; AJvYcCVB0+/93PpUFO9aTDbsyIprcKvWZAksNQRBQiiQHLmupWGp+KzYxT55IzPB1PRYR8GmXcEKn8a2DfA7+tqBxVnd@lists.infradead.org X-Gm-Message-State: AOJu0YxXChYM41lUTsWaCGiB+3cCv1CEMqGt9OKSbtM9gshte0bEYC2d FIQ+Ax4WB9aQt6qDxtMteFCWf9GKiBdGxHpY6fK3SDUzkIxm3UzvZBS7U5USVg== X-Google-Smtp-Source: AGHT+IHhNN24sJCIubgfbFA4VGeLvNv4RKY7X5IqP1ufDg/rjxIUh41wM/wPVdTOII53M0RqAZGVpA== X-Received: by 2002:a05:6214:3982:b0:6cb:3e26:bcaf with SMTP id 6a1803df08f44-6cb3e26bd60mr117592306d6.32.1727697865303; Mon, 30 Sep 2024 05:04:25 -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.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:24 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:06 +0000 Subject: [PATCH 11/45] media: rc: Use string_choices helpers MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-11-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_050426_864418_E2C56EB5 X-CRM114-Status: GOOD ( 14.20 ) 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/rc/mceusb.c:1130:2-8: opportunity for str_enable_disable(enable) drivers/media/rc/ene_ir.c:1121:22-28: opportunity for str_enabled_disabled(enable) drivers/media/rc/serial_ir.c:591:4-9: opportunity for str_low_high(sense) drivers/media/rc/serial_ir.c:594:4-9: opportunity for str_low_high(sense) Signed-off-by: Ricardo Ribalda --- drivers/media/rc/ene_ir.c | 3 ++- drivers/media/rc/mceusb.c | 3 ++- drivers/media/rc/serial_ir.c | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/media/rc/ene_ir.c b/drivers/media/rc/ene_ir.c index 67722e2e47ff..90bee860a8a1 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 cd7af4d88b7f..7f932f0f5750 100644 --- a/drivers/media/rc/mceusb.c +++ b/drivers/media/rc/mceusb.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -1127,7 +1128,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 fc5fd3927177..f9ec2f043529 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);