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: 13815959 Received: from mail-qv1-f50.google.com (mail-qv1-f50.google.com [209.85.219.50]) (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 6C546192B61 for ; Mon, 30 Sep 2024 12:04:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697869; cv=none; b=WUwL2bueLL3+zrNEwGFHulh/uzcHiA17yiiDMIFJgIzgybwcQzHcdZvp/umIiUt1vgBeRUBTJxuIZyJZLKX+FIQ5e1F3OXfw2hNmhaDCUl8gtHBkTlJL2IEs+DbktoKZQFr2CBC72QZoz0WNiRZldUNHW2isbyDfSSnpbN0VHBI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697869; c=relaxed/simple; bh=cnDoJb8yt4N23hqgVqtt6DugifeR9k05ai5VXwEP3n8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jAXpjYAPFfZ+gD2poW/9C5rTZ27NxTOedPN4Se0JbSK5SAsqgn0/UlCcoSAwf3JMxBT5VFSMvi3DOAOyPSg6247FaM9qPDT2py8AbXYIOtLsEdLAvNlRFsbED12q3J76n10wh2JoVsNyYLrRk6Fo2ebndzHXZII5QE+AZbUoMEI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=cA7/OcfF; arc=none smtp.client-ip=209.85.219.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="cA7/OcfF" Received: by mail-qv1-f50.google.com with SMTP id 6a1803df08f44-6cb54eef205so14798346d6.2 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.linux.dev; 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=cA7/OcfF6+CEN93lilnuAEgHT3VOwYTELSVMWG1cvz4nPDkCVxBHDkeNyy0J6ZcMtt ic6UBg//Ok+d554WhJ4V3W8Uwoa5exD4LiliqTmVvUtC62pE8HXcGRoqEuxBUznp19/C 3nJLT/Y7bbzWKoOTd6qmvR2VLRR5bOfCIWGEM= 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=kjpiOcLwxkYn1leHvQzJg4Lr0TzkUxgbbv23xoBaf/OibbvYK4vC+cuXYwOG6CP75U GmVmTL8k2qDG1kc5t8tIMxU3My8OD2FTNuuZvNyxL1fnaqqddSFfXv+W7C0FmVq0by7E GkC9frnXq6Xhta7/vZvKpsTcH4jwAo+k+PZ1jr/erw2aXMAX4crKnj+Wq7gpqe+lvjiM nENEmftGIUYsF3Wx3jrefQ4pHBqhcOPyQkUs5OgIQz1oc4P1qYWPm3H/Lz/TF9A502Bn wk2lrr8z1IGpV+tUW1Es+iv2VXoaqIQyvmlryOuIJiQCoRWTNyU9R42YZXyYq3zvi3o9 +zrw== X-Forwarded-Encrypted: i=1; AJvYcCVHZ2jFSJ14O0CG2yLpYcitIz4VG/mnkzTDoJ4vtm/iCTEzg2M3/YHhB31RAJfTHi5R8FI=@lists.linux.dev X-Gm-Message-State: AOJu0YwzRrNdtQ81bI7ll0UUYOCki8298T4M3xYL7FPxrWvm7aINvnu5 M1g6T46aip4nwzcVKpc35R1N7E4btP+TVffYwEBO9nvcnGDh1Plq7ujiQJ4+tA== 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 Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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 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);