From patchwork Mon Sep 30 12:03:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816038 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 6616DCF649C for ; Mon, 30 Sep 2024 12:06:51 +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=U/d/VxAIFFwk8ny3jYVhNIfPO7NwT5z32rk28KK4f8Y=; b=vfBReXz0/z205hyk3jhNhWnfnF 7hd5q6QmUOZpRBVPg2dEWkmpPFNhDwt9rRfnSyBMcw6iGXnZfniX01HSSRrj8gsStc1qNzUQT2oGm wSiqCQamUvMn77IvdvIEKWCzuyUuTmZUGv2L9wsVRONPVYDFDtK1e0XqN6qCsKpIfzqgwI+xcCnl6 /t3R11pRQJJOsiyQ1+FNnIOPiyJsIOxd1WalY+wkia14LbkmKOrw8gFI4/Lgpq5uFtYqWH49NBx+I j5pAYhEfca6J5NVPqtTTDTaU6g3bLLT/JG/V3ejEEU+IAnYge58ttZ6jQVR5Ozfu2NeZkzNdyWNea RH1IsbwA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svFAk-0000000Gx4C-3XyS; Mon, 30 Sep 2024 12:06:38 +0000 Received: from mail-oo1-xc2e.google.com ([2607:f8b0:4864:20::c2e]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svF8H-0000000Gw8o-1W87 for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 12:04:06 +0000 Received: by mail-oo1-xc2e.google.com with SMTP id 006d021491bc7-5e56759e6d7so2480890eaf.3 for ; Mon, 30 Sep 2024 05:04:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697844; x=1728302644; 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=U/d/VxAIFFwk8ny3jYVhNIfPO7NwT5z32rk28KK4f8Y=; b=NwxQP8ZICE1PabWixZwOi1LnqOqBwVkGx+Qqp0H/RcYh02v2aBxQozuUPu99WI9oDX siMRz8Bsq8Og/Dc2MgobfntWHoc9eyRAXYnDR7B2wp5MuSX0MQsZLFRR8xDOL1xmoFhV vZtTaJ3DeRwDpCd89nu9qkUJzRHY58WENM0oY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697844; x=1728302644; 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=U/d/VxAIFFwk8ny3jYVhNIfPO7NwT5z32rk28KK4f8Y=; b=MocU2+8J+fKZdZ33pEljywZ63UoyPcHRN2iLrYUeBC9097vJXEwcocdfc50aPP7GlC 6zSP5rZWE9jAQLsF8uRmfoFPvrKZmDhCik7h5iKNUYrZuuIoS/t2ELUiDVUIXfkRyov4 +/nVOkoozxXRgVUNmEilMB1OVVijbPpjl0LQMZmohamEr2ynw1GfVIcsxvKRhVDqvptJ zZK3AQBd6LHXcg7DfrDAwfmO8hFxrX3xYAlikiU+XLeKzmjzfix/1oFDnT6Od0l/RRty TU4OFAA74WdK9b1QBabbWISpge7+sKSSvotN7gM+UBr7grOzUqQKhDeYhXJhgFhOT+Kj GWFg== X-Forwarded-Encrypted: i=1; AJvYcCW/lgZcUkglD3YKnugTfMmvki0GbZQnWAnyoAGZc8ov38u8dCIMJQ/maybJeg/r5wsZSYCvjlOSbTSR59gE5P2A@lists.infradead.org X-Gm-Message-State: AOJu0YzOyn2pr323IYnjjwlTJ3HDbLTnc3y56GMRKrBfCb4BRq55FH4X GQyamSzUsBZ8nPevf/am6oOaPQs6CiZegJ4GG/GSIfD2RNp2f7O/jQwoKLahJg== X-Google-Smtp-Source: AGHT+IG/KAG5rLZearz2Wa+2ErVyBcttWaRGk175qbpKywxFfy3PRamVmOosYeNbd61Fqm2746wGGw== X-Received: by 2002:a05:6358:4314:b0:1b1:ac2e:af69 with SMTP id e5c5f4694b2df-1becbd0a143mr332064355d.17.1727697843926; Mon, 30 Sep 2024 05:04:03 -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.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:02 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:03:56 +0000 Subject: [PATCH 01/45] media: staging: ipu3: Use string_choices helpers MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-1-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_050405_437484_04BB1F68 X-CRM114-Status: GOOD ( 12.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/staging/media/ipu3/ipu3-v4l2.c:290:3-31: opportunity for str_enabled_disabled(flags & MEDIA_LNK_FL_ENABLED) drivers/staging/media/ipu3/ipu3-v4l2.c:305:3-31: opportunity for str_enabled_disabled(flags & MEDIA_LNK_FL_ENABLED) Signed-off-by: Ricardo Ribalda --- drivers/staging/media/ipu3/ipu3-v4l2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/ipu3/ipu3-v4l2.c b/drivers/staging/media/ipu3/ipu3-v4l2.c index e7aee7e3db5b..443067ad0a50 100644 --- a/drivers/staging/media/ipu3/ipu3-v4l2.c +++ b/drivers/staging/media/ipu3/ipu3-v4l2.c @@ -287,7 +287,7 @@ static int imgu_link_setup(struct media_entity *entity, WARN_ON(pad >= IMGU_NODE_NUM); dev_dbg(&imgu->pci_dev->dev, "pipe %u pad %u is %s", pipe, pad, - flags & MEDIA_LNK_FL_ENABLED ? "enabled" : "disabled"); + str_enabled_disabled(flags & MEDIA_LNK_FL_ENABLED)); imgu_pipe = &imgu->imgu_pipe[pipe]; imgu_pipe->nodes[pad].enabled = flags & MEDIA_LNK_FL_ENABLED; @@ -302,7 +302,7 @@ static int imgu_link_setup(struct media_entity *entity, __clear_bit(pipe, imgu->css.enabled_pipes); dev_dbg(&imgu->pci_dev->dev, "pipe %u is %s", pipe, - flags & MEDIA_LNK_FL_ENABLED ? "enabled" : "disabled"); + str_enabled_disabled(flags & MEDIA_LNK_FL_ENABLED)); return 0; } From patchwork Mon Sep 30 12:03:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816039 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 7D197CF6497 for ; Mon, 30 Sep 2024 12:08:03 +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=RMPmE5TkHFd80YgqTri0+sfyqDiwarpX0eHsAVhj80Q=; b=XZvXbXdjvHJpA6V1z2siwg7Hwk xcm77ipTiM6pp24OdFRqSxsVkbu7t4n+DsrhKUTgK4MKOa4EK7OxjHOFFFT0nXBzl2/u4/yTmNN0b Pv3dv9wxvFfMqKBwOtgqYKzdskky68EuU0xvyCWM0WEruNPX9xznNMr7vXnFRo61NNNsZxU1PpJkq INxUC5TiqkS0o3nZRB/XnJBJqJNH3jEnqvLX6R4IcVqp4dZ0hI3fuwP1PkEFZEhhB4k8NPjLMEbzz 3Y6Pox5Edo+sNoQFJPzr8nAn8UlkVgHZeQSNVlOdCPx3OpUNAQZOPfa4ZYE8pF/V+PujrHo5tOnBi obc+Cfzg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svFBv-0000000GxKj-3fFJ; Mon, 30 Sep 2024 12:07:51 +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 1svF8K-0000000Gw9a-09EO for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 12:04:09 +0000 Received: by mail-qv1-xf2d.google.com with SMTP id 6a1803df08f44-6cb25aad5dfso40844726d6.3 for ; Mon, 30 Sep 2024 05:04:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697846; x=1728302646; 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=RMPmE5TkHFd80YgqTri0+sfyqDiwarpX0eHsAVhj80Q=; b=dJZp62arCF6C1f04+cVjk4Z/xm9RDOM5/XybZ9w495ftyrnDH3KlsDlHTdiyNpBm7E 44HIsSLoKehTVKvcq5IWrvdhc52qizq2inYVeAnZlnEnZF+E0SA2yoT2b/qRIiSpvHId k5moohL1B/cnbwFkAOhJ3ap1SRF+ks+F6SP0E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697846; x=1728302646; 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=RMPmE5TkHFd80YgqTri0+sfyqDiwarpX0eHsAVhj80Q=; b=fl8mYF+08jBN4xAuyAUTH5Xz1PXEXPN4DqSOpwdfdyCBnrMvXXA1TNoENLrjlE2sHw GrGLWXBaIKJFsVOIbveQ4b9ItxXaC7w+8H32IoKdEFofFQ/j6Y4l0/tzvwQucXstPT71 E1jVtdduE6haadLL/TIlPst4yImy5CI8q6a5aOiRyLgVO+r4gmIlqaGpbxd52rwQfNOS IWSX+3YJWKE68D4xaigiRRn7uE0485PuVbTcz+AGt+neGGkKBi0OzvpLhf87Ni6LByUn R2wQdx3KAMX0nsX6M1TT1oNZDa4P7I59NuNUksCssbNHNdJbIs6k0rxQccaq53G9IAiG dGYA== X-Forwarded-Encrypted: i=1; AJvYcCV8uCrxHjXOK5crhi5gv3JhbQh4WbPt/ITnMlAOpE0f3eWdU2zgq9C8rZBSJB68cYdoSqcscSphQGPS6I4vP9PX@lists.infradead.org X-Gm-Message-State: AOJu0YzcqypyJLey3QXbGJi0sLFMSEEbWAcZZpc0klKoW+hinV0IBLBO UiEJo1Fa/WdUQ350MZ8XOmlcRjU7ts1Sb2zNe7pbKxgBR1kcyGnJrFWkmV+hAw== X-Google-Smtp-Source: AGHT+IH6/D/fn5XLACymMtvSYJn9uYVBCFXPJs1Z5DofbyQa884ygogtE2Qn3wPmK1ZC7+LIXRRj0g== X-Received: by 2002:a05:6214:4905:b0:6cb:4ee5:8a80 with SMTP id 6a1803df08f44-6cb4ee58e92mr128655486d6.34.1727697846439; Mon, 30 Sep 2024 05:04:06 -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.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:05 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:03:57 +0000 Subject: [PATCH 02/45] media: staging: atomisp: Use string_choices helpers MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-2-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_050408_118125_98BD587F X-CRM114-Status: GOOD ( 13.85 ) 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/staging/media/atomisp/pci/sh_css.c:1490:16-19: opportunity for str_true_false(map) drivers/staging/media/atomisp/pci/atomisp_compat_css20.c:855:2-8: opportunity for str_enable_disable(enable) drivers/staging/media/atomisp/pci/atomisp_v4l2.c:542:40-46: opportunity for str_on_off(enable) drivers/staging/media/atomisp/pci/atomisp_v4l2.c:584:48-54: opportunity for str_on_off(enable) drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c:1006:2-4: opportunity for str_on_off(on) drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c:1019:3-5: opportunity for str_on_off(on) drivers/staging/media/atomisp/pci/atomisp_csi2_bridge.c:394:9-19: opportunity for str_low_high(active_low) drivers/staging/media/atomisp/pci/runtime/binary/src/binary.c:1253:3-35: opportunity for str_true_false(xcandidate -> sp . enable . continuous) Signed-off-by: Ricardo Ribalda --- drivers/staging/media/atomisp/pci/atomisp_compat_css20.c | 2 +- drivers/staging/media/atomisp/pci/atomisp_csi2_bridge.c | 2 +- drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c | 4 ++-- drivers/staging/media/atomisp/pci/atomisp_v4l2.c | 4 ++-- drivers/staging/media/atomisp/pci/runtime/binary/src/binary.c | 2 +- drivers/staging/media/atomisp/pci/sh_css.c | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c index a62a5c0b3c00..34e68ea1b1f4 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c +++ b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c @@ -852,7 +852,7 @@ int atomisp_css_irq_enable(struct atomisp_device *isp, { dev_dbg(isp->dev, "%s: css irq info 0x%08x: %s (%d).\n", __func__, info, - enable ? "enable" : "disable", enable); + str_enable_disable(enable), enable); if (ia_css_irq_enable(info, enable)) { dev_warn(isp->dev, "%s:Invalid irq info: 0x%08x when %s.\n", __func__, info, diff --git a/drivers/staging/media/atomisp/pci/atomisp_csi2_bridge.c b/drivers/staging/media/atomisp/pci/atomisp_csi2_bridge.c index 6abda358a72f..7d1905791b9a 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_csi2_bridge.c +++ b/drivers/staging/media/atomisp/pci/atomisp_csi2_bridge.c @@ -391,7 +391,7 @@ static int atomisp_csi2_handle_acpi_gpio_res(struct acpi_resource *ares, void *_ acpi_handle_info(data->adev->handle, "%s: %s crs %d %s pin %u active-%s\n", dev_name(&data->adev->dev), name, data->res_count - 1, agpio->resource_source.string_ptr, - pin, active_low ? "low" : "high"); + pin, str_low_high(active_low)); return 1; } diff --git a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c index e176483df301..85e7d14ef394 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c +++ b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c @@ -1003,7 +1003,7 @@ static int gmin_acpi_pm_ctrl(struct v4l2_subdev *subdev, int on) return 0; dev_dbg(subdev->dev, "Setting power state to %s\n", - on ? "on" : "off"); + str_on_off(on)); if (on) ret = acpi_device_set_power(adev, @@ -1016,7 +1016,7 @@ static int gmin_acpi_pm_ctrl(struct v4l2_subdev *subdev, int on) gs->clock_on = on; else dev_err(subdev->dev, "Couldn't set power state to %s\n", - on ? "on" : "off"); + str_on_off(on)); return ret; } diff --git a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c index c9984f1557b0..6fd18217df1e 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c +++ b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c @@ -539,7 +539,7 @@ static int atomisp_mrfld_power(struct atomisp_device *isp, bool enable) u32 val = enable ? MRFLD_ISPSSPM0_IUNIT_POWER_ON : MRFLD_ISPSSPM0_IUNIT_POWER_OFF; - dev_dbg(isp->dev, "IUNIT power-%s.\n", enable ? "on" : "off"); + dev_dbg(isp->dev, "IUNIT power-%s.\n", str_on_off(enable)); /* WA for P-Unit, if DVFS enabled, ISP timeout observed */ if (IS_CHT && enable && !isp->pm_only) { @@ -581,7 +581,7 @@ static int atomisp_mrfld_power(struct atomisp_device *isp, bool enable) usleep_range(100, 150); } while (1); - dev_err(isp->dev, "IUNIT power-%s timeout.\n", enable ? "on" : "off"); + dev_err(isp->dev, "IUNIT power-%s timeout.\n", str_on_off(enable)); return -EBUSY; } diff --git a/drivers/staging/media/atomisp/pci/runtime/binary/src/binary.c b/drivers/staging/media/atomisp/pci/runtime/binary/src/binary.c index 7ce2b2d6da11..7e295bc83464 100644 --- a/drivers/staging/media/atomisp/pci/runtime/binary/src/binary.c +++ b/drivers/staging/media/atomisp/pci/runtime/binary/src/binary.c @@ -1250,7 +1250,7 @@ int ia_css_binary_find(struct ia_css_binary_descr *descr, struct ia_css_binary * dev_dbg(atomisp_dev, "Using binary %s (id %d), type %d, mode %d, continuous %s\n", xcandidate->blob->name, xcandidate->sp.id, xcandidate->type, xcandidate->sp.pipeline.mode, - xcandidate->sp.enable.continuous ? "true" : "false"); + str_true_false(xcandidate->sp.enable.continuous)); if (err) dev_err(atomisp_dev, "Failed to find a firmware binary matching the pipeline parameters\n"); diff --git a/drivers/staging/media/atomisp/pci/sh_css.c b/drivers/staging/media/atomisp/pci/sh_css.c index ca97ea082cf4..89a694453e6f 100644 --- a/drivers/staging/media/atomisp/pci/sh_css.c +++ b/drivers/staging/media/atomisp/pci/sh_css.c @@ -1487,7 +1487,7 @@ map_sp_threads(struct ia_css_stream *stream, bool map) enum ia_css_pipe_id pipe_id; IA_CSS_ENTER_PRIVATE("stream = %p, map = %s", - stream, map ? "true" : "false"); + stream, str_true_false(map)); if (!stream) { IA_CSS_LEAVE_ERR_PRIVATE(-EINVAL); From patchwork Mon Sep 30 12:03:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816040 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 466ACCF6499 for ; Mon, 30 Sep 2024 12:09:14 +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=4cqERgoR9OlhV9bZcAYTWgDv58ZKeW9/q+4TIB0lCLc=; b=bmH+KSvIEbQMM29n1kiNFsCypB i0NaKthsb3Pop3gVQcy8VYf4FtBWxjDwh3vKh9rBJc9B8Fy7VuKhlN+IhJ9+yT1s2VvCa7Lmwu2dz pgFP65u3bsbgII2C1FfX6OOQ3IdLLkl5RQBzLyndR6pkpvvjqiH1gOmZtGc+bl3+wIB6Gr/NxmZpz /iffovkop84v769vMzEa36dOTVJzysStoWcWBV7AojwJyUZ8W16ED0l0/Hvv78sPnZKZ8of+p/6jQ txrwYum56/nnUpGHVpUQfHIJOzWXRi+HynFrCC52EDnmqdfe+B3D/y/m12TCXE3hj+CM8rBzoUNPH MUwFrzHw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svFD6-0000000Gxcs-2T4m; Mon, 30 Sep 2024 12:09:04 +0000 Received: from mail-qv1-xf34.google.com ([2607:f8b0:4864:20::f34]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svF8M-0000000GwAA-2IWf for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 12:04:11 +0000 Received: by mail-qv1-xf34.google.com with SMTP id 6a1803df08f44-6cb4c013b78so18076286d6.1 for ; Mon, 30 Sep 2024 05:04:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697849; x=1728302649; 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=4cqERgoR9OlhV9bZcAYTWgDv58ZKeW9/q+4TIB0lCLc=; b=k55kZoi3F60w0JeK3C5ObOvQLN6l8WuPuRO0uILao4cosV7toZDr8TRObDSKPTQFKF ixKvyBkvl02CnA6ihhffJ0t6hgJt8980pzdDLCPuffGMJByLdBbY+ymrpEnWDFVfTlXX 8rObJurXXiQa8RTG2PowJuK+NyV/b6Z2cL+dU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697849; x=1728302649; 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=4cqERgoR9OlhV9bZcAYTWgDv58ZKeW9/q+4TIB0lCLc=; b=oHqs8b7yTICE2LgKsoKbxA5059NsjlBtp5KZBKjWJaDmxQSmHEMc8+ZRKR2kgwgmsl EvWbs4SIOGfhflnZvbWKvf80+vMiKcQSpMyeezM7XbqJsxAWS8kKz7ON+PQ+v5TcXG49 zoVJkKJDdZOSAsokTW6a9xIu401m3H4H0lEQ1xiTOm4P10RICPSki9SjqIH11B3xKGd6 FLM8wH38aFnC7RlIbksL/u6w0UmjqYuHnQuixXPx2ZCO7s3opPdROs5l7v5kVKy51H7H rT3EKF7xLWtt/IFDFljv+OMqZcPwQCF7O94zMKW0wnLidQP9wUXNU2JRU822veU97Kog VmXQ== X-Forwarded-Encrypted: i=1; AJvYcCUOmoFn/Natr2978UZ1SU3qy3+vTAJJ5hMfMrefYpb2M/ngnr4Q5a12b8C5oFSdaVZ0RfH4J/RkWpMEm1G0I15v@lists.infradead.org X-Gm-Message-State: AOJu0YzVtmxIML+7IHq6mAY4Ejf6X83I4j6U1rl5lPoS7iQftmBZ+eAj g7ECUYoMFJ8p5BHFW18KpSpeQbgI0+ZBGNzT+Sl0mqAd0B9Ir/DVJcOGnIoFzw== X-Google-Smtp-Source: AGHT+IGdCSwCLQh27OqCiMv81An8yCyEXTlCQao91e2evQ6yJY9lhvUOeYdfvxJFC6O2qm9bRDYGaQ== X-Received: by 2002:a05:6214:5247:b0:6c5:166e:566c with SMTP id 6a1803df08f44-6cb3b5f06c1mr193464746d6.28.1727697848951; Mon, 30 Sep 2024 05:04:08 -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.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:07 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:03:58 +0000 Subject: [PATCH 03/45] media: core: Use string_choices helpers MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-3-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_050410_622641_1777A391 X-CRM114-Status: GOOD ( 11.54 ) 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/v4l2-core/v4l2-fwnode.c:282:32-33: opportunity for str_high_low(v) drivers/media/v4l2-core/v4l2-fwnode.c:290:32-33: opportunity for str_high_low(v) drivers/media/v4l2-core/v4l2-fwnode.c:298:37-38: opportunity for str_high_low(v) drivers/media/v4l2-core/v4l2-fwnode.c:329:31-32: opportunity for str_high_low(v) drivers/media/v4l2-core/v4l2-fwnode.c:356:40-41: opportunity for str_high_low(v) drivers/media/v4l2-core/v4l2-fwnode.c:364:38-39: opportunity for str_high_low(v) drivers/media/v4l2-core/v4l2-ctrls-core.c:272:16-26: opportunity for str_true_false(* ptr . p_s32) Signed-off-by: Ricardo Ribalda --- drivers/media/v4l2-core/v4l2-ctrls-core.c | 3 ++- drivers/media/v4l2-core/v4l2-fwnode.c | 12 ++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-ctrls-core.c b/drivers/media/v4l2-core/v4l2-ctrls-core.c index eeab6a5eb7ba..f303c70dffae 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls-core.c +++ b/drivers/media/v4l2-core/v4l2-ctrls-core.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -269,7 +270,7 @@ void v4l2_ctrl_type_op_log(const struct v4l2_ctrl *ctrl) pr_cont("%d", *ptr.p_s32); break; case V4L2_CTRL_TYPE_BOOLEAN: - pr_cont("%s", *ptr.p_s32 ? "true" : "false"); + pr_cont("%s", str_true_false(*ptr.p_s32)); break; case V4L2_CTRL_TYPE_MENU: pr_cont("%s", ctrl->qmenu[*ptr.p_s32]); diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers/media/v4l2-core/v4l2-fwnode.c index f19c8adf2c61..92dc17179018 100644 --- a/drivers/media/v4l2-core/v4l2-fwnode.c +++ b/drivers/media/v4l2-core/v4l2-fwnode.c @@ -279,7 +279,7 @@ v4l2_fwnode_endpoint_parse_parallel_bus(struct fwnode_handle *fwnode, V4L2_MBUS_HSYNC_ACTIVE_LOW); flags |= v ? V4L2_MBUS_HSYNC_ACTIVE_HIGH : V4L2_MBUS_HSYNC_ACTIVE_LOW; - pr_debug("hsync-active %s\n", v ? "high" : "low"); + pr_debug("hsync-active %s\n", str_high_low(v)); } if (!fwnode_property_read_u32(fwnode, "vsync-active", &v)) { @@ -287,7 +287,7 @@ v4l2_fwnode_endpoint_parse_parallel_bus(struct fwnode_handle *fwnode, V4L2_MBUS_VSYNC_ACTIVE_LOW); flags |= v ? V4L2_MBUS_VSYNC_ACTIVE_HIGH : V4L2_MBUS_VSYNC_ACTIVE_LOW; - pr_debug("vsync-active %s\n", v ? "high" : "low"); + pr_debug("vsync-active %s\n", str_high_low(v)); } if (!fwnode_property_read_u32(fwnode, "field-even-active", &v)) { @@ -295,7 +295,7 @@ v4l2_fwnode_endpoint_parse_parallel_bus(struct fwnode_handle *fwnode, V4L2_MBUS_FIELD_EVEN_LOW); flags |= v ? V4L2_MBUS_FIELD_EVEN_HIGH : V4L2_MBUS_FIELD_EVEN_LOW; - pr_debug("field-even-active %s\n", v ? "high" : "low"); + pr_debug("field-even-active %s\n", str_high_low(v)); } if (!fwnode_property_read_u32(fwnode, "pclk-sample", &v)) { @@ -326,7 +326,7 @@ v4l2_fwnode_endpoint_parse_parallel_bus(struct fwnode_handle *fwnode, V4L2_MBUS_DATA_ACTIVE_LOW); flags |= v ? V4L2_MBUS_DATA_ACTIVE_HIGH : V4L2_MBUS_DATA_ACTIVE_LOW; - pr_debug("data-active %s\n", v ? "high" : "low"); + pr_debug("data-active %s\n", str_high_low(v)); } if (fwnode_property_present(fwnode, "slave-mode")) { @@ -353,7 +353,7 @@ v4l2_fwnode_endpoint_parse_parallel_bus(struct fwnode_handle *fwnode, V4L2_MBUS_VIDEO_SOG_ACTIVE_LOW); flags |= v ? V4L2_MBUS_VIDEO_SOG_ACTIVE_HIGH : V4L2_MBUS_VIDEO_SOG_ACTIVE_LOW; - pr_debug("sync-on-green-active %s\n", v ? "high" : "low"); + pr_debug("sync-on-green-active %s\n", str_high_low(v)); } if (!fwnode_property_read_u32(fwnode, "data-enable-active", &v)) { @@ -361,7 +361,7 @@ v4l2_fwnode_endpoint_parse_parallel_bus(struct fwnode_handle *fwnode, V4L2_MBUS_DATA_ENABLE_LOW); flags |= v ? V4L2_MBUS_DATA_ENABLE_HIGH : V4L2_MBUS_DATA_ENABLE_LOW; - pr_debug("data-enable-active %s\n", v ? "high" : "low"); + pr_debug("data-enable-active %s\n", str_high_low(v)); } switch (bus_type) { From patchwork Mon Sep 30 12:03:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816041 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 39222CF6499 for ; Mon, 30 Sep 2024 12:10:30 +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=uHKPhMgVbBroKUSOZVkcpmjIQRoUB/Pllvr3HK97AsI=; b=oe+UxD7G8UtWjljmO7teJ2ZOfU FFdbBL9mVJxuUeRWF98Mw26K2ovC/CiZ5VJv1exxjuUy1yPWSPLqHk4mwpzRokcof1zoxFvyFQgGL a8xQ/8xQJPmDducjWiGF7JRZMnxX96CzLgYj6B5qHPW5Hm353ByibJ9Vugxv/pYO7KZcwYik+Tpvl t/BXMz+UT/jlII3fHdMmikeVG5wCnPsPQ05mvm4KBNQclE5Cwyv5BJqoU7Eo13+e5ssltN04NE2z0 zOggH1s2HlMmq+Yvy80GIF1WGLcAWzpN0dqMP0Gw94YrHf3/xhsM7WW8JDt+ZMFnHa6hLg/l0Rncy +3o3sA2g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svFEI-0000000Gxvg-0RMa; Mon, 30 Sep 2024 12:10:18 +0000 Received: from mail-qv1-xf31.google.com ([2607:f8b0:4864:20::f31]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svF8O-0000000GwAz-2Dq3 for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 12:04:14 +0000 Received: by mail-qv1-xf31.google.com with SMTP id 6a1803df08f44-6cb35f2aec1so29784596d6.2 for ; Mon, 30 Sep 2024 05:04:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697851; x=1728302651; 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=uHKPhMgVbBroKUSOZVkcpmjIQRoUB/Pllvr3HK97AsI=; b=M0eB/2Z8h7iJ5n0ZQSm0VmlnMf9Qp9cQ0xLcygONNV5+hPCfpHr/2RwKVDY7Su8xEl ANhzW9HcMQgkJrAGm6N0saEMkR8HZNXUYSfYpCMkmIpe/DMtwO3V2bSC1goSDMfsWW2y ovifH/HG0HwMc/spiZKjSELMCu10P0kDZV6vI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697851; x=1728302651; 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=uHKPhMgVbBroKUSOZVkcpmjIQRoUB/Pllvr3HK97AsI=; b=ElwB05VgMnBtsyS12yygQtm+f6iXQGgMTAbYdeJbQ1k1kTW/v7WkHFxFgMjNj1DIGd QHQivLJiwt9w31u++KKx82alu1o/qUSBh//iDj2ALBlVoUeLwTMmDksngRISxGxmHFhs ASwOd1RwkW2n/0w/hBj7we1eUk+lGttZ0LJCQhtbCbR7+jy7A/0jEbYoJeIgmaNTKbOK IHUoi2/vH2Nzuxkmi9HJKZuEyDBprFRrMri+AY18Xy9CGkMfvWYuKvqWFwHgfDWY5VRo VINrNAzoMwzxDAO7tngu5KcFEqSPhmv+/07jeni6Kr0DPwMuN5X56kWmTm48hMXFMqd5 rzOw== X-Forwarded-Encrypted: i=1; AJvYcCWmB75IRdCk6MpZ7f1iVzBeL8CTT9pJo65xMvHXZxd1Wrz3Uv58Vk+p+IkAp13Poa4wUSPAS2tmxgR2t52gUU0M@lists.infradead.org X-Gm-Message-State: AOJu0Yy5XAqee6Rlzg5uVTxWOjTEDaYsMmzkGNLivwFqV1trBqwj2pqa gm4x7pdCPg3H0WxLDTHFIJVc2YwxpIzZkimAYSizjN3pt0M0VDCa3HHH9fmxLA== X-Google-Smtp-Source: AGHT+IEk2U+7gH+P0zkQD3jLvaacsDuUtudGo2qx4V1eWgV4awKOL7SjyupKFoxi8Ld99dzK+gKdEQ== X-Received: by 2002:a05:6214:4a89:b0:6cb:2adf:751e with SMTP id 6a1803df08f44-6cb3b646986mr155979836d6.31.1727697850717; Mon, 30 Sep 2024 05:04:10 -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.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:10 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:03:59 +0000 Subject: [PATCH 04/45] media: pwc-ctl: Use string_choices helpers MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-4-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_050412_893570_81FF42B0 X-CRM114-Status: GOOD ( 12.51 ) 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 warning is fixed: drivers/media/usb/pwc/pwc-ctrl.c:492:5-10: opportunity for str_on_off(power) Signed-off-by: Ricardo Ribalda --- drivers/media/usb/pwc/pwc-ctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/usb/pwc/pwc-ctrl.c b/drivers/media/usb/pwc/pwc-ctrl.c index cff64d872058..a1b4eeb41cfe 100644 --- a/drivers/media/usb/pwc/pwc-ctrl.c +++ b/drivers/media/usb/pwc/pwc-ctrl.c @@ -489,7 +489,7 @@ void pwc_camera_power(struct pwc_device *pdev, int power) SET_POWER_SAVE_MODE_FORMATTER, pdev->ctrl_buf, 1); if (r < 0) PWC_ERROR("Failed to power %s camera (%d)\n", - power ? "on" : "off", r); + str_on_off(power), r); } int pwc_set_leds(struct pwc_device *pdev, int on_value, int off_value) From patchwork Mon Sep 30 12:04:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816049 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 D6E00CF6497 for ; Mon, 30 Sep 2024 12:11:39 +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=Vb+rHfycpw6eqzxAcjL5Q/NM2Cf8FBszS0leZkajSd4=; b=oMuP4D+Sy0ELZUqtSNhJU7wR+C oY/0Lam0QzN2ZyxTVDRvs3TVwxCKb+Xb7zcqW69f4uYOhg4OZXA8R868dkt6fjelZD96qUCQP1b8s bFBTnG9RULSd+tVFchlJ41d9GlwsMmIMPyzgK7Ou42z1EBVmr05elw55kCp7Pc3LWrn+AZ2aVMbyv NeNP5tyAUZTNLv/Vg1yJBp8XdIIDxrJC3GMXmbhZIiR6lrD62HismQI5DqvkuMwzQ9nbNxXlHjPHb PRlDNq+8hSOGTKRlSWvWO9Y/eiJzzMaBDwZB9vNaIEpodlNbRLjLmPRba2Tqn45BF8nbkJ3GRaB50 UMUx2MKw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svFFS-0000000GyFS-3dss; Mon, 30 Sep 2024 12:11:30 +0000 Received: from mail-qk1-x72e.google.com ([2607:f8b0:4864:20::72e]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svF8Q-0000000GwBg-455w for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 12:04:16 +0000 Received: by mail-qk1-x72e.google.com with SMTP id af79cd13be357-7a9a30a045cso419780885a.2 for ; Mon, 30 Sep 2024 05:04:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697853; x=1728302653; 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=Vb+rHfycpw6eqzxAcjL5Q/NM2Cf8FBszS0leZkajSd4=; b=d5Zq1jqAI7x6HgNm2kGZfyTZSdIMmEINreUbqZGMc8Pa6qZSnzGvLjH+v1TeA4Qx2r Wv6JwG5cQHhl6XtCrMKnlcPF38DS9I7pDtohUNgUj8hoL2QmyeDO9xyr775K75EKWAXH kREPey68zmzehlxGhm+GVBAUJjZzA4Jjx5BQ8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697853; x=1728302653; 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=Vb+rHfycpw6eqzxAcjL5Q/NM2Cf8FBszS0leZkajSd4=; b=HNnVBMw1PJY9bsOFi08pS/XA5GjAU5OCSwlFdK5Isk7XYM72qVxWb69z4lxtRqHPhE SQrwarCTLg3e6JXe7LHaqXRtANEXMbeG5vlTboi9c8LgqA4I4fQvtkO8RM0aazr1SGc+ WnV5deCGbOhZjtSRkrXLmMZjK1LZcMlk32o3R8dy1JSeMFivEI/1NCkS99ff+H9Jm2MI 7gdKrkw0h6SwK4VYWksNrJIh5d2lyss3svfTtt3/P6HI+w9HAIch7EfLc/rv9nHukWZ3 /LhsVlNHE00qTqYaL6mDWd9VB7XBhmgxJISSoCvqNq9DaJBFb+l+gHz9TK4rZStycAFp he8g== X-Forwarded-Encrypted: i=1; AJvYcCWMa/3bYUcwM1oeL0w9fPCZsFAyJc+o9hrZYWYTmCkUBKc6axI8VcNCeCX20nIMHGrhWihpO6qxJYUXa5jxbCF3@lists.infradead.org X-Gm-Message-State: AOJu0Yy8puL4xFqCtogQVXq4BbdkQ6s3i6tvmv/XEAca8DtI4qg7zDdC SZD/gQDJDdR5m2gveYAu46t1bw/XUCz13tCBE1qwXSqEopXTAzg2xpWm30xvwQ== X-Google-Smtp-Source: AGHT+IERK7kGfru4Q7d82RuyPjgoS6CBbu4N/h9Q+YkCupy/y3EuDtqtjn9iCQgLe1Tq04yD8BYOEQ== X-Received: by 2002:a05:6214:4a8e:b0:6c5:5418:a055 with SMTP id 6a1803df08f44-6cb3b5f2781mr194666026d6.30.1727697853291; Mon, 30 Sep 2024 05:04:13 -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.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:12 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:00 +0000 Subject: [PATCH 05/45] media: pvrusb2:Use string_choices helpers MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-5-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_050415_061715_24CDAF4A X-CRM114-Status: GOOD ( 15.68 ) 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/pvrusb2/pvrusb2-hdw.c:341:11-14: opportunity for str_true_false(val) drivers/media/usb/pvrusb2/pvrusb2-hdw.c:1727:6-17: opportunity for str_enable_disable(enable_flag) drivers/media/usb/pvrusb2/pvrusb2-hdw.c:1663:6-14: opportunity for str_on_off(enablefl) drivers/media/usb/pvrusb2/pvrusb2-encoder.c:265:8-29: opportunity for str_true_false(hdw -> state_encoder_ok) drivers/media/usb/pvrusb2/pvrusb2-encoder.c:271:9-33: opportunity for str_true_false(hdw -> state_encoder_runok) drivers/media/usb/pvrusb2/pvrusb2-ctrl.c:524:35-38: opportunity for str_true_false(val) drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c:475:11-37: opportunity for str_read_write(msgs [ idx ] . flags & I2C_M_RD) drivers/media/usb/pvrusb2/pvrusb2-debugifc.c:151:4-31: opportunity for str_on_off(pvr2_hdw_get_streaming ( hdw )) Signed-off-by: Ricardo Ribalda --- drivers/media/usb/pvrusb2/pvrusb2-ctrl.c | 2 +- drivers/media/usb/pvrusb2/pvrusb2-debugifc.c | 3 ++- drivers/media/usb/pvrusb2/pvrusb2-encoder.c | 5 ++--- drivers/media/usb/pvrusb2/pvrusb2-hdw.c | 6 +++--- drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c | 3 +-- 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/media/usb/pvrusb2/pvrusb2-ctrl.c b/drivers/media/usb/pvrusb2/pvrusb2-ctrl.c index 8ae3ad80cccb..b6c9bda214c8 100644 --- a/drivers/media/usb/pvrusb2/pvrusb2-ctrl.c +++ b/drivers/media/usb/pvrusb2/pvrusb2-ctrl.c @@ -521,7 +521,7 @@ int pvr2_ctrl_value_to_sym_internal(struct pvr2_ctrl *cptr, *len = scnprintf(buf,maxlen,"%d",val); ret = 0; } else if (cptr->info->type == pvr2_ctl_bool) { - *len = scnprintf(buf,maxlen,"%s",val ? "true" : "false"); + *len = scnprintf(buf, maxlen, "%s", str_true_false(val)); ret = 0; } else if (cptr->info->type == pvr2_ctl_enum) { const char * const *names; diff --git a/drivers/media/usb/pvrusb2/pvrusb2-debugifc.c b/drivers/media/usb/pvrusb2/pvrusb2-debugifc.c index 81d711269ab5..9e4eb03133c9 100644 --- a/drivers/media/usb/pvrusb2/pvrusb2-debugifc.c +++ b/drivers/media/usb/pvrusb2/pvrusb2-debugifc.c @@ -5,6 +5,7 @@ */ #include +#include #include "pvrusb2-debugifc.h" #include "pvrusb2-hdw.h" #include "pvrusb2-debug.h" @@ -148,7 +149,7 @@ int pvr2_debugifc_print_status(struct pvr2_hdw *hdw, bcnt += ccnt; acnt -= ccnt; buf += ccnt; ccnt = scnprintf(buf,acnt,"Streaming is %s\n", - pvr2_hdw_get_streaming(hdw) ? "on" : "off"); + str_on_off(pvr2_hdw_get_streaming(hdw))); bcnt += ccnt; acnt -= ccnt; buf += ccnt; diff --git a/drivers/media/usb/pvrusb2/pvrusb2-encoder.c b/drivers/media/usb/pvrusb2/pvrusb2-encoder.c index c8102772344b..8a2464744e5b 100644 --- a/drivers/media/usb/pvrusb2/pvrusb2-encoder.c +++ b/drivers/media/usb/pvrusb2/pvrusb2-encoder.c @@ -262,14 +262,13 @@ rdData[0]); pvr2_trace(PVR2_TRACE_STBITS, "State bit %s <-- %s", "state_encoder_ok", - (hdw->state_encoder_ok ? "true" : "false")); + str_true_false(hdw->state_encoder_ok)); if (hdw->state_encoder_runok) { hdw->state_encoder_runok = 0; pvr2_trace(PVR2_TRACE_STBITS, "State bit %s <-- %s", "state_encoder_runok", - (hdw->state_encoder_runok ? - "true" : "false")); + str_true_false(hdw->state_encoder_runok)); } pvr2_trace( PVR2_TRACE_ERROR_LEGS, diff --git a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c index 29cc207194b9..761d718478ca 100644 --- a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c +++ b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c @@ -338,7 +338,7 @@ static void trace_stbit(const char *name,int val) { pvr2_trace(PVR2_TRACE_STBITS, "State bit %s <-- %s", - name,(val ? "true" : "false")); + name, str_true_false(val)); } static int ctrl_channelfreq_get(struct pvr2_ctrl *cptr,int *vp) @@ -1660,7 +1660,7 @@ static int pvr2_decoder_enable(struct pvr2_hdw *hdw,int enablefl) anyway, just in case somebody else wants to hear the command... */ pvr2_trace(PVR2_TRACE_CHIPS, "subdev v4l2 stream=%s", - (enablefl ? "on" : "off")); + str_on_off(enablefl)); v4l2_device_call_all(&hdw->v4l2_dev, 0, video, s_stream, enablefl); v4l2_device_call_all(&hdw->v4l2_dev, 0, audio, s_stream, enablefl); if (hdw->decoder_client_id) { @@ -1724,7 +1724,7 @@ int pvr2_hdw_set_streaming(struct pvr2_hdw *hdw,int enable_flag) hdw->state_pipeline_req = enable_flag != 0; pvr2_trace(PVR2_TRACE_START_STOP, "/*--TRACE_STREAM--*/ %s", - enable_flag ? "enable" : "disable"); + str_enable_disable(enable_flag)); } pvr2_hdw_state_sched(hdw); LOCK_GIVE(hdw->big_lock); diff --git a/drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c b/drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c index 63db04fe12d3..60a0df018334 100644 --- a/drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c +++ b/drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c @@ -472,8 +472,7 @@ static int pvr2_i2c_xfer(struct i2c_adapter *i2c_adap, idx+1,num, msgs[idx].addr, cnt, - (msgs[idx].flags & I2C_M_RD ? - "read" : "write")); + str_read_write(msgs[idx].flags & I2C_M_RD)); if ((ret > 0) || !(msgs[idx].flags & I2C_M_RD)) { if (cnt > 8) cnt = 8; pr_cont(" ["); From patchwork Mon Sep 30 12:04:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816050 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 01447CF6499 for ; Mon, 30 Sep 2024 12:12:55 +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=qsuMyrkoVqVku50v1nfIbGtDSp7S7nG6aU9K9Rp04Bk=; b=zEnsSUSmRoALp/mn30RqIq1f3Z rqkKwUz3GLuC/DRaEt9MPiYW3SAdF+o1QNdLd1zbcwIkIXQnphOtdHiUrz6FZokmiyseETSo1s3Ox xne7A0+6e+qmgJoc4MEMmcntuJWZ7iCQkHAU8gPu1MxRDjXfKwx1XtsIZ9PGqsFqmqTpBtcRwzJe9 KBz7F7X/NHA/FA8AN0Ybg1DiMDpnHB1V3Wcv4AOv6SoWuZEFJhwg+zR/Wxj1GCEH79TlWII+XFY/Y UVsev4YFMSGxnKzx4381VjXZR0TVwjlafAe4flgYlExQBzlIOO+/R45NBSyKAngfg4xvVK/yTzU5R vQQYa5Qw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svFGe-0000000GyZY-26ic; Mon, 30 Sep 2024 12:12:44 +0000 Received: from mail-qk1-x72a.google.com ([2607:f8b0:4864:20::72a]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svF8S-0000000GwCg-34uF for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 12:04:18 +0000 Received: by mail-qk1-x72a.google.com with SMTP id af79cd13be357-7a99eee4a5bso385197985a.0 for ; Mon, 30 Sep 2024 05:04:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697855; x=1728302655; 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=qsuMyrkoVqVku50v1nfIbGtDSp7S7nG6aU9K9Rp04Bk=; b=SjalgGynWPccv7W2HD120/i2qDzes6P5MrdG9AsBuJ54JIbE4swzSQ913mnbphVWCC 9YnfbxbEaFV9VQMXrMIU56tJe6iM11GlurjeGsX2J1F/oY6lWQcqVKWvi84q27NVgBBb cVD340iHO6/6qlUOZ+bvKQaDEndlvmtsN35tY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697855; x=1728302655; 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=qsuMyrkoVqVku50v1nfIbGtDSp7S7nG6aU9K9Rp04Bk=; b=ZIOfNsU3h+Sgw82027hVkgLTukknqlCvWETAV6qdQK4SxgeZ9HyGWsgss4JYk+rLy3 sspTz5eKnwvcUVaOo5Eo3vSDeQp5Y4+rA4Fs9hQBGgzM3WiORWDaSGUb3jYsAkayHymb QTHY5SFj7WISrYGz9z7ytRd0NRDUx0ez8lvMLbGHyuLDvGuQvAGdEsLb6unO9C3cayHu zG+dl5RruFvb9hWVKRC7w1s//dAONeoMdDchQJ8Zw9hdOxhTzk593p6ZX/VodsO6x+UN jx7HbGtGcJGswWmXJRSVyyUsvB2xnlmILol4U0xWOmLPeVZU2yidk2rELjROqia1INpL tWuw== X-Forwarded-Encrypted: i=1; AJvYcCUiJ2qIzxumX0ES9TZowWki/xTVVtBDWAD6gt+wsOOmivPF/hHaGxT/YJag6MlQHEamu7NlSBdtHfJSt0VNc7rp@lists.infradead.org X-Gm-Message-State: AOJu0Yy1KRzWrzaxmXyvpgRAjTpU9zPFgfrmAFFA2nLg5dCCFtUcPb+p /YsjUjjlOD4U1aGUWd1wW4+xyy2/nv+0G5VbEEtafazQN9GXAekKlI+W3y+qTQ== X-Google-Smtp-Source: AGHT+IGbIk2oHMQ7FRb0GeJel1Jh9P6FVq0oOGmExjq89yc9rCz3p632i5Dvmp6LRIkRrX30gKUAOQ== X-Received: by 2002:a05:6214:5990:b0:6cb:3925:ec95 with SMTP id 6a1803df08f44-6cb3b66d1a1mr155459916d6.53.1727697855060; Mon, 30 Sep 2024 05:04:15 -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.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:13 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:01 +0000 Subject: [PATCH 06/45] media: em28xx: Use string_choices helpers MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-6-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_050416_807214_15822FF4 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/usb/em28xx/em28xx-i2c.c:579:3-29: opportunity for str_read_write(( msgs [ i ] . flags & I2C_M_RD )) drivers/media/usb/em28xx/em28xx-i2c.c:590:2-28: opportunity for str_read_write(( msgs [ i ] . flags & I2C_M_RD )) drivers/media/usb/em28xx/em28xx-video.c:941:4-9: opportunity for str_enabled_disabled(flags) Signed-off-by: Ricardo Ribalda --- drivers/media/usb/em28xx/em28xx-i2c.c | 4 ++-- drivers/media/usb/em28xx/em28xx-video.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/usb/em28xx/em28xx-i2c.c b/drivers/media/usb/em28xx/em28xx-i2c.c index a7eb11f7fb34..62fe49876a32 100644 --- a/drivers/media/usb/em28xx/em28xx-i2c.c +++ b/drivers/media/usb/em28xx/em28xx-i2c.c @@ -576,7 +576,7 @@ static int em28xx_i2c_xfer(struct i2c_adapter *i2c_adap, goto error; dprintk(2, "%s %s addr=%02x len=%d: %*ph\n", - (msgs[i].flags & I2C_M_RD) ? "read" : "write", + str_read_write(msgs[i].flags & I2C_M_RD), i == num - 1 ? "stop" : "nonstop", addr, msgs[i].len, msgs[i].len, msgs[i].buf); @@ -587,7 +587,7 @@ static int em28xx_i2c_xfer(struct i2c_adapter *i2c_adap, error: dprintk(2, "%s %s addr=%02x len=%d: %sERROR: %i\n", - (msgs[i].flags & I2C_M_RD) ? "read" : "write", + str_read_write(msgs[i].flags & I2C_M_RD), i == num - 1 ? "stop" : "nonstop", addr, msgs[i].len, (rc == -ENODEV) ? "no device " : "", diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c index 4aef584e21da..ff017c187aff 100644 --- a/drivers/media/usb/em28xx/em28xx-video.c +++ b/drivers/media/usb/em28xx/em28xx-video.c @@ -938,7 +938,7 @@ static int em28xx_enable_analog_tuner(struct em28xx *dev) dev_err(&dev->intf->dev, "Couldn't change link %s->%s to %s. Error %d\n", source->name, sink->name, - flags ? "enabled" : "disabled", + str_enabled_disabled(flags), ret); return ret; } 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; From patchwork Mon Sep 30 12:04:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816076 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 31543CF6499 for ; Mon, 30 Sep 2024 12:15:23 +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=oyq88t8pWb3nvRMsH4SWW8lN0+v/o8BALR3Lyr5Ymdo=; b=g49IJjNY7jb8O0Ub2TBNk381cA Qpdtt6wv5BkcoqIM+Ol155bPvvTSenM/DRkkosAOcA9T4RWGCwr+78DWpRHLMi5S/zJ5C18kjOvCy hEvTVkuCjUccNNb0jEM0NFXJlYEET7uQt7WPrOPQyZC66pCVmqFwF6fAsL70M0hSsctDfWtMdkWfE VqWJD8dEAdh/Lb5Shq84yjJspkL/j2wtImPIgaCmrG4qDA7IQ/dSh5OwgSu9yZtXL5axxx3gh5UFs NqG+A39Hr5DvQ2yvoVUO7K7Cd4ZGQy1wOh5mw1MGwRCIIkjaN0uvt1+WIBHy2tH4o3GPUgwRTP9be 3o5rRSJA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svFJ1-0000000GzC6-2qQL; Mon, 30 Sep 2024 12:15:11 +0000 Received: from mail-ot1-x32a.google.com ([2607:f8b0:4864:20::32a]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svF8X-0000000GwFG-0uxb for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 12:04:23 +0000 Received: by mail-ot1-x32a.google.com with SMTP id 46e09a7af769-71116d8504bso2651625a34.3 for ; Mon, 30 Sep 2024 05:04:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697860; x=1728302660; 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=oyq88t8pWb3nvRMsH4SWW8lN0+v/o8BALR3Lyr5Ymdo=; b=aj0Yxs0DSSWI63uqR3uvvAbWI8J8zmUCCk5eEy74GvlN2uVTtPXGnpzc9D29jkZrjO vPWmtEqIBnupLFMsw54bY4JDso4Wxo1gYD3zqTkpIVcuSsRZ5jtBUe9ceQXASV5DVv7e MRWsmo0Bo9y3nZIjI5reTgDGeINhDu7Qiy7hk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697860; x=1728302660; 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=oyq88t8pWb3nvRMsH4SWW8lN0+v/o8BALR3Lyr5Ymdo=; b=EIkfVThQvUTY4vObFXZaf8ns1T2Uq8uN/B1HRpJHhoKgEND+Tlk2wBHbpPpws95fMx EbdGzYyOwRzMEOnnmq1CNEUJOUufpfm57OhSiSWb8c1kvWeeawjbSuGgqsTJ8qy5LY+K qt6o75/I1kgFrFY8uwLsHamViCaONQHU3QPGcz7xlwCYXoWb9Ho7uvJkIo6Pm0ZqJoVU R+tD3lbiaQjOwgpYOWvAo3MJFsq2fjPLky5CbvbHsq7McQc7H8AlVzNznuS2jMEvDlpb 6QvjDPI6rmeHdXGKzMzw0/7qIvoMG0ajuCXtqydmOSSXA6USXAHLtk/TQvP5A/WAIUQ5 2q2A== X-Forwarded-Encrypted: i=1; AJvYcCWnj1VuQkb2SEWPSXndPMQcrjepZKbpjRj7qddL9uOXSoN9yrDQQHMXQFftUp9mlwo3yVQTDkbejb2WNHzX0Ykn@lists.infradead.org X-Gm-Message-State: AOJu0YzjzjNmgQRY3yKGKYLbYQqt7FIOrfCf4FrHPhcO57+tan/uRz6r H3cFdwkBRCTBp58raNW4yt7kxPX+PX9eEYPkQoKooqZ5GqebArsNte2JF7KGnA== X-Google-Smtp-Source: AGHT+IGlFIIrabSCXdg/bJ9e3MVgi6gfLFZpzZGyv3CgenARKjE0A4bquSvob8woJ1CdObZm4BjrEg== X-Received: by 2002:a05:6359:8488:b0:1bc:d1ba:225 with SMTP id e5c5f4694b2df-1becbb8fbe2mr306353155d.10.1727697859596; Mon, 30 Sep 2024 05:04:19 -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.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:18 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:03 +0000 Subject: [PATCH 08/45] media: dvb-usb-v2: Use string_choices helpers MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-8-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_050421_312328_4C4DB518 X-CRM114-Status: GOOD ( 13.46 ) 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-v2/dvb_usb_core.c:250:3-22: opportunity for str_yes_no(adap -> pid_filtering) drivers/media/usb/dvb-usb-v2/dvb_usb_core.c:337:3-22: opportunity for str_yes_no(adap -> pid_filtering) drivers/media/usb/dvb-usb-v2/az6007.c:82:32-38: opportunity for str_enable_disable(enable) drivers/media/usb/dvb-usb-v2/az6007.c:192:32-37: opportunity for str_enable_disable(onoff) Signed-off-by: Ricardo Ribalda --- drivers/media/usb/dvb-usb-v2/az6007.c | 4 ++-- drivers/media/usb/dvb-usb-v2/dvb_usb_core.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/usb/dvb-usb-v2/az6007.c b/drivers/media/usb/dvb-usb-v2/az6007.c index 2410054ddb2c..1e9f946193a6 100644 --- a/drivers/media/usb/dvb-usb-v2/az6007.c +++ b/drivers/media/usb/dvb-usb-v2/az6007.c @@ -79,7 +79,7 @@ static int drxk_gate_ctrl(struct dvb_frontend *fe, int enable) struct dvb_usb_adapter *adap = fe->sec_priv; int status = 0; - pr_debug("%s: %s\n", __func__, enable ? "enable" : "disable"); + pr_debug("%s: %s\n", __func__, str_enable_disable(enable)); if (!adap || !st) return -EINVAL; @@ -189,7 +189,7 @@ static int az6007_streaming_ctrl(struct dvb_frontend *fe, int onoff) { struct dvb_usb_device *d = fe_to_d(fe); - pr_debug("%s: %s\n", __func__, onoff ? "enable" : "disable"); + pr_debug("%s: %s\n", __func__, str_enable_disable(onoff)); return az6007_write(d, 0xbc, onoff, 0, NULL, 0); } diff --git a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c index f1c79f351ec8..c0a40112d043 100644 --- a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c +++ b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c @@ -247,7 +247,7 @@ static int dvb_usb_start_feed(struct dvb_demux_feed *dvbdmxfeed) dev_dbg(&d->udev->dev, "%s: adap=%d active_fe=%d feed_type=%d setting pid [%s]: %04x (%04d) at index %d\n", __func__, adap->id, adap->active_fe, dvbdmxfeed->type, - adap->pid_filtering ? "yes" : "no", dvbdmxfeed->pid, + str_yes_no(adap->pid_filtering), dvbdmxfeed->pid, dvbdmxfeed->pid, dvbdmxfeed->index); /* wait init is done */ @@ -334,7 +334,7 @@ static int dvb_usb_stop_feed(struct dvb_demux_feed *dvbdmxfeed) dev_dbg(&d->udev->dev, "%s: adap=%d active_fe=%d feed_type=%d setting pid [%s]: %04x (%04d) at index %d\n", __func__, adap->id, adap->active_fe, dvbdmxfeed->type, - adap->pid_filtering ? "yes" : "no", dvbdmxfeed->pid, + str_yes_no(adap->pid_filtering), dvbdmxfeed->pid, dvbdmxfeed->pid, dvbdmxfeed->index); if (adap->active_fe == -1) From patchwork Mon Sep 30 12:04:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816077 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 A0F71CF6497 for ; Mon, 30 Sep 2024 12:16:36 +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=o0DduMWqX0LlLrfJFzeOwfQDx0mBLtEZV9WrRhA8PwA=; b=MC3rpO7oVhRSXw9KmClUsZKDIj +4jzcPyxeqe7G/qD/HrV8pdPQD/Vc4vuWpUVY+M3tF3RaNnxjtEJytcNpFyYcMGhLO5qiLc+fUcot vetehvtIjaj6H8l8yDsE0O7dPv8GnbVywOp0wHCcGulwOoLyJjTzpYsJZ9a0/Ts8ZeIkv9cirbzqT /CuQA4nluXuBjfYRZvPS2lm2ebuUnvZ6rRnviLdE0zMRxSFf9EQYYgCLN3TQKE8w+WNKWjNq0XVwj WrxPouvqTij6CqnSk5g1MaLLl8pjJz/k/m5jYLKwmDmUiRXCiKLcORcLY/gnkKTOz7RYn5yzXgcSN s1e/lyOw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svFKF-0000000GzfG-4243; Mon, 30 Sep 2024 12:16:27 +0000 Received: from mail-qv1-xf29.google.com ([2607:f8b0:4864:20::f29]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svF8Y-0000000GwGJ-3rNi for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 12:04:24 +0000 Received: by mail-qv1-xf29.google.com with SMTP id 6a1803df08f44-6cb284c1a37so39523416d6.1 for ; Mon, 30 Sep 2024 05:04:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697861; x=1728302661; 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=o0DduMWqX0LlLrfJFzeOwfQDx0mBLtEZV9WrRhA8PwA=; b=GLr2Lm/eK7v1RSO9WdprU1KjT2N5vdFtNxyRkqlKzToej8iPu//FSPnfc8zSHLMV+l TyUevLTAE4TNf0+r3YDxllSvDm8WlUnrlqyus3q6e3Y9a9SLarZ69bc5tgsJh06aQXY7 dKr0awXylMrqR/ZwlMRBcmP6LMV0AJqX3Ozwg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697861; x=1728302661; 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=o0DduMWqX0LlLrfJFzeOwfQDx0mBLtEZV9WrRhA8PwA=; b=EXhQzZ7ZQAPmXATVxIWROpie+OfEpuK2u/w3hIVJjAsLxMoYUjNAiMCNwQZraePOvj NrXlGQF4x0NjpuAeHmRB/V35bbrevz2sMavhmrYkMv/A6WkMtKeo3Pq8vtW16QI4oBW7 ZG8gSX3spuv/G3NfNhoK9aW1yrl2Wa4BAPi91wCX03CDhAaU4W1f18Jdgral7npEdjF4 pDulNXgB6rxdIJCLKK10SZek8KrcFW3EvKI4kSucyX4/RE15UasTJyu4k4wdMyl1XBo4 48Fzz42JBYiTbC2ndSobIoleqL8cyCli19OLmicqqrsH9dvDBjaErT1DWp78bpZOjS90 WJAw== X-Forwarded-Encrypted: i=1; AJvYcCWQCil1xHEMKErUM6+ytKKhiuhStTQKcukCmtqruufhxjgEyrAob+YT6P7q69/SHw5A0RFJhovMlwQzQOtDPNOt@lists.infradead.org X-Gm-Message-State: AOJu0YyaFPBefi6Q98e8gE/VdQEKnNVD/S8IuXIl1VK5ga6XoChGx/As LI0eRJKGuGl+nLvM1adQezZ4jG4E1EKb8kXfTSF3/KhiDTj3iNk2RvCKRx3ZlA== X-Google-Smtp-Source: AGHT+IFW5o76WLto1m5OIr01yojLQTVPsUEplusVOtBKeM+zgF4Mr8Jjm4ekkrZvP/8oEpp3jj7xuA== X-Received: by 2002:a05:6214:3a88:b0:6cb:35ea:a343 with SMTP id 6a1803df08f44-6cb3b5b60c5mr157899696d6.5.1727697861311; Mon, 30 Sep 2024 05:04:21 -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.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:20 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:04 +0000 Subject: [PATCH 09/45] media: cx231xx: Use string_choices helpers MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-9-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_050423_040178_386C5DEB X-CRM114-Status: GOOD ( 12.85 ) 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/cx231xx/cx231xx-video.c:144:4-9: opportunity for str_enabled_disabled(flags) drivers/media/usb/cx231xx/cx231xx-i2c.c:373:4-30: opportunity for str_read_write(( msgs [ i ] . flags & I2C_M_RD )) drivers/media/usb/cx231xx/cx231xx-i2c.c:402:4-32: opportunity for str_read_write(( msgs [ i + 1 ] . flags & I2C_M_RD )) Signed-off-by: Ricardo Ribalda --- drivers/media/usb/cx231xx/cx231xx-i2c.c | 4 ++-- drivers/media/usb/cx231xx/cx231xx-video.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/usb/cx231xx/cx231xx-i2c.c b/drivers/media/usb/cx231xx/cx231xx-i2c.c index 6da8e7943d94..6d8b70562f6d 100644 --- a/drivers/media/usb/cx231xx/cx231xx-i2c.c +++ b/drivers/media/usb/cx231xx/cx231xx-i2c.c @@ -370,7 +370,7 @@ static int cx231xx_i2c_xfer(struct i2c_adapter *i2c_adap, addr = msgs[i].addr; dprintk2(2, "%s %s addr=0x%x len=%d:", - (msgs[i].flags & I2C_M_RD) ? "read" : "write", + str_read_write(msgs[i].flags & I2C_M_RD), i == num - 1 ? "stop" : "nonstop", addr, msgs[i].len); if (!msgs[i].len) { /* no len: check only for device presence */ @@ -399,7 +399,7 @@ static int cx231xx_i2c_xfer(struct i2c_adapter *i2c_adap, } /* read bytes */ dprintk2(2, "plus %s %s addr=0x%x len=%d:", - (msgs[i+1].flags & I2C_M_RD) ? "read" : "write", + str_read_write(msgs[i + 1].flags & I2C_M_RD), i+1 == num - 1 ? "stop" : "nonstop", addr, msgs[i+1].len); rc = cx231xx_i2c_recv_bytes_with_saddr(i2c_adap, &msgs[i], diff --git a/drivers/media/usb/cx231xx/cx231xx-video.c b/drivers/media/usb/cx231xx/cx231xx-video.c index 435eb0b32cb1..4cdcfe635ad7 100644 --- a/drivers/media/usb/cx231xx/cx231xx-video.c +++ b/drivers/media/usb/cx231xx/cx231xx-video.c @@ -141,7 +141,7 @@ static int cx231xx_enable_analog_tuner(struct cx231xx *dev) dev_err(dev->dev, "Couldn't change link %s->%s to %s. Error %d\n", source->name, sink->name, - flags ? "enabled" : "disabled", + str_enabled_disabled(flags), ret); return ret; } else From patchwork Mon Sep 30 12:04:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816272 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 2E93BCF64A3 for ; Mon, 30 Sep 2024 12:49:59 +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=42a4vpn3QTtS0EhgGJlcs62eAaEwJVXQ21s4ykHFIBI=; b=4bOLSLRrV6q9xReOEyK/6AWHXt mZwQl7Qk2+7cw0O6mw195yufKo4/Vp3o/ewijUeLX1zM9jIkXItE1H4eX8mdnqMzwEVTPuf56P7J7 PNZbyCa2AzH27r74pOQcFH+NWO94SOW+NJZaPZGkg+g0duJw6t4z+chIVm0c5liy7guxJBGx46ui7 c1oiwrgtx0Q/JHsgCsgqeO4sJpVIyWpAapcVTxuEpnATQoYM0GQwggCCmoM0lvAqy41/Pdztvl8mc 2QHwpgFJUyI8rIob+VVTBVeog13WnQvL0HykJ2NmmEr3SVuPmgxQbJg6Ql6DWYs7wcHYQT9qfRxwE mWMx/P+A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svFqX-0000000H8eo-2GTf; Mon, 30 Sep 2024 12:49:49 +0000 Received: from mail-qk1-x72d.google.com ([2607:f8b0:4864:20::72d]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svF8a-0000000GwH4-2raG for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 12:04:26 +0000 Received: by mail-qk1-x72d.google.com with SMTP id af79cd13be357-7acb0499ffeso407393785a.1 for ; Mon, 30 Sep 2024 05:04:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697863; x=1728302663; 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=42a4vpn3QTtS0EhgGJlcs62eAaEwJVXQ21s4ykHFIBI=; b=mp8KN8p1hJr7oQDABHHmyL4QXn3kNDI6uEFM/JXUL+uAlAOUEJtNZ1gxRHUj+KdTZm K9PyldEtZMinik9iBbZelE2LEZegCWRDD6DE6gIw+hBzjtlJMGlagDaIiNnZY91ipSp+ zOyj5C59Zm3/XbeL+8jvOZM9piQUVrhxoE9mw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697863; x=1728302663; 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=42a4vpn3QTtS0EhgGJlcs62eAaEwJVXQ21s4ykHFIBI=; b=S8ybJ3otR6QzAxZdgzpmZK+jzI/o+a1sSaV0jHEakobvalVRsDyioJQUGwoJgXTTcp l5QCWjrVNRa0mJgTMEXI5xlacC3vydwof4EQCS2VnEIjzwAZn4D6kyhZ/2z/2TW/Nsjn 0sk5S2kj6f5lR7Ym6P30AskWZP85P8XZL2KBTSjSfu+b1XGPmoFAwTpcOM+SBqBvBeXA y7Pux4ujMT8Xg/yYOQlHVCYYhAVqK5M7L+eWEdwtM4ndlTogwNWyVtnfYxBAfjzaWPn9 fX+jfVHzbpc+XPrygBGUuuj/CDbMjjCWizOZP4ULlifagfbK3wv04Q3vCEFHDDzF/l/P YfxA== X-Forwarded-Encrypted: i=1; AJvYcCUirqTC92VLXR9pSiUEh19/JzBIsn+61R35gOWrm585bKdD5TgtsBriM1yhD8H7Lc9N+Yk8hnb+Y9l9MbCdcMBR@lists.infradead.org X-Gm-Message-State: AOJu0YyxhkOERpa4bSvIxCScVxFf7yr2j/QcOdTEkE3Ms2nqe+C+kmWn cterzmzxQcyR1XudJuoQ9rnXVxh03yxPtN12XwplxOj0y1Jxgyagy/iS8oCkag== X-Google-Smtp-Source: AGHT+IFlDabMazwXnqk+xIMlKgzFONIbVzdm9vY20CpqT4dLcojtxwjmPMueB5KKSCBhlfp1Ts2Ejw== X-Received: by 2002:a05:6214:460f:b0:6c3:5ebb:9526 with SMTP id 6a1803df08f44-6cb3b5f2d1bmr196194196d6.29.1727697863111; Mon, 30 Sep 2024 05:04:23 -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.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:21 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:05 +0000 Subject: [PATCH 10/45] media: tuners: Use string_choices helpers MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-10-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_050424_758402_BFCF5142 X-CRM114-Status: GOOD ( 13.01 ) 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/tuners/tda18250.c:110:3-12: opportunity for str_true_false(triggered) drivers/media/tuners/tda9887.c:296:39-54: opportunity for str_high_low(( buf [ 0 ] & 0x20 )) drivers/media/tuners/tda9887.c:298:39-54: opportunity for str_high_low(( buf [ 0 ] & 0x80 )) drivers/media/tuners/tda9887.c:294:39-54: opportunity for str_yes_no(( buf [ 0 ] & 0x01 )) drivers/media/tuners/tda9887.c:347:5-20: opportunity for str_yes_no(( buf [ 1 ] & 0x02 )) drivers/media/tuners/tda9887.c:353:5-20: opportunity for str_yes_no(( buf [ 1 ] & 0x20 )) Signed-off-by: Ricardo Ribalda --- drivers/media/tuners/tda18250.c | 2 +- drivers/media/tuners/tda9887.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/media/tuners/tda18250.c b/drivers/media/tuners/tda18250.c index 68d0275f29e1..853600c80839 100644 --- a/drivers/media/tuners/tda18250.c +++ b/drivers/media/tuners/tda18250.c @@ -107,7 +107,7 @@ static int tda18250_wait_for_irq(struct dvb_frontend *fe, dev_dbg(&client->dev, "waited IRQ (0x%02x) %d ms, triggered: %s", irq, jiffies_to_msecs(jiffies) - (jiffies_to_msecs(timeout) - maxwait), - triggered ? "true" : "false"); + str_true_false(triggered)); if (!triggered) return -ETIMEDOUT; diff --git a/drivers/media/tuners/tda9887.c b/drivers/media/tuners/tda9887.c index b2f7054c1832..f403dcf14aa0 100644 --- a/drivers/media/tuners/tda9887.c +++ b/drivers/media/tuners/tda9887.c @@ -291,11 +291,11 @@ static void dump_read_message(struct dvb_frontend *fe, unsigned char *buf) "+ 12.5 kHz", }; tuner_info("read: 0x%2x\n", buf[0]); - tuner_info(" after power on : %s\n", (buf[0] & 0x01) ? "yes" : "no"); + tuner_info(" after power on : %s\n", str_yes_no(buf[0] & 0x01)); tuner_info(" afc : %s\n", afc[(buf[0] >> 1) & 0x0f]); - tuner_info(" fmif level : %s\n", (buf[0] & 0x20) ? "high" : "low"); + tuner_info(" fmif level : %s\n", str_high_low(buf[0] & 0x20)); tuner_info(" afc window : %s\n", (buf[0] & 0x40) ? "in" : "out"); - tuner_info(" vfi level : %s\n", (buf[0] & 0x80) ? "high" : "low"); + tuner_info(" vfi level : %s\n", str_high_low(buf[0] & 0x80)); } static void dump_write_message(struct dvb_frontend *fe, unsigned char *buf) @@ -344,13 +344,13 @@ static void dump_write_message(struct dvb_frontend *fe, unsigned char *buf) tuner_info(" B0 video mode : %s\n", (buf[1] & 0x01) ? "video trap" : "sound trap"); tuner_info(" B1 auto mute fm : %s\n", - (buf[1] & 0x02) ? "yes" : "no"); + str_yes_no(buf[1] & 0x02)); tuner_info(" B2 carrier mode : %s\n", (buf[1] & 0x04) ? "QSS" : "Intercarrier"); tuner_info(" B3-4 tv sound/radio : %s\n", sound[(buf[1] & 0x18) >> 3]); tuner_info(" B5 force mute audio: %s\n", - (buf[1] & 0x20) ? "yes" : "no"); + str_yes_no(buf[1] & 0x20)); tuner_info(" B6 output port 1 : %s\n", (buf[1] & 0x40) ? "high (inactive)" : "low (active)"); tuner_info(" B7 output port 2 : %s\n", 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); From patchwork Mon Sep 30 12:04:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816282 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 83643CF6497 for ; Mon, 30 Sep 2024 12:52:24 +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=twxbXJ5TDeltaVeKhttrEsGiOfaRdH40FC0hJR39r6Y=; b=uxe5iow5HMcomgxfa0x7St19X+ XwMLSqZxfxe/bEm0mDA76NqjNrm2pGCZy6TTR9R5t3JB8fxu61xaLAXc/ZXCph/750yKFphxNtxKv HzkL+BeJLec9GfHeUpuik3B7JaCRTGqowQxE1an1/j6Pzk0QdIoL+PPJ9ao/+uyjHTunXc+Qct0gV lBD3Xhq54HQB6ErdBOxZ2FMkAtQe05yIuqmbgrYWeCgOz1D2UP7wVHy1zSsXKcLQLLbgyDri1nKDv 6hy4UTQyuxOUswRURzegs76gL/2VOjGEdNR4yGgx4DehRq7yoF149LxHLvUhn8Tca/bXC9lFDS8j+ WjBp6SDA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svFsr-0000000H90u-35bO; Mon, 30 Sep 2024 12:52:13 +0000 Received: from mail-qv1-xf35.google.com ([2607:f8b0:4864:20::f35]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svF8f-0000000GwIb-0mRJ for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 12:04:30 +0000 Received: by mail-qv1-xf35.google.com with SMTP id 6a1803df08f44-6cb22e9c6dbso23374666d6.1 for ; Mon, 30 Sep 2024 05:04:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697868; x=1728302668; 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=twxbXJ5TDeltaVeKhttrEsGiOfaRdH40FC0hJR39r6Y=; b=FGoKWbdejEW29+QP2xKZhzF28/AVQJ1IUrBzIqtQoPDAxVs0z8ScwhQIbxAPGhrIqZ 2/xMG0uuG8NSBZwszrSRw5A+dg38F1z1Cs3qTxmTe3tahtvGU6zkvhevwKxf9WjpEq4Z j/4TxoZO97zR+3uRXfAAvH4j5g4ijAo/6lw0o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697868; x=1728302668; 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=twxbXJ5TDeltaVeKhttrEsGiOfaRdH40FC0hJR39r6Y=; b=PNcGDk+hPHzQEON2W+DZgFV9v3u83oaR0qppId175q2MJyLt8nPv9Zibwp1ojnRqWb 4c7gBzZ40emrMojkzVi4Cyk+KqyJQXV2lJztODvHFjE11beoV8HV8Ys9KCIigJdd4I71 OGpCIE0pASOd1wUssR+fI+GqPsdfyTeZM2bd4/IoYsgpu0Uvxjb/On+QudiSQ9lGhDBb tGC4n/M/fUHtqbTXA2OXqy5GQuKxgg6/uq32GiK2aAkuYtxGtsO98fDyf/tOD6H34or+ zvtYh5h4DcJVd2TPO38EsAHNTwNh9iEtn6etprxHLsSH1OiQd08+sKhY8u3L35Kq1j0E H3kQ== X-Forwarded-Encrypted: i=1; AJvYcCU/Tfff1kF3uONRlHLBWJJW2A6c6j1Ppdb0V10TlSAaYQKvfMS+eHWYC4jQWvFUxyR+UUp8NzVDxBYbmnpkwNEw@lists.infradead.org X-Gm-Message-State: AOJu0Ywvi0BXJlX85qU5hI5RL70P4Ad2Qr7nDkxTwGml0++qn+Bi1Lik ZHMwJuWO5f06P8BHvo+fjIRqlK4p3DZPKw+S8c/qK+gFDt39m7I4rwfKoI1R9w== X-Google-Smtp-Source: AGHT+IHtaxsqjQiVBMHhpTB74imzDxkcStWQYXWBLNrF2q84xYJXsQbMLDqKSk4hEvyHVvp0GEvPAw== X-Received: by 2002:a05:6214:5701:b0:6cb:2cfa:3b9d with SMTP id 6a1803df08f44-6cb3b5cafb1mr203537826d6.14.1727697867933; Mon, 30 Sep 2024 05:04:27 -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.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:26 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:07 +0000 Subject: [PATCH 12/45] media: dvb-frontends: Use string_choices helpers MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-12-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_050429_265731_8871213F X-CRM114-Status: GOOD ( 13.41 ) 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/dvb-frontends/cx24120.c:456:3-9: opportunity for str_enable_disable(enable) drivers/media/dvb-frontends/cx24120.c:462:2-8: opportunity for str_enabled_disabled(enable) drivers/media/dvb-frontends/helene.c:282:4-14: opportunity for str_read_write(write == 0) drivers/media/dvb-frontends/cxd2841er.c:209:3-13: opportunity for str_read_write(write == 0) drivers/media/dvb-frontends/drxk_hard.c:6282:22-28: opportunity for str_enable_disable(enable) drivers/media/dvb-frontends/drxk_hard.c:1071:2-13: opportunity for str_enable_disable(mpeg_enable) drivers/media/dvb-frontends/sp2.c:135:3-9: opportunity for str_read_write(( read )) drivers/media/dvb-frontends/horus3a.c:41:3-13: opportunity for str_read_write(write == 0) drivers/media/dvb-frontends/ascot2e.c:107:3-13: opportunity for str_read_write(write == 0) 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/dvb-frontends/ascot2e.c | 2 +- drivers/media/dvb-frontends/cx24120.c | 4 ++-- drivers/media/dvb-frontends/cxd2841er.c | 2 +- drivers/media/dvb-frontends/drxk_hard.c | 4 ++-- drivers/media/dvb-frontends/helene.c | 2 +- drivers/media/dvb-frontends/horus3a.c | 2 +- drivers/media/dvb-frontends/sp2.c | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/media/dvb-frontends/ascot2e.c b/drivers/media/dvb-frontends/ascot2e.c index cf8e5f1bd101..ec7a718428fc 100644 --- a/drivers/media/dvb-frontends/ascot2e.c +++ b/drivers/media/dvb-frontends/ascot2e.c @@ -104,7 +104,7 @@ static void ascot2e_i2c_debug(struct ascot2e_priv *priv, u8 reg, u8 write, const u8 *data, u32 len) { dev_dbg(&priv->i2c->dev, "ascot2e: I2C %s reg 0x%02x size %d\n", - (write == 0 ? "read" : "write"), reg, len); + str_write_read(write), reg, len); print_hex_dump_bytes("ascot2e: I2C data: ", DUMP_PREFIX_OFFSET, data, len); } diff --git a/drivers/media/dvb-frontends/cx24120.c b/drivers/media/dvb-frontends/cx24120.c index 44515fdbe91d..a02aaebb091a 100644 --- a/drivers/media/dvb-frontends/cx24120.c +++ b/drivers/media/dvb-frontends/cx24120.c @@ -453,13 +453,13 @@ static int cx24120_msg_mpeg_output_global_config(struct cx24120_state *state, ret = cx24120_message_send(state, &cmd); if (ret != 0) { dev_dbg(&state->i2c->dev, "failed to %s MPEG output\n", - enable ? "enable" : "disable"); + str_enable_disable(enable)); return ret; } state->mpeg_enabled = enable; dev_dbg(&state->i2c->dev, "MPEG output %s\n", - enable ? "enabled" : "disabled"); + str_enabled_disabled(enable)); return 0; } diff --git a/drivers/media/dvb-frontends/cxd2841er.c b/drivers/media/dvb-frontends/cxd2841er.c index d925ca24183b..d1b84cd9c510 100644 --- a/drivers/media/dvb-frontends/cxd2841er.c +++ b/drivers/media/dvb-frontends/cxd2841er.c @@ -206,7 +206,7 @@ static void cxd2841er_i2c_debug(struct cxd2841er_priv *priv, { dev_dbg(&priv->i2c->dev, "cxd2841er: I2C %s addr %02x reg 0x%02x size %d data %*ph\n", - (write == 0 ? "read" : "write"), addr, reg, len, len, data); + str_write_read(write), addr, reg, len, len, data); } static int cxd2841er_write_regs(struct cxd2841er_priv *priv, diff --git a/drivers/media/dvb-frontends/drxk_hard.c b/drivers/media/dvb-frontends/drxk_hard.c index 87f3d4f0eb8c..cbb1ba0f1323 100644 --- a/drivers/media/dvb-frontends/drxk_hard.c +++ b/drivers/media/dvb-frontends/drxk_hard.c @@ -1068,7 +1068,7 @@ static int mpegts_configure_pins(struct drxk_state *state, bool mpeg_enable) u16 err_cfg = 0; dprintk(1, ": mpeg %s, %s mode\n", - mpeg_enable ? "enable" : "disable", + str_enable_disable(mpeg_enable), state->m_enable_parallel ? "parallel" : "serial"); /* stop lock indicator process */ @@ -6279,7 +6279,7 @@ static int drxk_gate_ctrl(struct dvb_frontend *fe, int enable) { struct drxk_state *state = fe->demodulator_priv; - dprintk(1, ": %s\n", enable ? "enable" : "disable"); + dprintk(1, ": %s\n", str_enable_disable(enable)); if (state->m_drxk_state == DRXK_NO_DEV) return -ENODEV; diff --git a/drivers/media/dvb-frontends/helene.c b/drivers/media/dvb-frontends/helene.c index f127adee3ebb..b4527c141d9c 100644 --- a/drivers/media/dvb-frontends/helene.c +++ b/drivers/media/dvb-frontends/helene.c @@ -279,7 +279,7 @@ static void helene_i2c_debug(struct helene_priv *priv, u8 reg, u8 write, const u8 *data, u32 len) { dev_dbg(&priv->i2c->dev, "helene: I2C %s reg 0x%02x size %d\n", - (write == 0 ? "read" : "write"), reg, len); + str_write_read(write), reg, len); print_hex_dump_bytes("helene: I2C data: ", DUMP_PREFIX_OFFSET, data, len); } diff --git a/drivers/media/dvb-frontends/horus3a.c b/drivers/media/dvb-frontends/horus3a.c index 0330b78a5b3f..10300ebf3ca0 100644 --- a/drivers/media/dvb-frontends/horus3a.c +++ b/drivers/media/dvb-frontends/horus3a.c @@ -38,7 +38,7 @@ static void horus3a_i2c_debug(struct horus3a_priv *priv, u8 reg, u8 write, const u8 *data, u32 len) { dev_dbg(&priv->i2c->dev, "horus3a: I2C %s reg 0x%02x size %d\n", - (write == 0 ? "read" : "write"), reg, len); + str_write_read(write), reg, len); print_hex_dump_bytes("horus3a: I2C data: ", DUMP_PREFIX_OFFSET, data, len); } diff --git a/drivers/media/dvb-frontends/sp2.c b/drivers/media/dvb-frontends/sp2.c index 75adf2a4589f..0332e3c312c6 100644 --- a/drivers/media/dvb-frontends/sp2.c +++ b/drivers/media/dvb-frontends/sp2.c @@ -132,7 +132,7 @@ static int sp2_ci_op_cam(struct dvb_ca_en50221 *en50221, int slot, u8 acs, return ret; dev_dbg(&s->client->dev, "%s: slot=%d, addr=0x%04x, %s, data=%x", - (read) ? "read" : "write", slot, addr, + str_read_write(read), slot, addr, (acs == SP2_CI_ATTR_ACS) ? "attr" : "io", (read) ? mem : data); 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; } From patchwork Mon Sep 30 12:04:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816284 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 03D86CF64A6 for ; Mon, 30 Sep 2024 12:54:51 +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=ROQ1HhB5eUHGQkR1Zb9xX876/ICgPqUa0J3DMNQ2iR0=; b=z0UqRsmEKtUETh66xCnf0DMDkK 4/eLiwoZWa6hd6BaSAjKbRGKE4vh6jxczejKuIfJlvX5+rfje+VQVmFqXagYRZZOt+7i25VuS2fxd EbLTqqzgb6SYWiDFkUVlDuTMIxOLEOOMVSNkvh/QkDlzCCn7d8019zZLcyg1/Sep+qv2M3DSrut2d buKYrLyNRBPMce+sYVTbIoxrdYoFcqeOXyawU8pnHnpCtTJh/p7oMOcPQJZGw/U4CxccN4HHazQ7L K9H+EYGci23QDqk9Qo/1mE8z4RGrMTRnaiVCn3gh2r8pSCFQt8BuyFDHRQRAq9dzO81CWDxMfvtGL vKmNEm5w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svFvE-0000000H9br-1QRP; Mon, 30 Sep 2024 12:54:40 +0000 Received: from mail-qk1-x733.google.com ([2607:f8b0:4864:20::733]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svF8k-0000000GwJr-1mlK for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 12:04:35 +0000 Received: by mail-qk1-x733.google.com with SMTP id af79cd13be357-7a9aa913442so430695685a.1 for ; Mon, 30 Sep 2024 05:04:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697873; x=1728302673; 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=ROQ1HhB5eUHGQkR1Zb9xX876/ICgPqUa0J3DMNQ2iR0=; b=f5+EhtgHGMSzhQSMM+q4uml5V/K/eNnGEk3NbPGp5sMDHNNBJaQjG3BZqFX4i43M6X Py5eWw02XBLZRpEyJGYxenweUWD/Elgq45wAJbEXGW8Z9Up5YYhHwhM6PPzUHFqDgd8M b9Xh8IVIYrxEQw6eKsljsmIJYqH/k839QeU6Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697873; x=1728302673; 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=ROQ1HhB5eUHGQkR1Zb9xX876/ICgPqUa0J3DMNQ2iR0=; b=n0MT3g85iFKGDNFopGY0HSxhgXsHzZ9s8IWoXkP0fzjUsv0LNS6iSMZtsoyZ19i1GW 9sFIbYFBf080eNpkQwTjIhgpKrE2z8X7h4MuEbMMtwOTCOXlUXaKJXkn29HiMGAUoNKr s4VNVDDiITTBmu6L0E7fgu3YLvyBbjvCY2VBUG4QttH4Q9ZV67Us6nkmkKEvYu24uI9m n6Ej8xVP2ZAZW+eWOAE5o2XTpg6NkSi8pFSnxc1adVLZoOA5FO81IBiqTd5A0RStfxKk d/ybO1t/aPsfRT16/eHN1qua3Z13q71nMjlLX5KBmnx6N+vFk23KgXpXdO7BUEC3TWZ/ 9OZQ== X-Forwarded-Encrypted: i=1; AJvYcCULnhQ5FxcOXR8CRYYWI2EzrM0YaGRxVMl9bGxoDrMwFDBxyVbYlTt7MB+AR32O7bX3guY5mZ44gGFnjipNrUu5@lists.infradead.org X-Gm-Message-State: AOJu0Yw6Lu9jcHpdkZw+fOkQww+W6+JHdqrgT1rdZuta61NAFPtIs7eD Irbj/AwBKqDgu1ZpaMn/y066PdydzjFUJcfhCl6wdOUhKFy1fMRviDT7i3gJdQ== X-Google-Smtp-Source: AGHT+IGlpLvOiABRGPfPC5tWhysrrPiJ2yte8Y1JxuD34Gtndo3CQ3SWzVD7Qrk2mRRfbUS2vxDpnw== X-Received: by 2002:a05:6214:458d:b0:6c7:c63f:b414 with SMTP id 6a1803df08f44-6cb3b6407b6mr208576446d6.33.1727697872928; Mon, 30 Sep 2024 05:04:32 -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.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:32 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:09 +0000 Subject: [PATCH 14/45] media: saa7134: Use string_choices helpers MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-14-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_050434_502232_705998DF X-CRM114-Status: GOOD ( 14.39 ) 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/saa7134/saa7134-cards.c:7984:7-16: opportunity for str_yes_no(( 1 == rc )) drivers/media/pci/saa7134/saa7134-dvb.c:93:31-33: opportunity for str_on_off(ok) drivers/media/pci/saa7134/saa7134-input.c:919:3-12: opportunity for str_yes_no(( rc == 1 )) drivers/media/pci/saa7134/saa7134-input.c:898:3-12: opportunity for str_yes_no(( 1 == rc )) drivers/media/pci/saa7134/saa7134-input.c:934:3-12: opportunity for str_yes_no(( 1 == rc )) drivers/media/pci/saa7134/saa7134-video.c:622:10-15: opportunity for str_enabled_disabled(flags) Signed-off-by: Ricardo Ribalda --- drivers/media/pci/saa7134/saa7134-cards.c | 2 +- drivers/media/pci/saa7134/saa7134-dvb.c | 2 +- drivers/media/pci/saa7134/saa7134-input.c | 6 +++--- drivers/media/pci/saa7134/saa7134-video.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/media/pci/saa7134/saa7134-cards.c b/drivers/media/pci/saa7134/saa7134-cards.c index e80fb4ebfda6..79cd61fb0205 100644 --- a/drivers/media/pci/saa7134/saa7134-cards.c +++ b/drivers/media/pci/saa7134/saa7134-cards.c @@ -7981,7 +7981,7 @@ int saa7134_board_init2(struct saa7134_dev *dev) rc = i2c_transfer(&dev->i2c_adap, &msg, 1); pr_info("%s: probe IR chip @ i2c 0x%02x: %s\n", dev->name, msg.addr, - (1 == rc) ? "yes" : "no"); + str_yes_no(rc == 1)); if (rc == 1) dev->has_remote = SAA7134_REMOTE_I2C; } diff --git a/drivers/media/pci/saa7134/saa7134-dvb.c b/drivers/media/pci/saa7134/saa7134-dvb.c index 6de8a02314af..d0e58a0156f7 100644 --- a/drivers/media/pci/saa7134/saa7134-dvb.c +++ b/drivers/media/pci/saa7134/saa7134-dvb.c @@ -90,7 +90,7 @@ static int pinnacle_antenna_pwr(struct saa7134_dev *dev, int on) saa_setl(SAA7134_GPIO_GPSTATUS0 >> 2, (1 << 28)); udelay(10); ok = saa_readl(SAA7134_GPIO_GPSTATUS0) & (1 << 27); - pr_debug("%s %s\n", __func__, ok ? "on" : "off"); + pr_debug("%s %s\n", __func__, str_on_off(ok)); if (!ok) saa_clearl(SAA7134_GPIO_GPSTATUS0 >> 2, (1 << 26)); diff --git a/drivers/media/pci/saa7134/saa7134-input.c b/drivers/media/pci/saa7134/saa7134-input.c index 8610eb473b39..239f0b9d080a 100644 --- a/drivers/media/pci/saa7134/saa7134-input.c +++ b/drivers/media/pci/saa7134/saa7134-input.c @@ -895,7 +895,7 @@ void saa7134_probe_i2c_ir(struct saa7134_dev *dev) rc = i2c_transfer(&dev->i2c_adap, &msg_msi, 1); input_dbg("probe 0x%02x @ %s: %s\n", msg_msi.addr, dev->i2c_adap.name, - (1 == rc) ? "yes" : "no"); + str_yes_no(rc == 1)); break; case SAA7134_BOARD_SNAZIO_TVPVR_PRO: dev->init_data.name = "SnaZio* TVPVR PRO"; @@ -916,7 +916,7 @@ void saa7134_probe_i2c_ir(struct saa7134_dev *dev) rc = i2c_transfer(&dev->i2c_adap, &msg_msi, 1); input_dbg("probe 0x%02x @ %s: %s\n", msg_msi.addr, dev->i2c_adap.name, - (rc == 1) ? "yes" : "no"); + str_yes_no(rc == 1)); break; case SAA7134_BOARD_KWORLD_PC150U: /* copied and modified from MSI TV@nywhere Plus */ @@ -931,7 +931,7 @@ void saa7134_probe_i2c_ir(struct saa7134_dev *dev) rc = i2c_transfer(&dev->i2c_adap, &msg_msi, 1); input_dbg("probe 0x%02x @ %s: %s\n", msg_msi.addr, dev->i2c_adap.name, - (1 == rc) ? "yes" : "no"); + str_yes_no(rc == 1)); break; case SAA7134_BOARD_HAUPPAUGE_HVR1110: dev->init_data.name = saa7134_boards[dev->board].name; diff --git a/drivers/media/pci/saa7134/saa7134-video.c b/drivers/media/pci/saa7134/saa7134-video.c index 56b4481a40e6..1c02fb04abdf 100644 --- a/drivers/media/pci/saa7134/saa7134-video.c +++ b/drivers/media/pci/saa7134/saa7134-video.c @@ -619,7 +619,7 @@ static int saa7134_enable_analog_tuner(struct saa7134_dev *dev) if (ret) { pr_err("Couldn't change link %s->%s to %s. Error %d\n", source->name, sink->name, - flags ? "enabled" : "disabled", + str_enabled_disabled(flags), ret); return ret; } From patchwork Mon Sep 30 12:04:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816311 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 CCAEFCF6497 for ; Mon, 30 Sep 2024 12:56:02 +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=xpVUYLeo0hSTOfKt30J/ldl6oRGhulqCfi0QX1kLeY0=; b=KBIl7ejh4X40aMUXiZ21hq2ePP S/Ci/I5+niev17sR8DCqKauKlaFGbqdWuAJpJiJcd9Q8MG7WFUcThuOmbDT3RKXVGTvCBdeOLj8pM XK1F4D+t4lgUeLz3AksuDbN5D4T9+fo7xVOv3RAAlQgmG6lHocagKqMbg+S8IstoDfON386AuFCjr 9hE4ZeaciXRJiGLnQeXqBPyfeG92EzzCusfIc+xd71GYaJ5EO6brOUzaX8Yto5bzQ2ZTlhftdYHiz 03x7esRGLNac7Hq4VCzr9SbSUCXqUXy8iT1X1MLqJexSjyPyy3jFLntBVPq57PMh6Jyu7435RjRlu 5cI6aXgA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svFwP-0000000H9y3-3zVx; Mon, 30 Sep 2024 12:55:54 +0000 Received: from mail-oo1-xc30.google.com ([2607:f8b0:4864:20::c30]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svF8m-0000000GwL2-2VqZ for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 12:04:38 +0000 Received: by mail-oo1-xc30.google.com with SMTP id 006d021491bc7-5e1b55346c0so1791929eaf.3 for ; Mon, 30 Sep 2024 05:04:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697875; x=1728302675; 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=xpVUYLeo0hSTOfKt30J/ldl6oRGhulqCfi0QX1kLeY0=; b=b0a0RNUyJTwtaCZBQGWZvbHRg4AkV0/fTGbitsdMeuF/MEN73WoNCLsddDJ3Bs3+xW tFzwkO7R3GwcYkY0hHHR6ZPYqwVaRQUuJR3Z+LhTKR/gjWTIpZtOV2D5tyiPb2LDgEUu wbEg35ximKjzRFm/Yp6m04mK0ACRWr2XKvM7Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697875; x=1728302675; 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=xpVUYLeo0hSTOfKt30J/ldl6oRGhulqCfi0QX1kLeY0=; b=t1FDihUZ0NwYEHd2Olm9wC4vUsOynOejoE91JlktmLlUqfshPo/zt3/2R/3vZcchXs 4ROIlG2juWL9WV3JHDUVRup5lY0V9ac4CgUhlwLFVr8zUmXF/2ZU0GuwlmVRo4PmTGSr OxAp1m4IzHaPEysMyK2qcyhDD602n2ZqwnP9E3MD5bCBxZy8B/74LGDKTVavXCA4VUx/ bKae8kCeeA3Q+U2buzkgJyf+D+o+95GiI0RN4TKgwsz5D/Uu4Xtk/GzucLewLGsQdHT5 WlruuZ/7ui1DgJGKLzit7KQO1TDpH7W/BdqgZoDzBlFnfo8CDtBR7FqoolA3fn30E2NT 8ZaQ== X-Forwarded-Encrypted: i=1; AJvYcCU4sTPwuh+P2EnMwWn3fFDkKDNz9sR5n0DjLcFQcJrfbyG9bDCqk2HbJKf4Dk7b2Qg7AE2IdfxQpDKz7RV7HEVe@lists.infradead.org X-Gm-Message-State: AOJu0YwjKvS/7g7kiz499wJp6GGSBbgc0U/K/4u6XVSJRcIENTS65icw 5pMECss4TxVWgWytJDs4t1g4Bu1/u8XhXY0TlfQV76AeeWOxDzk67LxryZKwcg== X-Google-Smtp-Source: AGHT+IGd3K8vbb6GyQdRKaZnKoS5TA6gIcUfCdqxCm9K5gJfl06dGrwyNT5yGfSWCEUO0kuvQMkCfQ== X-Received: by 2002:a05:6358:e4a9:b0:1b5:968f:e221 with SMTP id e5c5f4694b2df-1becbb39bb4mr326693155d.2.1727697875191; Mon, 30 Sep 2024 05:04:35 -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.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:33 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:10 +0000 Subject: [PATCH 15/45] media: amphion: Use string_choices helpers MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-15-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_050436_744969_5404E648 X-CRM114-Status: GOOD ( 13.08 ) 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/platform/amphion/venc.c:1206:4-26: opportunity for str_enable_disable(venc -> params . rc_enable) drivers/media/platform/amphion/vpu_dbg.c:259:3-34: opportunity for str_on_off(vpu_iface_get_power_state ( core )) Signed-off-by: Ricardo Ribalda --- drivers/media/platform/amphion/venc.c | 2 +- drivers/media/platform/amphion/vpu_dbg.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/amphion/venc.c b/drivers/media/platform/amphion/venc.c index 351b4edc8742..789c8fca3d31 100644 --- a/drivers/media/platform/amphion/venc.c +++ b/drivers/media/platform/amphion/venc.c @@ -1203,7 +1203,7 @@ static int venc_get_debug_info(struct vpu_inst *inst, char *str, u32 size, u32 i break; case 8: num = scnprintf(str, size, "rc: %s, mode = %d, bitrate = %d(%d), qp = %d\n", - venc->params.rc_enable ? "enable" : "disable", + str_enable_disable(venc->params.rc_enable), venc->params.rc_mode, venc->params.bitrate, venc->params.bitrate_max, diff --git a/drivers/media/platform/amphion/vpu_dbg.c b/drivers/media/platform/amphion/vpu_dbg.c index 940e5bda5fa3..2dbcef4e83ef 100644 --- a/drivers/media/platform/amphion/vpu_dbg.c +++ b/drivers/media/platform/amphion/vpu_dbg.c @@ -256,7 +256,7 @@ static int vpu_dbg_core(struct seq_file *s, void *data) return 0; num = scnprintf(str, sizeof(str), "power %s\n", - vpu_iface_get_power_state(core) ? "on" : "off"); + str_on_off(vpu_iface_get_power_state(core))); if (seq_write(s, str, num)) return 0; num = scnprintf(str, sizeof(str), "state = %d\n", core->state); From patchwork Mon Sep 30 12:04:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816312 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 C6B9CCF64B1 for ; Mon, 30 Sep 2024 12:57:21 +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=W54Rxedr36zEnsk929u7YgHxA5FxY+YC4oIk0CEmtoU=; b=4DiU327dCFdhvaKZGoGZ6d28K9 pyMpyV/mcxEyk8jNRzcG+hxzNawm/3mxsaWtxp6dP+ULhaEL6AFWsGBuD4Tkbrs1A6UnGdMugKeoA gnSI/WpogJ/SFOj8iIDCSP2CtKrJaIZKCsiZR4kzRlUllQ8Gw3TIGU3GXh8RHLYymc7JkXktBAxUl XmfBR12jwhGcCKwyLlfgNbSQIqegCT7MA45MTdkn78fmUXreGu8XftcUH4RfV3sbi6pfWY/a8NPEs F0tchHmoMjC2FBxYyT1VLszcpIYoXoPvA0IclDmQgnQeyo4U0st7mJnoKOPL9kdf40HFDhlqbAXYL pnMYqr/w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svFxf-0000000HASV-1rLL; Mon, 30 Sep 2024 12:57:11 +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 1svF8p-0000000GwMU-0eRE for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 12:04:40 +0000 Received: by mail-qv1-xf2a.google.com with SMTP id 6a1803df08f44-6cb27e974ceso26202266d6.1 for ; Mon, 30 Sep 2024 05:04:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697878; x=1728302678; 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=W54Rxedr36zEnsk929u7YgHxA5FxY+YC4oIk0CEmtoU=; b=a/rpB1NKCvbVpliU8TjEqVh9/gs8UwQDmKzFaXSCF33lo4twn3IhAdyy/cscxlLuJe grWwvvVgJEwQ/rxNG8IxZWpVd0bWZE7VI9GWnH0SsJkU5H6X1yIVuuAMAuHbDVAtfJ8o pclXbiMRI4QlD8XlcFpzUXL+U+ufRBoB8aeYM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697878; x=1728302678; 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=W54Rxedr36zEnsk929u7YgHxA5FxY+YC4oIk0CEmtoU=; b=FmNYmcK9wsFqobuYZ7Dv3h3M6+Api+fMnXgPariI6RHuKl6XX1ttfewgMeCerePj1q rcodUA+r7lkIJ6dUEpitQaTy4NJ6443pNJrhMOfTg1YdR1SRtFpbgfLli+1+Y2yRpxfc nhEUPxavdVD7ea9hKKAxaZ6Dm5zOC7SYIv5KpkIcmMWH1ACRX/NXYfC3X/I37aba4j/p oVVfs4AQ30MFVuNDFTs0Xg1p7L6jo1CzwVe4KFi1O+f008uxnocv6JYvu3dhMqaBNtsy onTPNcC8Bgg0JL4a3ozhwvP+OgmCC+XGHFY2ZXOsvS5EDzxqYIuWAWKt9i5w3bcSntVK pv+w== X-Forwarded-Encrypted: i=1; AJvYcCUyefpTulr0G1Iy4sWZRk+LEPV1v8e38TLm4qsEK7gpXVzHbPy73XO9laRcbiSvVegJTxl9iqVJq7ZNiIwtmwwh@lists.infradead.org X-Gm-Message-State: AOJu0YyEok2lPqREsw32jFgX4E4zceWpl90RPhdZYGRT7yKyt62Drupm mRA8a8KS7I90TXKjMMa3Ndu0rL/JvcJJe8jz02pyI2FmTnSKyutPW2UsYCW6SA== X-Google-Smtp-Source: AGHT+IGgo8OgcYFtsubdwQ48E/Z3+k42qUYOU3xS8KlzOd05WOz0ImPebYZJQvx35b0omDgntAq/gQ== X-Received: by 2002:ad4:580c:0:b0:6cb:3b6d:2775 with SMTP id 6a1803df08f44-6cb3b6d2d88mr154770176d6.17.1727697878145; Mon, 30 Sep 2024 05:04:38 -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.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:36 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:11 +0000 Subject: [PATCH 16/45] media: pci: ivtv: Use string_choices helpers MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-16-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_050439_230715_9DFB8AA0 X-CRM114-Status: GOOD ( 11.90 ) 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/ivtv/ivtvfb.c:809:3-57: opportunity for str_on_off(( var -> vmode & FB_VMODE_MASK ) == FB_VMODE_NONINTERLACED) drivers/media/pci/ivtv/ivtvfb.c:609:3-57: opportunity for str_on_off(( var -> vmode & FB_VMODE_MASK ) == FB_VMODE_NONINTERLACED) Signed-off-by: Ricardo Ribalda --- drivers/media/pci/ivtv/ivtvfb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/pci/ivtv/ivtvfb.c b/drivers/media/pci/ivtv/ivtvfb.c index 90c584cf97c2..bd07afc68191 100644 --- a/drivers/media/pci/ivtv/ivtvfb.c +++ b/drivers/media/pci/ivtv/ivtvfb.c @@ -606,7 +606,7 @@ static int ivtvfb_set_var(struct ivtv *itv, struct fb_var_screeninfo *var) var->left_margin, var->upper_margin); IVTVFB_DEBUG_INFO("Display filter: %s\n", - (var->vmode & FB_VMODE_MASK) == FB_VMODE_NONINTERLACED ? "on" : "off"); + str_on_off((var->vmode & FB_VMODE_MASK) == FB_VMODE_NONINTERLACED)); IVTVFB_DEBUG_INFO("Color space: %s\n", var->nonstd ? "YUV" : "RGB"); return 0; @@ -806,7 +806,7 @@ static int _ivtvfb_check_var(struct fb_var_screeninfo *var, struct ivtv *itv) var->left_margin, var->upper_margin); IVTVFB_DEBUG_INFO("Display filter: %s\n", - (var->vmode & FB_VMODE_MASK) == FB_VMODE_NONINTERLACED ? "on" : "off"); + str_on_off((var->vmode & FB_VMODE_MASK) == FB_VMODE_NONINTERLACED)); IVTVFB_DEBUG_INFO("Color space: %s\n", var->nonstd ? "YUV" : "RGB"); return 0; } From patchwork Mon Sep 30 12:04:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816078 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 DFB6CCF6497 for ; Mon, 30 Sep 2024 12:19:14 +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=qO3qqbTfvsnj8f4B9o9/p9r5ocz9pMXhz3VcGEq7myc=; b=2J8j/9lq3I4+YDc5yQTfLgYLD+ VY8m/TzrhmACM9JIXuOSBYSMA4d8TfBDMaVVXe8JQxyPIsOzc8J2HW+CFyfOC/z9JlWGYYg/ezhbm oUzORrLauKorQEyKzWdpPMktYL9wkKWMMO5NrGn4rJITg1Zke6bUhkgJoHzQeDzqd7hK4XEqkbML3 zPj0pWCAEX+nYVm/6Gebcump9iXVsJ0UkWWMXCka8scSFpYInELRFLPzY1/4/YdIj9My15wQiNqow DTsCurHLIBt++lSdOV3wA5SotoW22YEHgFlLeSB4JCm/DbMblFDHnBH6WUJ4aU65nNj4n9Fa0cJXc 1n1dnutg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svFMl-0000000H0N2-1KcS; Mon, 30 Sep 2024 12:19:03 +0000 Received: from mail-qv1-xf30.google.com ([2607:f8b0:4864:20::f30]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svF8r-0000000GwNL-26LV for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 12:04:43 +0000 Received: by mail-qv1-xf30.google.com with SMTP id 6a1803df08f44-6cb2d2a7d48so30196696d6.3 for ; Mon, 30 Sep 2024 05:04:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697880; x=1728302680; 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=qO3qqbTfvsnj8f4B9o9/p9r5ocz9pMXhz3VcGEq7myc=; b=cdVvdgu7a9HLygYD+4ooYrQ6XfOxCDQphu7kQ73/7v12Of1hE155lutnB7QZzqtjCz NqMMrhu3ZWqchwQvr6cCvZFUcznnlRBYDO4MK++itLb+QHijfrYWhaqXUVfJSSf60r8p bhCAZCm0noFSb5QRzasi6fJW8Sy2WP0TWP+Lc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697880; x=1728302680; 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=qO3qqbTfvsnj8f4B9o9/p9r5ocz9pMXhz3VcGEq7myc=; b=f7relWq9rV6GCaPsfN67PJ4b0mZTXZMLLlWmxXQweQbQiVIM4Gbys8wlMBAAffc7vB i6mSJekW6o6O2AO5BEuvHTOtAgDW2DqxY12MXXBknsDtIP8mJ0QygG+RlzdPvzHACKwk B6jkzED+5LKftThj6iyIMm6GKDHk7M3SrCz6OFJMV67FQLB814O4eMMSDDzaOn90nxCa Esh1eCDwdcwwRITrXPkMPDNT+A0UOcJIy5jwJXAwo1HD7NyUJypoL67pEYVloAv2u1hg F5tr+gtwD7P7SrNaOFiPts/GbqKXZ/4gCiyeble/67EkVQfhlKvJjPBq/ERMFaeVXr3F U6Vg== X-Forwarded-Encrypted: i=1; AJvYcCV+qr7DPSIfjQ+kmEwnCM3osmBVTW0zp5QwkPNimG8GQBwwNBLR2ocVkJSLvN4HM3uxnkWGC6gLa3ngHbrEWQ6f@lists.infradead.org X-Gm-Message-State: AOJu0YwxVTMS0SFEkpKVof9erZeFzbu2aJgEYHIfDryDFkV3wx5chHNV 7zbu45iQjhNgtu125c5cI8uyNsoEG44bSdV4zt43rG2tq4Skm+YynlkNZ6gmTg== X-Google-Smtp-Source: AGHT+IF/X+sGDFBK/b7MOemtir5qM4qeQwBGu/ooPVVD2yNCkIbVJsvPbz9WJQ+49WCJsrC1J8x5UQ== X-Received: by 2002:a05:6214:4901:b0:6cb:4b47:e4a9 with SMTP id 6a1803df08f44-6cb4b47e5ffmr151055736d6.2.1727697880010; Mon, 30 Sep 2024 05:04:40 -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.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:38 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:12 +0000 Subject: [PATCH 17/45] media: bttv: Use string_choices helpers MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-17-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_050441_581072_3359F88F X-CRM114-Status: GOOD ( 12.50 ) 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/bt8xx/bttv-driver.c:2988:5-31: opportunity for str_yes_no(dstat & BT848_DSTATUS_HLOC) drivers/media/pci/bt8xx/bttv-driver.c:2992:5-31: opportunity for str_yes_no(dstat & BT848_DSTATUS_PRES) drivers/media/pci/bt8xx/bttv-cards.c:3039:13-22: opportunity for str_yes_no(has_radio) drivers/media/pci/bt8xx/bttv-cards.c:3040:2-12: opportunity for str_yes_no(has_remote) drivers/media/pci/bt8xx/bttv-cards.c:3043:2-21: opportunity for str_yes_no(has_tda9820_tda9821) drivers/media/pci/bt8xx/bttv-cards.c:3044:2-17: opportunity for str_yes_no(is_capture_only) drivers/media/pci/bt8xx/bttv-cards.c:3042:13-20: opportunity for str_yes_no(is_lr90) drivers/media/pci/bt8xx/bttv-cards.c:4080:8-19: opportunity for str_yes_no(tuner_tv_fm) drivers/media/pci/bt8xx/bttv-cards.c:3140:24-38: opportunity for str_yes_no(btv -> has_radio) drivers/media/pci/bt8xx/bttv-cards.c:4081:8-23: opportunity for str_yes_no(btv -> has_remote) Signed-off-by: Ricardo Ribalda --- drivers/media/pci/bt8xx/bttv-cards.c | 16 ++++++++-------- drivers/media/pci/bt8xx/bttv-driver.c | 6 ++---- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/media/pci/bt8xx/bttv-cards.c b/drivers/media/pci/bt8xx/bttv-cards.c index 867c1308de23..f989b5ed28fd 100644 --- a/drivers/media/pci/bt8xx/bttv-cards.c +++ b/drivers/media/pci/bt8xx/bttv-cards.c @@ -3036,12 +3036,12 @@ static void flyvideo_gpio(struct bttv *btv) tuner_type = TUNER_ABSENT; /* No tuner present */ pr_info("%d: FlyVideo Radio=%s RemoteControl=%s Tuner=%d gpio=0x%06x\n", - btv->c.nr, has_radio ? "yes" : "no", - has_remote ? "yes" : "no", tuner_type, gpio); + btv->c.nr, str_yes_no(has_radio), + str_yes_no(has_remote), tuner_type, gpio); pr_info("%d: FlyVideo LR90=%s tda9821/tda9820=%s capture_only=%s\n", - btv->c.nr, is_lr90 ? "yes" : "no", - has_tda9820_tda9821 ? "yes" : "no", - is_capture_only ? "yes" : "no"); + btv->c.nr, str_yes_no(is_lr90), + str_yes_no(has_tda9820_tda9821), + str_yes_no(is_capture_only)); if (tuner_type != UNSET) /* only set if known tuner autodetected, else let insmod option through */ btv->tuner_type = tuner_type; @@ -3137,7 +3137,7 @@ static void miro_pinnacle_gpio(struct bttv *btv) if (-1 != msp) btv->c.type = BTTV_BOARD_PINNACLEPRO; pr_info("%d: pinnacle/mt: id=%d info=\"%s\" radio=%s\n", - btv->c.nr, id, info, btv->has_radio ? "yes" : "no"); + btv->c.nr, id, info, str_yes_no(btv->has_radio)); btv->tuner_type = TUNER_MT2032; } } @@ -4077,8 +4077,8 @@ static void avermedia_eeprom(struct bttv *btv) } else pr_cont("Unknown type"); pr_cont(" radio:%s remote control:%s\n", - tuner_tv_fm ? "yes" : "no", - btv->has_remote ? "yes" : "no"); + str_yes_no(tuner_tv_fm), + str_yes_no(btv->has_remote)); } /* diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c index 511f013cc338..fdad666d3d0f 100644 --- a/drivers/media/pci/bt8xx/bttv-driver.c +++ b/drivers/media/pci/bt8xx/bttv-driver.c @@ -2985,12 +2985,10 @@ static irqreturn_t bttv_irq(int irq, void *dev_id) bttv_print_irqbits(stat,astat); if (stat & BT848_INT_HLOCK) pr_cont(" HLOC => %s", - dstat & BT848_DSTATUS_HLOC - ? "yes" : "no"); + str_yes_no(dstat & BT848_DSTATUS_HLOC)); if (stat & BT848_INT_VPRES) pr_cont(" PRES => %s", - dstat & BT848_DSTATUS_PRES - ? "yes" : "no"); + str_yes_no(dstat & BT848_DSTATUS_PRES)); if (stat & BT848_INT_FMTCHG) pr_cont(" NUML => %s", dstat & BT848_DSTATUS_NUML From patchwork Mon Sep 30 12:04:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816079 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 6CFAECF6497 for ; Mon, 30 Sep 2024 12:20:26 +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=+JjigCj7wmiDgTIVi8lxvvE6Xnwp6vOIIL7mEoeKjLo=; b=bM4L5PaxCeOiRcvOsdm2avbl/r aUsVFHQentI6sgaw46fBH3R2zQxf4RP0z9MuPuv73Fy8qVEbtLIaEUXb2HrM7I3tA6ufGfcDR11qF g+0OlEoUNx/EpIadBgn3IiTgRqLsdyrJfCi2JFU6e5iL9QsUi+lTIr9SoJ3/4qIPqe+n4qV8AvRFb /+SLWUQ94K6cdJFztblz027BQECXrbgEydlMFloWbOo1HNTA8cKlEr2u4Po2FjkTIIk2TWeY83HXd qeOPLd3j1b0CfxgpM2n2ddPg0/skiECqntloxfomovth+0sybbX73xvvckgqZoyRoCJDmNJ6lGe9P qcMRU52Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svFNw-0000000H0jF-3gW6; Mon, 30 Sep 2024 12:20:16 +0000 Received: from mail-oo1-xc32.google.com ([2607:f8b0:4864:20::c32]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svF8t-0000000GwO6-1gsu for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 12:04:45 +0000 Received: by mail-oo1-xc32.google.com with SMTP id 006d021491bc7-5e5a0519ef3so1859234eaf.0 for ; Mon, 30 Sep 2024 05:04:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697882; x=1728302682; 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=+JjigCj7wmiDgTIVi8lxvvE6Xnwp6vOIIL7mEoeKjLo=; b=DXyXUyZ97DBr1fnqalJtneEOmmC0cI+3OXx+UpkC/nrvsvmMcDA2N1bgFhFnKAyuPE 8wnY1n6Ola0zmhIhVRNZJv77ZxY/rLGJ+71vyj3aoIWXlBDgNx27cqsJMfdcmSjmHCEc XDNULqtrDLuo+uub+xq3ZZkLliAVSyvGw2U0A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697882; x=1728302682; 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=+JjigCj7wmiDgTIVi8lxvvE6Xnwp6vOIIL7mEoeKjLo=; b=McCUcqmakD4xnXybiHlXHLqeQtVuS6KJhMTFRby1NKU7nMT9S1kl8aoS3A4IC0OdZ+ 2igdpQu9kESAKTDmB6HXwkg51tmskSBIXpbP/2RuYtf/q4IHPMKe9oe9cdqgqehWW8Fg ZdY5C80jFzIC7yGcldm4JaUDJOerUlu8UVTbNMVT60nT3xl84AbuJdfCe+4TPA4BsVT7 F0tN9lI6hfJMvIj+5tS/NyPR+q5BpTHuvqb+7TE/Qcv7oPGWcUnLaUOtIHOrMODIeiPq T7NhVQgZOUOkpKkKX11dc9eZODotIlAEctBQahZWEZxWGclUD2eFfDhaC1k85KHOUech 2M9w== X-Forwarded-Encrypted: i=1; AJvYcCW9HI5QFPmGrpeaukxXxuV8HS1PB/0gXgAwDdllIgBdDmZKxbMAz7K9bAnC3gfmfqK/KwvTPD92/s7w8OOeF+Uo@lists.infradead.org X-Gm-Message-State: AOJu0YwE3OJ4oX8t7CEJQc8MBCBO4jyLjW0aQ76tIIO4lsQ5qZIMJb4z Vl93eIp9rRFCtXdCebEfXOJld09QRDWnmtUpAf4sZwwUxjUT/DGZxwq/mr8btQ== X-Google-Smtp-Source: AGHT+IHorNkcL7CG7P94wqWnm5CxVPJz+Rc1wLbNEDwAbC1i2AVoPfjS6B+31QnhNxiGPZOH/d/JVQ== X-Received: by 2002:a05:6359:4c9a:b0:1ad:10ff:341e with SMTP id e5c5f4694b2df-1becbb397e3mr239386155d.4.1727697882114; Mon, 30 Sep 2024 05:04:42 -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.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:40 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:13 +0000 Subject: [PATCH 18/45] media: xilinx: Use string_choices helpers MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-18-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_050443_514825_7A8B98EA X-CRM114-Status: GOOD ( 10.87 ) 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/platform/xilinx/xilinx-csi2rxss.c:415:3-27: opportunity for str_true_false(data & XCSI_CLKINFR_STOP) drivers/media/platform/xilinx/xilinx-csi2rxss.c:409:3-24: opportunity for str_true_false(data & XCSI_CSR_RIPCD) drivers/media/platform/xilinx/xilinx-csi2rxss.c:407:3-23: opportunity for str_true_false(data & XCSI_CSR_SLBF) drivers/media/platform/xilinx/xilinx-csi2rxss.c:403:3-29: opportunity for str_true_false(data & XCSI_CSR_SPFIFOFULL) drivers/media/platform/xilinx/xilinx-csi2rxss.c:405:3-27: opportunity for str_true_false(data & XCSI_CSR_SPFIFONE) drivers/media/platform/xilinx/xilinx-csi2rxss.c:424:4-30: opportunity for str_true_false(data & XCSI_DLXINFR_SOTERR) drivers/media/platform/xilinx/xilinx-csi2rxss.c:425:4-34: opportunity for str_true_false(data & XCSI_DLXINFR_SOTSYNCERR) drivers/media/platform/xilinx/xilinx-csi2rxss.c:426:4-28: opportunity for str_true_false(data & XCSI_DLXINFR_STOP) drivers/media/platform/xilinx/xilinx-csi2rxss.c:892:2-19: opportunity for str_enabled_disabled(xcsi2rxss -> en_vcx) Signed-off-by: Ricardo Ribalda --- drivers/media/platform/xilinx/xilinx-csi2rxss.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/media/platform/xilinx/xilinx-csi2rxss.c b/drivers/media/platform/xilinx/xilinx-csi2rxss.c index f953d5474ae0..7ddd9b265162 100644 --- a/drivers/media/platform/xilinx/xilinx-csi2rxss.c +++ b/drivers/media/platform/xilinx/xilinx-csi2rxss.c @@ -400,19 +400,19 @@ static int xcsi2rxss_log_status(struct v4l2_subdev *sd) dev_info(dev, "***** Core Status *****\n"); data = xcsi2rxss_read(xcsi2rxss, XCSI_CSR_OFFSET); dev_info(dev, "Short Packet FIFO Full = %s\n", - data & XCSI_CSR_SPFIFOFULL ? "true" : "false"); + str_true_false(data & XCSI_CSR_SPFIFOFULL)); dev_info(dev, "Short Packet FIFO Not Empty = %s\n", - data & XCSI_CSR_SPFIFONE ? "true" : "false"); + str_true_false(data & XCSI_CSR_SPFIFONE)); dev_info(dev, "Stream line buffer full = %s\n", - data & XCSI_CSR_SLBF ? "true" : "false"); + str_true_false(data & XCSI_CSR_SLBF)); dev_info(dev, "Soft reset/Core disable in progress = %s\n", - data & XCSI_CSR_RIPCD ? "true" : "false"); + str_true_false(data & XCSI_CSR_RIPCD)); /* Clk & Lane Info */ dev_info(dev, "******** Clock Lane Info *********\n"); data = xcsi2rxss_read(xcsi2rxss, XCSI_CLKINFR_OFFSET); dev_info(dev, "Clock Lane in Stop State = %s\n", - data & XCSI_CLKINFR_STOP ? "true" : "false"); + str_true_false(data & XCSI_CLKINFR_STOP)); dev_info(dev, "******** Data Lane Info *********\n"); dev_info(dev, "Lane\tSoT Error\tSoT Sync Error\tStop State\n"); @@ -421,9 +421,9 @@ static int xcsi2rxss_log_status(struct v4l2_subdev *sd) data = xcsi2rxss_read(xcsi2rxss, reg); dev_info(dev, "%d\t%s\t\t%s\t\t%s\n", i, - data & XCSI_DLXINFR_SOTERR ? "true" : "false", - data & XCSI_DLXINFR_SOTSYNCERR ? "true" : "false", - data & XCSI_DLXINFR_STOP ? "true" : "false"); + str_true_false(data & XCSI_DLXINFR_SOTERR), + str_true_false(data & XCSI_DLXINFR_SOTSYNCERR), + str_true_false(data & XCSI_DLXINFR_STOP)); reg += XCSI_NEXTREG_OFFSET; } @@ -889,7 +889,7 @@ static int xcsi2rxss_parse_of(struct xcsi2rxss_state *xcsi2rxss) fwnode_handle_put(ep); dev_dbg(dev, "vcx %s, %u data lanes (%s), data type 0x%02x\n", - xcsi2rxss->en_vcx ? "enabled" : "disabled", + str_enabled_disabled(xcsi2rxss->en_vcx), xcsi2rxss->max_num_lanes, xcsi2rxss->enable_active_lanes ? "dynamic" : "static", xcsi2rxss->datatype); From patchwork Mon Sep 30 12:04:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816085 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 73A48CF6497 for ; Mon, 30 Sep 2024 12:21:39 +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=d+1PZUGpVB6A0qj8dhi+z1VPBRWAZJyLXCCfSc2+bXs=; b=qAU0j9+Tk04FilSTvQLcyU+IBI 31ZdBGVs+8cKE1fO8kv+AiH88sdhsRyVdOBX4maeVoKRUwByexjaC0v2tYYs+5FOub5ahGlNF0x0N /s897xIIkLf+Snb3vxSydf6cvDMa9GCCQtWP6kZK7rSigtLmaf6Z9izDnfMLfRsNbMocH/ZuhX1LJ Tny1JiOKpqKf0PrzXg4VgRUo7hN6X2zEfgNdVokF0/NwOxarVeSluAhH9PV4HX8YJ+OJ7yIFSvQ7g 4h/PzH8Lv1tC+utVyHVUB9WXI6OyReI3bji5P0j/EY91crA2/J/NljrGcFPpGnDxBtskME2a++sas ztPNBNGA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svFP8-0000000H16m-1kLt; Mon, 30 Sep 2024 12:21:30 +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 1svF8u-0000000GwOr-3UML for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 12:04:46 +0000 Received: by mail-qv1-xf2a.google.com with SMTP id 6a1803df08f44-6cb2f272f8bso40063536d6.0 for ; Mon, 30 Sep 2024 05:04:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697884; x=1728302684; 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=d+1PZUGpVB6A0qj8dhi+z1VPBRWAZJyLXCCfSc2+bXs=; b=UHETgAHYN5Qs69XYQTqZ1PF9Bdws+6IrbwWshkXN+HY8OeKAmhm4eL9r4Qp5F2GX1J 8tSp7gG9tEGHR2RCYv3F4gyh2LBDUvQgIOjlyk7JnmnXhqSaviFGSjmBlP2bk8Wp+Ays YWtOK0JYUcc+sLsosauXu01ofsWWEaWx2Uh8I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697884; x=1728302684; 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=d+1PZUGpVB6A0qj8dhi+z1VPBRWAZJyLXCCfSc2+bXs=; b=J8EKio2TRMoWSFZUvygKKGGgkY5AssHoAkqpUg9MOhRtiMgEBxjYUoQLPkY7anf8yz tD4tAexNJ/X9XP3hXap8uV87WwG/Mgx6RHH2G9NVxpfiohVyHLp2EwA44vZWkuRxUe96 S8DtNGMFFvQ2RP28AJ9F6k/8xaZHPmJlio+ZufwA6iX2ooNWU+KvBq3Q055hIbOxLOaM gkY88Dvs6ZoVQ8r3QHFS4PdUxanwqRIc2p9pKBu36xbddR2Kwkuur/w8CmZkGo7YyovQ eJfYcl9eQl9Gi8MC11d+FdI67BcuO09R5FBdwBIXVtabMPronKjUVuH0QDC/7FcmZ8wg OKSg== X-Forwarded-Encrypted: i=1; AJvYcCVE9aRCRDoNHYadLRfdwPyb9VUFcr5dn9zDnAk+ysVc9K437fcpisfTjoxJLWcTBliwBVr9VbWWpW9AI4Nu1Aay@lists.infradead.org X-Gm-Message-State: AOJu0Ywm9E0Dlk2fg302lL42dwRRH+CMd8O2nHXLiSs2gtPRdcSxwHoN OIBlEGp/XYuGVVUATjQeuPEBPsHgzYuSHPFQOb8w6cIn+w/Kd3iw8p4kp5v6+g== X-Google-Smtp-Source: AGHT+IGmAxnIT189WVUBwg+x/R9UvWvqRDVNzUhwwxur3BAKszcZq3coNxLRGmF9WP2isGNKo1o/8A== X-Received: by 2002:a05:6214:5706:b0:6bf:7bcd:78e3 with SMTP id 6a1803df08f44-6cb3b643feamr164774016d6.29.1727697883855; Mon, 30 Sep 2024 05:04:43 -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.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:42 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:14 +0000 Subject: [PATCH 19/45] media: platform: ti: Use string_choices helpers MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-19-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_050444_914162_8E10421F X-CRM114-Status: GOOD ( 12.44 ) 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 warning is fixed: drivers/media/platform/ti/omap3isp/ispstat.c:771:21-27: opportunity for str_enable_disable(enable) Signed-off-by: Ricardo Ribalda --- drivers/media/platform/ti/omap3isp/ispstat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/ti/omap3isp/ispstat.c b/drivers/media/platform/ti/omap3isp/ispstat.c index 359a846205b0..603439afe582 100644 --- a/drivers/media/platform/ti/omap3isp/ispstat.c +++ b/drivers/media/platform/ti/omap3isp/ispstat.c @@ -768,7 +768,7 @@ int omap3isp_stat_enable(struct ispstat *stat, u8 enable) unsigned long irqflags; dev_dbg(stat->isp->dev, "%s: user wants to %s module.\n", - stat->subdev.name, enable ? "enable" : "disable"); + stat->subdev.name, str_enable_disable(enable)); /* Prevent enabling while configuring */ mutex_lock(&stat->ioctl_lock); From patchwork Mon Sep 30 12:04:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816086 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 DC2A6CF6497 for ; Mon, 30 Sep 2024 12:22:55 +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=h0yeJPaEcAnmgbtIHCIKdElv7f1NVvyLMutp/xQYAjQ=; b=nqCR3ZmcRoYoMcXuN/L7ssLYyu 1cBJzaoL0wBC6xMGkzmy0Ljac0toZsv6Of4SRqB97/ACAhqdDviX/el+vSDyw9MGLcceSHb5QkWej dCQCCT5p4JP9FhIxRkr0h7rCXR1Ii1PBSkw8C8AMKSuGsk+7EJTZw5Jm0Gc8Evk8TZpLj4+cT/IkD eiEcq7AriYOegJlbRK7wcXSnaujEXG5VM2K9VreyRxVPmqKUeirIYlwCgEr4oSgCI1D5YvEuG40e1 MqJCQaHHrnbCqGUZCuHvkdONOIm6BZfHqKIafavldcqFWd2HmTCKVjUw2zAQiUxOqV0rphVuMM9rS tu5EwVaA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svFQL-0000000H1Ui-2TIN; Mon, 30 Sep 2024 12:22:45 +0000 Received: from mail-qk1-x72c.google.com ([2607:f8b0:4864:20::72c]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svF8x-0000000GwPs-098N for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 12:04:48 +0000 Received: by mail-qk1-x72c.google.com with SMTP id af79cd13be357-7a9a30a0490so493845585a.3 for ; Mon, 30 Sep 2024 05:04:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697886; x=1728302686; 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=h0yeJPaEcAnmgbtIHCIKdElv7f1NVvyLMutp/xQYAjQ=; b=QLRncN49Fi/Nv1G5+BOhrVARDB0g/1Ket2YkXVWz+BFkt6Sz3df93c8aeMRBiUWYMz lbJ+aef4xHeAHP6CjQhLrvKm0aMhR9v4RqJ6SIGNx+CbhGffz4ouXwYvp3xNRnJ6kl/x kmbPB8kggeJmDCtjqEJ5epd1AsEBdySA0vQPo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697886; x=1728302686; 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=h0yeJPaEcAnmgbtIHCIKdElv7f1NVvyLMutp/xQYAjQ=; b=bW0MfMz/Zw3osmh0cc7AWRSz/X9GqRErKZFSIQGWjD+I1chueCdx9yMJ08SB7Lj5VO HVhURYIZW+aCvyW6DcPHCVy1VOETwkGh7YyzvRXcJZpQv6Ap0rTIgtRZ/M6Z3FlnQZaE 3/sozuHs14BtfpVYI5hoaejiQcKmD0C0Tgy7/AYoAAupPQm0Hys+89KCgBLjiRgjwc2w CLF5NEeXAdBFuMyrDMp7d8YtFM5JoialYmOQ4zAmILB7tNqVAIM7ZRDrioUISNmH6qrR qgoD5XbXvY3dcmFfoDeq+AvlFBTLJ4S1tDL5N7ej3uAOL44dv4H4eI2vf/Z9sSjmZDNh cbVA== X-Forwarded-Encrypted: i=1; AJvYcCVwreWV1DUu9mZIq/Rt6ey9JPjTr8HWdOg/oWKXWfS11mGn6nuImNmDp/0K65ZLjEPj7nJJfo64JvxTjnaVxRHS@lists.infradead.org X-Gm-Message-State: AOJu0YyuYvK2BYxBrxJb5HGXgndpVDWALEmHcGZl+VpcWTPFzBcb9piJ WiLd+km4cZNeRvlNFkdWWdiowAnHk063p5rtjETiPhvIdZM8PCMVITT7dpUMIA== X-Google-Smtp-Source: AGHT+IG21mP+tUHPXSvJJJTKpKcZKw04O9Ig9Voo1lmCCA0A43eFT06NNMj2BNffGbxEca0hhvGjiw== X-Received: by 2002:a05:6214:3a88:b0:6c5:b636:d737 with SMTP id 6a1803df08f44-6cb3b5b648amr195767466d6.2.1727697885829; Mon, 30 Sep 2024 05:04:45 -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.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:44 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:15 +0000 Subject: [PATCH 20/45] media: st: Use string_choices helpers MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-20-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_050447_114021_29142F1D X-CRM114-Status: GOOD ( 11.76 ) 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/platform/st/sti/hva/hva-debugfs.c:74:9-22: opportunity for str_true_false(ctrls -> dct8x8) drivers/media/platform/st/sti/hva/hva-debugfs.c:79:9-22: opportunity for str_true_false(ctrls -> sei_fp) drivers/media/platform/st/sti/hva/hva-debugfs.c:77:9-23: opportunity for str_true_false(ctrls -> vui_sar) Signed-off-by: Ricardo Ribalda --- drivers/media/platform/st/sti/hva/hva-debugfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/st/sti/hva/hva-debugfs.c b/drivers/media/platform/st/sti/hva/hva-debugfs.c index a86a07b6fbc7..5e8c7dddbabf 100644 --- a/drivers/media/platform/st/sti/hva/hva-debugfs.c +++ b/drivers/media/platform/st/sti/hva/hva-debugfs.c @@ -71,12 +71,12 @@ static void format_ctx(struct seq_file *s, struct hva_ctx *ctx) " | |- SEI frame packing type=%s\n", v4l2_ctrl_get_menu(entropy)[ctrls->entropy_mode], ctrls->cpb_size, - ctrls->dct8x8 ? "true" : "false", + str_true_false(ctrls->dct8x8), ctrls->qpmin, ctrls->qpmax, - ctrls->vui_sar ? "true" : "false", + str_true_false(ctrls->vui_sar), v4l2_ctrl_get_menu(vui_sar)[ctrls->vui_sar_idc], - ctrls->sei_fp ? "true" : "false", + str_true_false(ctrls->sei_fp), v4l2_ctrl_get_menu(sei_fp)[ctrls->sei_fp_type]); } From patchwork Mon Sep 30 12:04:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816087 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 F02DECF6499 for ; Mon, 30 Sep 2024 12:24: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=nZdkoyJRGbtYAtgWDyhzmqUrZ4ojuNTD42Wgr3aJHzg=; b=0oB4BiGGKuW3ePdzZfN4hw/xZD a5O0lbACV2xVnGZzGXY0QommOZXyx8sVLVTEZO5mQFldK1Y6EfzY5LcHt+TO66tnNfXc1m75hjQth ivIKzDeaVWTxIZhctniU4lD3cBcGYcJZt3kbTtDr94ncODO45bb6GaDppatoAd06H7IP6zCqWUoDl PL3gfGouf6afzTHGKdK6qf8fSMrR6U6I9454J+NjbbSkoTt92RwhhAP9aFRF2ZlqhPjH5xXGfXHCk MN5TL8/d6LWGhbSXVZfDOyqxnT58bndta0lQXOP1WWUV+HagEvrqqosoiywow6rOBP+62Y0IBKOE/ //pYRXQg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svFRX-0000000H1sG-1E72; Mon, 30 Sep 2024 12:23:59 +0000 Received: from mail-qk1-x72b.google.com ([2607:f8b0:4864:20::72b]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svF8y-0000000GwQk-1nbC for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 12:04:49 +0000 Received: by mail-qk1-x72b.google.com with SMTP id af79cd13be357-7a99fdf2e1aso581459285a.2 for ; Mon, 30 Sep 2024 05:04:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697887; x=1728302687; 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=nZdkoyJRGbtYAtgWDyhzmqUrZ4ojuNTD42Wgr3aJHzg=; b=HUcq1UzZsCNe0eG+9gxny69HuuD/e0wV+W03T79Evsf3BtiZkRrcR5i7yZEn+HDAaR P1ZWbDbE9EVeYiCX6OilpatHbzdVHFm7yheosz4xHyHwad3G4IuMMI8qNen3wrx4cha+ Gwc3blZYDfierBFY9aA6EewBHFDvELH+ck1aw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697887; x=1728302687; 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=nZdkoyJRGbtYAtgWDyhzmqUrZ4ojuNTD42Wgr3aJHzg=; b=QvZBnyG1tHMi4WH6neG2fiPsAtP4R+J7Vr0bVzML09rgEuOZV0lP5W4+tsP5qq9ErU EN9PJdsfzysDTYLQoQvfU1PiXcknVp7T39RIExRDfmw1iFx61FlQVxYvQpQRbdvcFpmS m+GnyrFPX/yl6hiTpSOiAtEc04fK0jNtYiyhBDELsnUHWpz0k1qR7agTbbGIaNH7VzIx +ei3uZCL+wQM55CjonKzeJ6PGcAaYdWqZTHiXOP13WzA7Gb1IKXkRLUrh42cyoyDBJnH 77XIgod8dMefgNuzzy5iGeSdM5YqPddur/QKe0C1G1wgQh6HPreVBxwNXHkLRGIE8392 rF+w== X-Forwarded-Encrypted: i=1; AJvYcCVg4v2wBaqwV/sUjunO+1yocVqHuCbs1ELRZ8RPDudXuTGYE4gcKfxJFOcC2M7cAtiTJ0PlMBEtnUWOeXZRaxiW@lists.infradead.org X-Gm-Message-State: AOJu0YyB4AkOpvVBWdXmZhfPrEIB0EcFMT4ZOSgwDZbi4moBgl5N7Scq 5ltveFVqRWWpJLq72h5JebmpDlLaWVkUDfjunLYjhk5YcV42Z0j0jb5HZw3CiQ== X-Google-Smtp-Source: AGHT+IGDig2qhJHVIgkos7cydvwLVCYXpIPoGe1fBfPazyzsBzvK7ByCA43K6ayYB6dav+TXdoGUKw== X-Received: by 2002:a05:6214:4c03:b0:6cb:410a:ef5d with SMTP id 6a1803df08f44-6cb410af56bmr118016106d6.5.1727697887257; Mon, 30 Sep 2024 05:04:47 -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.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:46 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:16 +0000 Subject: [PATCH 21/45] media: coda: Use string_choices helpers MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-21-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_050448_566482_772B8BCF X-CRM114-Status: GOOD ( 13.36 ) 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 warning is fixed: drivers/media/platform/chips-media/coda/imx-vdoa.c:120:39-42: opportunity for str_write_read(val) Signed-off-by: Ricardo Ribalda --- drivers/media/platform/chips-media/coda/imx-vdoa.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/chips-media/coda/imx-vdoa.c b/drivers/media/platform/chips-media/coda/imx-vdoa.c index c3561fcecb98..abdff181d417 100644 --- a/drivers/media/platform/chips-media/coda/imx-vdoa.c +++ b/drivers/media/platform/chips-media/coda/imx-vdoa.c @@ -15,6 +15,7 @@ #include #include #include +#include #include "imx-vdoa.h" @@ -117,7 +118,7 @@ static irqreturn_t vdoa_irq_handler(int irq, void *data) writel(val, vdoa->regs + VDOAIST); if (val & VDOAIST_TERR) { val = readl(vdoa->regs + VDOASR) & VDOASR_ERRW; - dev_err(vdoa->dev, "AXI %s error\n", val ? "write" : "read"); + dev_err(vdoa->dev, "AXI %s error\n", str_write_read(val)); } else if (!(val & VDOAIST_EOT)) { dev_warn(vdoa->dev, "Spurious interrupt\n"); } From patchwork Mon Sep 30 12:04:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816088 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 10DB0CF6499 for ; Mon, 30 Sep 2024 12:25:23 +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=aurzIxhre/dA6wUpFHCHveAY7utZWkXC/gGbqMcXk0s=; b=4485XZjObfm4+RDp689EdMFhT4 H0Rn+i87HPl2PTilI1ACpG6KsjRENN+y0OH24APd3P/7QtIshEfApdOy4NrTntipVYqeYVNGEaxUe SyXhpksHh0/tlAzwLyvpAiCO1meBd/XjikHzdaDl7TMHuy4zbf+9FnZ8hb63uZKvcza1KIwPUv2PL GObvGjjZNWyUulVrVMbwMi4yxt2ENOz2z1W0JhyAZRyaxf43Jq6ztVbtIk4dIK3r5dRpfSoezC848 T2rC3H3CEI+uoVlEWdtY37LBBygUwaIKIxK7JLnHHqACKnLDIFwGo8R66iXB+M2p6XFfk1nEkvJ3D PtB4YCYQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svFSi-0000000H2DU-3LkJ; Mon, 30 Sep 2024 12:25:12 +0000 Received: from mail-qv1-xf2e.google.com ([2607:f8b0:4864:20::f2e]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svF90-0000000GwRg-3LBl for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 12:04:53 +0000 Received: by mail-qv1-xf2e.google.com with SMTP id 6a1803df08f44-6cb37b34a87so30618066d6.0 for ; Mon, 30 Sep 2024 05:04:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697889; x=1728302689; 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=aurzIxhre/dA6wUpFHCHveAY7utZWkXC/gGbqMcXk0s=; b=O+RAaCmzAmvu8JEo4zKr51ZrFY6WfWuOT5wGDzy35MGeu27rzjmvhNQ7MhkPyyG7le H1CjBFMdLvxPCXuAXf7e01uJS3TqcFiNxmrcGfXx0XTqdTA1qK++S/FqgWT3hExH00y2 CXP8rKPnnC0eYKdlKIL0BjwYPTVeap5B+z2lw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697889; x=1728302689; 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=aurzIxhre/dA6wUpFHCHveAY7utZWkXC/gGbqMcXk0s=; b=B2cux5S/obzMI0LBN89CkkfzRUZkDwV7lZoZnbQbt+QIFquCV3ujw39Bu6eFc+G7KM qeob8mJpw1i4kZ06kxwvTU7mvjh2+/0lgvw+hh8B9OYzg1mqhX3Aed+s8rM7d1OQSA5d xjvH1AdUoUcH7hacg4uzglbWvS3HRJkpxhN7blBKnT++dY6tAzCGcTfJyXjRFFgI3fmn h69wh71OZimzOOQbOn2f2L5Tv97mRzaE7tAbvXowTJcLcLoAFgqk4zBrw2l1ADtbGtvO 5VVuGWUQOvkU1Tmr3r2Um8uzloRUURJIqDBHJjW3iRIpKWHv+kajtg7HoCIG7u2lY89R 7Q+w== X-Forwarded-Encrypted: i=1; AJvYcCX2sYYMPAskxPtkRNt0QV1kC42tGVsfxw4VoM0M1AK+B76NsuqbnRtHpfPOI/uYOzcaEtd95mU1XmGZdbMJA4gx@lists.infradead.org X-Gm-Message-State: AOJu0YwTdOIavh5UPdWuHw9t6lzUpgPkWguzKOIG/XzoJ5mICPTy0r3s GkuSS5N8KFWoHsrhd1XYGqRckC8hUhhSDoZNOYAXM1vikoy2dcszJGZQhCnBow== X-Google-Smtp-Source: AGHT+IGIOHdh67nNwgDel6paDE35Eb29KwEMX4XzmiYgJj7qtD9+Z/d/ZNDrc9s0mVLpMYI/GTz7DA== X-Received: by 2002:a05:6214:53c4:b0:6cb:27e6:393f with SMTP id 6a1803df08f44-6cb3b63d1cfmr165544066d6.36.1727697889388; Mon, 30 Sep 2024 05:04:49 -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.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:48 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:17 +0000 Subject: [PATCH 22/45] media: aspeed: Use string_choices helpers MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-22-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_050450_980997_43553595 X-CRM114-Status: GOOD ( 12.54 ) 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/platform/aspeed/aspeed-video.c:1944:6-16: opportunity for str_on_off(v -> hq_mode) drivers/media/platform/aspeed/aspeed-video.c:1230:3-17: opportunity for str_on_off(video -> hq_mode) Signed-off-by: Ricardo Ribalda --- drivers/media/platform/aspeed/aspeed-video.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/aspeed/aspeed-video.c b/drivers/media/platform/aspeed/aspeed-video.c index fc6050e3be0d..9c4a47d7a442 100644 --- a/drivers/media/platform/aspeed/aspeed-video.c +++ b/drivers/media/platform/aspeed/aspeed-video.c @@ -1227,7 +1227,7 @@ static void aspeed_video_update_regs(struct aspeed_video *video) v4l2_dbg(1, debug, &video->v4l2_dev, "compression quality(%d)\n", video->jpeg_quality); v4l2_dbg(1, debug, &video->v4l2_dev, "hq_mode(%s) hq_quality(%d)\n", - video->hq_mode ? "on" : "off", video->jpeg_hq_quality); + str_on_off(video->hq_mode), video->jpeg_hq_quality); if (video->format == VIDEO_FMT_ASPEED) aspeed_video_update(video, VE_BCD_CTRL, 0, VE_BCD_CTRL_EN_BCD); @@ -1941,7 +1941,7 @@ static int aspeed_video_debugfs_show(struct seq_file *s, void *data) seq_printf(s, " %-20s:\t%d\n", "Quality", v->jpeg_quality); if (v->format == VIDEO_FMT_ASPEED) { seq_printf(s, " %-20s:\t%s\n", "HQ Mode", - v->hq_mode ? "on" : "off"); + str_on_off(v->hq_mode)); seq_printf(s, " %-20s:\t%d\n", "HQ Quality", v->hq_mode ? v->jpeg_hq_quality : 0); } From patchwork Mon Sep 30 12:04:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816089 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 CB8F2CF6497 for ; Mon, 30 Sep 2024 12:26:34 +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=fkGnsANo5NZRR329f/RKKIwKl1Ms+i/uz0ChSSNIXaI=; b=h+CgB84KTBwqrWK3vkWrTondJb 8TB17QV00WjKoSVMw5XWRT9dWGfKZG+i5Cpcg+KNt4dc2kiKWSbuFL0j6U8+CG79TOc/4f7yGqbY6 7SRp1v5FIP3cIaFiERtiO0P9kK8w3PHWSQCMFyOnXEbq1jJMlaa/PH/hUsm6Iqu0nn7sA+v8JoVxj KwVRphTxQ/S7iumGf6gobA+uusejmvjt3gWvZVY9YQTUIKOtXkqnjc9vag3s3aI+3UyskYFD5UH9v WvWgFnu+PAX0lcWDkxrcS9xICbZZyZ7OjAoV6ruP4zMLUhHUXh4N8GWMjpgDjlAge5h+fkAi7MUeu TWqOBI8g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svFTu-0000000H2YG-1mJB; Mon, 30 Sep 2024 12:26:26 +0000 Received: from mail-qv1-xf31.google.com ([2607:f8b0:4864:20::f31]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svF93-0000000GwTL-0OFo for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 12:04:54 +0000 Received: by mail-qv1-xf31.google.com with SMTP id 6a1803df08f44-6c548eb3354so35736626d6.2 for ; Mon, 30 Sep 2024 05:04:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697892; x=1728302692; 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=fkGnsANo5NZRR329f/RKKIwKl1Ms+i/uz0ChSSNIXaI=; b=nBvOCGkioGQs3pWMrYtu/8Ee0aIbe9R6WUsUiDodmQVN5d7Wvf/wOkXaC6c98ChoiH QDHJCw762uP4ZcduwQUYk7FJA8iJzr6aB12rbmKLImwnKpTKLimMZtC6gfLaoTxFf9C6 cdhcsff0lfoIUzI5A70Y+X2uXtB4qhQZUsVw0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697892; x=1728302692; 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=fkGnsANo5NZRR329f/RKKIwKl1Ms+i/uz0ChSSNIXaI=; b=Vgn4eAQFiG2IUU8/pX+dLDTZRbzXrd8+lYwBmySoejO2jGf896wjTVoJlivAlhTcEB AphDP4fG4GR3xv9AXOt1AVk+UFkf1JdCCErcDoELQzqyySigI1GlWF/YEA8p5snnDaAo ZZ14COdzrBRYocyWocXkQouCk740KiKMYj9jQZvfjTwNzUJBJr2oc0f0zCDTBRYFE5Fc q9aBnff7Oo2L2UTjYkOUozb+l5jae+rxc3ns88iNmoy7kfdJu2KUUQ4l7oI5SIkfbVCQ lABtRnXNEynoBHqrfulUaw8bEuja+/+L3xuYpXcx+3l4KJJi9bRbN0qMehbroeYm2Nkh qOeg== X-Forwarded-Encrypted: i=1; AJvYcCUadSiPgC6ICsr36FSGnYcwtA803wfsZN9sPGE9f9CnX1HKVtZE44xdRCCiNcPhA47xfm8xax1EUEWJE+SrwIYp@lists.infradead.org X-Gm-Message-State: AOJu0YxufRC/arPv7FK6TnTdbSBMZFExvu013B9r6fafulxl5CeU2/8+ 2S3/K3RI7CjFK8MW5+kBp6ROvVzJ/SLGwV2pU95b7b84u8Ur6WGwIl+kTcgl7g== X-Google-Smtp-Source: AGHT+IHSrAGEQVH1G1zMvd/O9AA5MhvLH1UshVFh4gerMrNNX+7ODpeAcur/C3J29WO/FfgVZP2azA== X-Received: by 2002:a05:6214:33c5:b0:6cb:4def:4ce4 with SMTP id 6a1803df08f44-6cb4def4dd3mr121217066d6.32.1727697892043; Mon, 30 Sep 2024 05:04:52 -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.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:50 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:18 +0000 Subject: [PATCH 23/45] media: ipu6: Use string_choices helpers MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-23-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_050453_191285_08D2445A X-CRM114-Status: GOOD ( 12.58 ) 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 warning is fixed: drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c:247:51-57: opportunity for str_on_off(enable) Signed-off-by: Ricardo Ribalda --- drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c b/drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c index 051898ce53f4..522dbf52c82b 100644 --- a/drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c +++ b/drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c @@ -244,7 +244,7 @@ static int ipu6_isys_csi2_set_stream(struct v4l2_subdev *sd, u32 mask = 0; u32 i; - dev_dbg(dev, "stream %s CSI2-%u with %u lanes\n", enable ? "on" : "off", + dev_dbg(dev, "stream %s CSI2-%u with %u lanes\n", str_on_off(enable), csi2->port, nlanes); cfg.port = csi2->port; From patchwork Mon Sep 30 12:04:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816091 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 B95DFCF6497 for ; Mon, 30 Sep 2024 12:29:06 +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=kc6yac9SyLlHs7WRhmQW1+HPAOFx8yEw2UfT0f5Qnn8=; b=CFKosHTovrZ1Aman4RbpYrnUAy nVx5QXkA0v172WFZQiBDbzTHVkQ8Qkx1pPfCmJc1xoFzTPYZCG7TfP8/7dkcQFLy3HlUCAM+OqKor jy7rgxRu9C05SrJSe5aHjs6FFoIztjHJ9nSLfZf4+zSnAmpW6EKb9xXnlpcJjJx3RRhzv9uYL+J9q G8H0B26juy+m0ZggwlqQzwzmW/rbXrKk66coYwcPW8+xDMgRo/4OFtoQE5nbnj1gHEJxMZx5cZ6Te 6EiEQrVEmu1Ki1h9+XM04T5QGq/KkfuY3JxJb0MyGZ+FTuRpbLayiUvSjK5yKaUtikUoNBCRx+ICo 9f2TcnRQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svFWK-0000000H3DU-3kPS; Mon, 30 Sep 2024 12:28:56 +0000 Received: from mail-qv1-xf30.google.com ([2607:f8b0:4864:20::f30]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svF94-0000000GwUX-44cJ for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 12:04:56 +0000 Received: by mail-qv1-xf30.google.com with SMTP id 6a1803df08f44-6cb2aac40faso38500546d6.1 for ; Mon, 30 Sep 2024 05:04:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697894; x=1728302694; 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=kc6yac9SyLlHs7WRhmQW1+HPAOFx8yEw2UfT0f5Qnn8=; b=kPznu9+zz72LdJ26Yx09pcVrzSf8XEkRsY0Go2OJj1UrYxsodLxMKA5883/RV5N6sp mEjWawbaPQI1ywWSyKPoTtPxgKnOE04fd02BVfjvh78oslxuhJPVx9bvSvBNPk70TRiH EwSxBwg5y2BgDO4s+FsITvEQaJsHqzdr7pOU4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697894; x=1728302694; 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=kc6yac9SyLlHs7WRhmQW1+HPAOFx8yEw2UfT0f5Qnn8=; b=OICOaaVvWCCGacj1rNYBo76OHrf1wQVu2iZMG0BqczH7tpf1yz2835TzqEQzWswb+L en1dAkHNkARetKVggnzPVt2UL0RJn5U33aFkO2+L0aq1TJD7wPZ7zkvs9RS0bcTcWIA6 Ad0XMs0EGQBQ9+AQEF53BUCOWBJTzlZKV8WeyN75Ka7nLL+LhmmAPXZogWOfV3dP1CCz o+WW9GAWgu6GLpRG/KdSlip+yfQCYmL0kY3fucK/CDVjQm2It7BGz5JQxOxEGrzYfUv7 g0LcbA4kkDNGdFnWIHU1NRsLblwiPjN+NUdgp3o2mzvYOEkZ1zjUkZVkpYurOXhpKtuW Bsjg== X-Forwarded-Encrypted: i=1; AJvYcCV7fi7lzm3rCnbP4ruk7S4AUYUS6PaUa1Czdsu7dlv9Lv8yP6Bbvsiy+g9Yd80HyNN3IoP3YBPQlnp3aQYMvXdS@lists.infradead.org X-Gm-Message-State: AOJu0Yw++80fC19wGz91SVE8kuggLtER2eW97Cr+6WJSFvgvKqppV/Vr znDsDuUSG44NE2u6ppvOWx6MCCXmEVpInH04lBu6kuiCyAoQ/PWRvcjUlYMAkQ== X-Google-Smtp-Source: AGHT+IHvTtSCRFSBPeJou8A8lJWRExB8EwT4CA/+ss3rMSh3j0C8PX4s4DLpZYrCskrdUJWUEmVJfQ== X-Received: by 2002:a05:6214:489:b0:6cb:2de5:d7a1 with SMTP id 6a1803df08f44-6cb2f270becmr284661826d6.8.1727697893842; Mon, 30 Sep 2024 05:04:53 -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.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:52 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:19 +0000 Subject: [PATCH 24/45] media: cx18: Use string_choices helpers MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-24-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_050455_071700_CF448117 X-CRM114-Status: GOOD ( 12.56 ) 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/cx18/cx18-av-core.c:1013:40-46: opportunity for str_enable_disable(enable) drivers/media/pci/cx18/cx18-av-core.c:1118:8-24: opportunity for str_yes_no(( mute_ctl & 0x2 )) Signed-off-by: Ricardo Ribalda --- drivers/media/pci/cx18/cx18-av-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/pci/cx18/cx18-av-core.c b/drivers/media/pci/cx18/cx18-av-core.c index ee6e71157786..5701abdf9427 100644 --- a/drivers/media/pci/cx18/cx18-av-core.c +++ b/drivers/media/pci/cx18/cx18-av-core.c @@ -1010,7 +1010,7 @@ static int cx18_av_s_stream(struct v4l2_subdev *sd, int enable) { struct cx18 *cx = v4l2_get_subdevdata(sd); - CX18_DEBUG_INFO_DEV(sd, "%s output\n", enable ? "enable" : "disable"); + CX18_DEBUG_INFO_DEV(sd, "%s output\n", str_enable_disable(enable)); if (enable) { cx18_av_write(cx, 0x115, 0x8c); cx18_av_write(cx, 0x116, 0x07); @@ -1115,7 +1115,7 @@ static void log_audio_status(struct cx18 *cx) } CX18_INFO_DEV(sd, "Detected audio standard: %s\n", p); CX18_INFO_DEV(sd, "Audio muted: %s\n", - (mute_ctl & 0x2) ? "yes" : "no"); + str_yes_no(mute_ctl & 0x2)); CX18_INFO_DEV(sd, "Audio microcontroller: %s\n", (download_ctl & 0x10) ? "running" : "stopped"); From patchwork Mon Sep 30 12:04:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816096 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 48ECECF6497 for ; Mon, 30 Sep 2024 12:30:25 +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=4IxOY0fJQbV1pYrixFE+l++vJW3v3+bYS5tnnmoYTEc=; b=CY4+Xfj/OfhUVUpEXDdIRTVjIn POz0VuwBFTADA/bXt2tKssH840goFhoUIB73+c7gpJRhZeWN6fFWbRj8vfFpSX+5xNnGwTzVPJbeo 4Q3/FUk9JWDN5UzAkeCZJIyc3fvk0TXgvzJFt44dAO6V2C4Ac8rHbp1TRzSpAkuZt203av4XgGoS6 ugSy7aFBS7QdbKZeWQxSWxUc1ox8hUbNvO9/O1M/Hxck+EXn5QV7QDLqOnr5N8mRT66RyceNOdig/ d1o6IU5QTJ8rNLSAMVY6kGTwUPXWQXRsDQq2izR4NSH+QEVWyS9S9TpzGQXDtNn0sZYrag+OMgVsN v79Ph9bg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svFXX-0000000H3Qb-0wW2; Mon, 30 Sep 2024 12:30:11 +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 1svF96-0000000GwVK-1H7v for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 12:04:57 +0000 Received: by mail-qv1-xf33.google.com with SMTP id 6a1803df08f44-6cb27e974ceso26203916d6.1 for ; Mon, 30 Sep 2024 05:04:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697895; x=1728302695; 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=4IxOY0fJQbV1pYrixFE+l++vJW3v3+bYS5tnnmoYTEc=; b=XsNqNidanekttKVUyuIN+tGVXscEyVxXDVKr7Pmo+vQyID9cJdTe6Jn8NxU2vePRfO Hsggrebff9EpR6JOprBEgokIGE82nS5aB18d8I+ycoWJrWDy+7iyeC/ePtJJEl9KNXY5 Gka4zdPxVR1TOfH+rHO5eSVFHeZq95ipX6a2Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697895; x=1728302695; 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=4IxOY0fJQbV1pYrixFE+l++vJW3v3+bYS5tnnmoYTEc=; b=Q2qZ5VTBtk34LU+3xzjMfqlMYns+kkRyrrzBtVy6433+LK0PFLiOwIc3spQHlia5Rx Pit7em8/6qd8gdRN0ZMKQkZrz4tmpX22GmMvjm+Llliy2ivzj4UfGjRiXlitfzN0sY3C tNIDJc0a5aLeBsWOtGRuG6T96qDPDRqKsG4waQxpopyiqa/Sx4RFc8SeARBLuDeEsrXn oaXYUzSo/Zh+1tWt03a9PtlJmDGd5DPb4XkGu1OBu02WCegRnKINjKtKQQKPUxOE2tYC wlZHaYUbRwojqQURVovi1e3loVP2ZwyidoAv93glR1e9pLd58iL0WLwVHKahwDJHKgek tvpA== X-Forwarded-Encrypted: i=1; AJvYcCXyu5XMOqNeHFbCgC+L+zIr5nply2Eg+qKCBuWn0NLSpdn6tq0WefQQS5ncPQrZ55oxLQuuBJPCoO29DulCI5cm@lists.infradead.org X-Gm-Message-State: AOJu0YwGxyEwsc8qGLlozN1u/SQmayFIg3rMAwoMjPYMlehPRnmAEA9q GCccY/uCGe/vFhjMzfCAkC5MWr4I4gNq/BLBPppDo8n3Pgd6NjvWzKeIpwAf2Q== X-Google-Smtp-Source: AGHT+IH66496SEOv3j8ygYtL4JJVB2nn5gkUmde7+6fS5LT2xRJFvFwOVG+MRgiMM8u5XXNXcxJVyg== X-Received: by 2002:a05:6214:5b07:b0:6cb:5dd3:a3ce with SMTP id 6a1803df08f44-6cb5dd3a78emr68541006d6.14.1727697895340; Mon, 30 Sep 2024 05:04:55 -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.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:54 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:20 +0000 Subject: [PATCH 25/45] media: cobalt: Use string_choices helpers MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-25-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_050456_387447_5C5D2AAC X-CRM114-Status: GOOD ( 12.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 warning is fixed: drivers/media/pci/cobalt/cobalt-driver.c:263:25-33: opportunity for str_enable_disable(ctrl & 1) Signed-off-by: Ricardo Ribalda --- drivers/media/pci/cobalt/cobalt-driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/cobalt/cobalt-driver.c b/drivers/media/pci/cobalt/cobalt-driver.c index 6e1a0614e6d0..cff2d29410d4 100644 --- a/drivers/media/pci/cobalt/cobalt-driver.c +++ b/drivers/media/pci/cobalt/cobalt-driver.c @@ -260,7 +260,7 @@ static void msi_config_show(struct cobalt *cobalt, struct pci_dev *pci_dev) u32 adrs_l, adrs_h; pci_read_config_word(pci_dev, 0x52, &ctrl); - cobalt_info("MSI %s\n", ctrl & 1 ? "enable" : "disable"); + cobalt_info("MSI %s\n", str_enable_disable(ctrl & 1)); cobalt_info("MSI multiple message: Capable %u. Enable %u\n", (1 << ((ctrl >> 1) & 7)), (1 << ((ctrl >> 4) & 7))); if (ctrl & 0x80) From patchwork Mon Sep 30 12:04:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816097 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 70EFBCF6499 for ; Mon, 30 Sep 2024 12:31:32 +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=tIonQ/DAaQ73YEKHhPQbmT6IJ8ZJpmHYGgDzVtOZCdY=; b=HvN/BedKXmormU5BosBiiCJshZ uXPsi94ad2K3YTB2+cO4f7iIqI6stdSXQ+9fMJmQdSCDjLgKYF7qfQ4Y6NUjG+l2wMgEVO75p2x33 TgvWR1klLX7A2hv6C/3rtfouanUZWVmUNBdD/xOim93OMD9dnWoL+MFbZCQEsSkQA1LgaCHbzmmSt Iy2dx6Ae2qJ1TH3vEwU0Wn3bpj0F6N7CbA4hL3eP+G1AVB95pxWekUWLIiZNs64KKUE92WbHW4sJi tnkpKdhjVIxbmgsLTRSCjPiF4i9lX+EOViaF0S+Ou2jmVpR3x7HIBxzreEJvyWJgDU4jrABrmZm0L kGrdo26g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svFYh-0000000H3bk-3e2P; Mon, 30 Sep 2024 12:31:23 +0000 Received: from mail-oo1-xc31.google.com ([2607:f8b0:4864:20::c31]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svF98-0000000GwWU-2736 for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 12:04:59 +0000 Received: by mail-oo1-xc31.google.com with SMTP id 006d021491bc7-5e57b7cac4fso2523618eaf.1 for ; Mon, 30 Sep 2024 05:04:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697897; x=1728302697; 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=tIonQ/DAaQ73YEKHhPQbmT6IJ8ZJpmHYGgDzVtOZCdY=; b=VyG3PoiEL0C8bO/4qOcY+PcpR3/Z4kv2aVfEBrrwL4cu9FaQk+MvBBKdp1JYmBMFrs 11rxYwd+/OwJ/Q2r35Hwo3YjVlsYsxR9kitc1c08ffGyLnAb/hF4RN+woCG9UKzS6uDU 6KgzxYoT74gQTrqUbdWkV21bnEcALqcPVIM3k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697897; x=1728302697; 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=tIonQ/DAaQ73YEKHhPQbmT6IJ8ZJpmHYGgDzVtOZCdY=; b=CVoz2S3j2nLZk7WlTQULLlzVf3Z5/rWcafV6F9rsc28D17O17I4Z9TZRe6WFqh79JF K2foSRR1EFOagUsrRFMpfSV23o345sFju+XYG9Voaw/ucIO82nwNrJKEYqpiF+ioiRk0 pCVknaiJnOmycKwATPQ1LxcznyvnTuC+frGNZBNNocI76cRwNqS5naT771WWJFaqKdTF 6/uOhqlrIoxEHJK287Dtc5mAZWBB6SX9nrL7Qw1x13iLhFwtSiUAIkchQ45K+ZTzKKWD NzFYozTjH68Da8kEXlnsDlY3z6OkVv7eLc0c/gEdi4yZd6dtAlIfSSNr41r08fiqq3+s UILA== X-Forwarded-Encrypted: i=1; AJvYcCWCVvVy4PZmS8Zd/XM6omPu+1her7TyYQ4IdAksLD+ItqcCmVb6/AhhJ7pDATnTCXXeg7QEgWX6QTG3B1bHSCQ/@lists.infradead.org X-Gm-Message-State: AOJu0YxI56ZaX7hnTUBEWAgH+0L9yqX85PSz37I+zCeQxB2m6aq689HV fXZEG+ijOjXY7fpIRy/mKE0fEr+yHK80/N9EauThIAosu851IVIQec3odT2lmg== X-Google-Smtp-Source: AGHT+IGBBDkCLdkyPSXSamdMv+lg/+wwDPA6EahlQnUNGQaV2riLXTLngR4tQbOORFsEO3I87GPG9Q== X-Received: by 2002:a05:6358:54a6:b0:1b8:33fc:ae71 with SMTP id e5c5f4694b2df-1becbc9be95mr344688455d.16.1727697897424; Mon, 30 Sep 2024 05:04:57 -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.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:56 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:21 +0000 Subject: [PATCH 26/45] media: videobuf2: Use string_choices helpers MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-26-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_050458_595332_D3340006 X-CRM114-Status: GOOD ( 11.86 ) 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/common/videobuf2/videobuf2-core.c:3008:2-6: opportunity for str_read_write(read) drivers/media/common/videobuf2/videobuf2-core.c:2860:2-8: opportunity for str_read_write(( read )) Signed-off-by: Ricardo Ribalda --- drivers/media/common/videobuf2/videobuf2-core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/media/common/videobuf2/videobuf2-core.c b/drivers/media/common/videobuf2/videobuf2-core.c index 29a8d876e6c2..05678fa14fe9 100644 --- a/drivers/media/common/videobuf2/videobuf2-core.c +++ b/drivers/media/common/videobuf2/videobuf2-core.c @@ -2857,7 +2857,8 @@ static int __vb2_init_fileio(struct vb2_queue *q, int read) return -EBUSY; dprintk(q, 3, "setting up file io: mode %s, count %d, read_once %d, write_immediately %d\n", - (read) ? "read" : "write", q->min_reqbufs_allocation, q->fileio_read_once, + str_read_write(read), q->min_reqbufs_allocation, + q->fileio_read_once, q->fileio_write_immediately); fileio = kzalloc(sizeof(*fileio), GFP_KERNEL); @@ -3005,7 +3006,7 @@ static size_t __vb2_perform_fileio(struct vb2_queue *q, char __user *data, size_ int ret; dprintk(q, 3, "mode %s, offset %ld, count %zd, %sblocking\n", - read ? "read" : "write", (long)*ppos, count, + str_read_write(read), (long)*ppos, count, nonblock ? "non" : ""); if (!data) 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; From patchwork Mon Sep 30 12:04:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816235 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 4835ACF6499 for ; Mon, 30 Sep 2024 12:35:13 +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=ZtS18Z/ph+22OpFMjBj6PDOp8BDjMiQU1mRrp+tqPao=; b=hWJEJBqFTmBS7QIw14CwKczpVW JVxswAqymclg0pvefHqF/6cp7SqUpN9qZSjBXqU5EgiVgunGoBXYYerPF0sI+IYyQvo+eF5D/aDBj jfOOU8m/E3S7b9+zAnbr88v4DDdvISkmq7kZoAwhVFSNQ2ue5hoKXF7sK+ISDEr81tjfscBbfsBrF XjqUdp8egy5BmOdAkSRNCkRYLX1c82ao3UBEVetpnOWijS5rqSM/nLziVL672C5sZm4HJTR12Z3UI Cl8bO9N/htPOyS6bADbBBz9KdIaK5yIsjkIKn2WdbKxwWE3904Ar53rMf2nBuhMccMPaVvFAu/O68 9hxP0kNQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svFcD-0000000H4Su-3BsH; Mon, 30 Sep 2024 12:35:01 +0000 Received: from mail-qk1-x732.google.com ([2607:f8b0:4864:20::732]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svF9B-0000000GwYf-3Zg4 for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 12:05:03 +0000 Received: by mail-qk1-x732.google.com with SMTP id af79cd13be357-7a99e4417c3so373727385a.1 for ; Mon, 30 Sep 2024 05:05:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697900; x=1728302700; 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=ZtS18Z/ph+22OpFMjBj6PDOp8BDjMiQU1mRrp+tqPao=; b=ii1Mv7UPn9TA+TTX2GDm7CMgjiR72+Au2lxn87L9JVR8osDy+PVUtFyeODX7RGA2bs DoUcTGz+1gRbt8Wf0ZXOS3KfH4jNdTQxZO+rrqiwcJlMp6XkFD0Swz/SGSWKHPuEGIUI b41qLRAQ3299hdp380PSRNmATrhKfIESMnDOQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697900; x=1728302700; 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=ZtS18Z/ph+22OpFMjBj6PDOp8BDjMiQU1mRrp+tqPao=; b=c06qJE9J0aMFdTr4dzkK3NXo/k8qljW6j/pHQfaOIdgJ8aFubyOpleX/J23WXMTiI5 TyyAqlUvpIIpsBwH2UlbNLL+lJ9g4WH4zB2jh+3r2Ad6ESarme2Eu22BKrHuUSRxIjpY diFop4HKWkATIhF+aMh063eCptijzV/tpA/7ZyCON1u8k1pgwZuLk5GQB4V3gdwiM2os O90ZcUopon5XeCaq5n2zECJSdQavKipvI53N/07cEbKs78YBdHt83D7vNk1prApsDCND vBRiYZnpGC3WM6Xj7JKJOKGMtcRQX03vdjNU1t7kgTwAoeALIrX40bAcPzN1LVaOk/cV Wf2g== X-Forwarded-Encrypted: i=1; AJvYcCU0Td4XBOAMxyqFdPD7YwqeldeFfgVX4ctdfTBpFaogOuCzPXKoAVlg4y5+u1h136OlD4HKrgROB701qk74iekE@lists.infradead.org X-Gm-Message-State: AOJu0YwhInVnt9uYHc9kMgsMdRoOquYk7H1UXEY/l3wscRtZCjBUk9w/ zj0NvInqKB8GOPZvhD9yzCTKEDKA0qF+1jitHUeJ38xwU/m07DJVUj0FRDCfag== X-Google-Smtp-Source: AGHT+IHa6kByUW3tXKJTo1om4uBb1NLh+sbjdquYal1McTRlR2Y5X69QcY3HAZ4VU5M0CeLNOC2NrA== X-Received: by 2002:a05:6214:448c:b0:6c4:6217:da9c with SMTP id 6a1803df08f44-6cb3b5da202mr213240066d6.17.1727697900493; Mon, 30 Sep 2024 05:05:00 -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.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:59 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:23 +0000 Subject: [PATCH 28/45] media: b2c2: Use string_choices helpers MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-28-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_050502_053870_4F2D7D44 X-CRM114-Status: GOOD ( 12.66 ) 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/common/b2c2/flexcop-hw-filter.c:119:20-25: opportunity for str_on_off(onoff) drivers/media/common/b2c2/flexcop-hw-filter.c:12:35-40: opportunity for str_on_off(onoff) Signed-off-by: Ricardo Ribalda --- drivers/media/common/b2c2/flexcop-hw-filter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/common/b2c2/flexcop-hw-filter.c b/drivers/media/common/b2c2/flexcop-hw-filter.c index c5a3345c99e9..d64a03452e22 100644 --- a/drivers/media/common/b2c2/flexcop-hw-filter.c +++ b/drivers/media/common/b2c2/flexcop-hw-filter.c @@ -9,7 +9,7 @@ static void flexcop_rcv_data_ctrl(struct flexcop_device *fc, int onoff) { flexcop_set_ibi_value(ctrl_208, Rcv_Data_sig, onoff); - deb_ts("rcv_data is now: '%s'\n", onoff ? "on" : "off"); + deb_ts("rcv_data is now: '%s'\n", str_on_off(onoff)); } void flexcop_smc_ctrl(struct flexcop_device *fc, int onoff) @@ -116,7 +116,7 @@ static void flexcop_pid_control(struct flexcop_device *fc, return; deb_ts("setting pid: %5d %04x at index %d '%s'\n", - pid, pid, index, onoff ? "on" : "off"); + pid, pid, index, str_on_off(onoff)); /* First 6 can be buggy - skip over them if option set */ if (fc->skip_6_hw_pid_filter) From patchwork Mon Sep 30 12:04:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816236 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 3F096CF6499 for ; Mon, 30 Sep 2024 12:36:23 +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=pF9yJ7oppQKnmh5ZAzfDc5uXy0x2qr1GXsQ4Q40pH48=; b=vQD36Fz4uu3LWD9Jqv7p10vCrM 4lbyOQ9DUWSlLH3niS3ekCByx1Ak5C7o6jXdwzxG78A9HW3dZGKi2pdwKeJ7qONkO7FiptmKzwque hDKustGM4TKLTzhrxkEcUYGTo9PJziPUMv/yPNEpB/COVU7lOLylWuypY4T4HoAT/xvLwpZIvRQYn +pSdwb5Q39dRsOb1T9SzvY7j0/wVVZ1JC1J7CWDaRwKB/8YOxyBTROZ0EaBv7UMo44OpXNmQ/70pj LN+kBpJoxvmWIjNmpKyO2bgg2mGWwBWmvZB2FOweM+5ZiEghQyLKYzUgDdvGMjT5bl/dbR3s5b4tL JcSo7U/Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svFdO-0000000H4es-2kAb; Mon, 30 Sep 2024 12:36:14 +0000 Received: from mail-qv1-xf32.google.com ([2607:f8b0:4864:20::f32]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svF9E-0000000GwaG-1hw9 for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 12:05:05 +0000 Received: by mail-qv1-xf32.google.com with SMTP id 6a1803df08f44-6cb4c013b78so18083506d6.1 for ; Mon, 30 Sep 2024 05:05:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697903; x=1728302703; 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=pF9yJ7oppQKnmh5ZAzfDc5uXy0x2qr1GXsQ4Q40pH48=; b=FNE72MLyCGIkcwUUpdsypn8QXe/tlTBGA69FQXg5eOp9UrYfAmzXPceaKmTwvhdDQb jLtfO0m68u+5RiERp8PYDWsDQ3gYpX/sb4IQr4ap2eC9EGomWwTn0NIQs1G/+JiCoWZA 5REOsHZ20UngDZPAduA1s/gk4lVkIAfz1lWIc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697903; x=1728302703; 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=pF9yJ7oppQKnmh5ZAzfDc5uXy0x2qr1GXsQ4Q40pH48=; b=cLIUqhEZlS8u4Zn6sbN4DUTrcBRaZpiH0nhBDvL6PgHnmnf/WFm7xP6zjlJO7dnqP1 Oge4kSicYn98F/jTNgllM6WWp4tzXqDLwwFu3OfbRkKUDRWBA5Dtob6PW02aTDXNHcCr ZeU6zbObdBwqJwk0vS0vFahVQCJzhtszns0CFPX9gIHwZsf0uEHn2OLXflpHwwPLfp08 uW8Oglipl5+1AUII5kDu5pThnL2+/nHReu6Rq8Ik5ie7oICCDzBPc2sYRVc7UQO8zGWn plotEqqb1PS/fnbuwMGUsjj2KdwUTN/NqdBkk4eq9rIKzm+Z3dHNMoQxQiT6pbwit+qs S84w== X-Forwarded-Encrypted: i=1; AJvYcCWi0iJ4UkBG0wP8QIbFkTRxpHxL4ZLbOqKz0d7Bl9vdOvQ9FL9wrQT30n6dYK6GxOkSg/wglbY5LMrtf3O3YuX/@lists.infradead.org X-Gm-Message-State: AOJu0Yy5EetPYYipDWBdV6Dx2tYBW7Q8pZL3hBur2oqBR//xC2Jn+uON QhmPeOSO45DLH5SoQRcybm3fzwIfykQwFxn7TLQjNXLJgV8fHHp5R03FRE/2NQ== X-Google-Smtp-Source: AGHT+IEAFwwRA71MkCRUwImfi9uBIeNCYwuxiEwHafmSSDdtTJviDnVg18iocWAWeF5m9aVEXLwnZA== X-Received: by 2002:a05:6214:5a08:b0:6c5:b709:55c6 with SMTP id 6a1803df08f44-6cb3b63b3aamr219594876d6.42.1727697902571; Mon, 30 Sep 2024 05:05:02 -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.05.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:05:01 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:24 +0000 Subject: [PATCH 29/45] media: siano: Use string_choices helpers MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-29-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_050504_482136_82CC5AE0 X-CRM114-Status: GOOD ( 12.80 ) 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 warning is fixed: drivers/media/common/siano/sms-cards.c:329:36-41: opportunity for str_enabled_disabled(onoff) Signed-off-by: Ricardo Ribalda --- drivers/media/common/siano/sms-cards.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/common/siano/sms-cards.c b/drivers/media/common/siano/sms-cards.c index d4a116ab6c88..e9aa95233ff1 100644 --- a/drivers/media/common/siano/sms-cards.c +++ b/drivers/media/common/siano/sms-cards.c @@ -8,6 +8,7 @@ #include "sms-cards.h" #include "smsir.h" #include +#include static struct sms_board sms_boards[] = { [SMS_BOARD_UNKNOWN] = { @@ -326,7 +327,7 @@ int sms_board_lna_control(struct smscore_device_t *coredev, int onoff) int board_id = smscore_get_board_id(coredev); struct sms_board *board = sms_get_board(board_id); - pr_debug("%s: LNA %s\n", __func__, onoff ? "enabled" : "disabled"); + pr_debug("%s: LNA %s\n", __func__, str_enabled_disabled(onoff)); switch (board_id) { case SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD_R2: From patchwork Mon Sep 30 12:04:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816237 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 7BB54CF6499 for ; Mon, 30 Sep 2024 12:37:45 +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=Ebt+1b/55aPXlqauBXJO18wSUl/XzTUjhH2wTMyzrFA=; b=BlDwKLOMzIXiK3NsMbMgKelbzF /rA32g9ms0EHftHs6fH+YmNKSkOow102k0qiwcu8ZqoQo2j22AOAYnCH4kRu3QmwZ9WprCC5jT/jn 6F3uE3DIWhmaUGqrgq7J6BsYU+gElg2t/hTdyS+9uzmfS/oZDHCabyy8L5pCCydjIApC/JzEI5q8R PMhsdMYHZoRiUtDE6TNgoNA+osiCXe+uRrysveB6LPSsBWVEJNCrfAngkxKPG7y89sNqMsVlRj8wm 5T8vWQtYQPcZmPV8PvHu0ejTS1EGJtbiGpvzmn7enCf6v8/FUq6eNm9SIgKItoOC7Un+X/F+2qaNA iJwqtz0Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svFef-0000000H54i-43yC; Mon, 30 Sep 2024 12:37:33 +0000 Received: from mail-qv1-xf34.google.com ([2607:f8b0:4864:20::f34]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svF9F-0000000Gwan-2qFw for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 12:05:06 +0000 Received: by mail-qv1-xf34.google.com with SMTP id 6a1803df08f44-6cb2aaf4a73so45116046d6.2 for ; Mon, 30 Sep 2024 05:05:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697905; x=1728302705; 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=Ebt+1b/55aPXlqauBXJO18wSUl/XzTUjhH2wTMyzrFA=; b=exc55GRcJVnIqJwpX25R9AFhBfc2YjGnEHBw2zLCBaeqyrhHwzueGQijuJUC+iNXKs tGOUn88CP1ZXR0AS/UOyiubD3u38LLQZgmDvjqB1RtFnU7lH8/xS4je/GtZJaCS38d4Y 4kp7iZv1iamTQGPf3IKo2IK/8Hwp+rgebJ6HQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697905; x=1728302705; 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=Ebt+1b/55aPXlqauBXJO18wSUl/XzTUjhH2wTMyzrFA=; b=rWddHnWWrKLiErl/Kz3Bxc4YnjoFdBElQoFRmvdMokhJpJdugL22a6sqlAIbA/kZeH VHJQ/H//8efKy+wv5jRhhglcEW21p+LmuUndGhgAmZUjFNQg4KQYc9fUxA5mqlINlh2p RGehumrW3sfNwQH/anCZmsBPtpC6d0P7JctncdkTU2GDlzM1WxIEa+n94KS1l74Qafeb v8Fux+XKlz/EYTJSt9p5NbyGuUBAOv+QTecmsIsDADrZ+pASDkr+UcdJiCIpf8EFoyc0 2BKP4cufTOKwWsGk83P35WLD+KvaRDyuva4DiMkzgWtV9AMqPa+DrzMbqkuQV+5RL9ye 20vg== X-Forwarded-Encrypted: i=1; AJvYcCUHJ87ErPiQOpf1CV2qsMI+MxZn72b79qZNQe2uzIe5XjTFFRVY24CCWfit89hk8ze3+Y8D+RF/i31DpziIIm3E@lists.infradead.org X-Gm-Message-State: AOJu0YyNLayOrS2EYTWGLo6K3/Gr0kPHUnJWBY8qnRwI6eug8vevvsgc lswmB9P+ZMZZRMuL48oglX41Rx8L2xMj7Yd+Mh1ZMpi+IFL8khrxQezZ0TluPA== X-Google-Smtp-Source: AGHT+IG7DxsLwmOc7mkRl/MFKW8HAXRHroSnhiAWX2HVxDFuz0PGg7dWtpjL7qcJseQqckH9Ha41Tg== X-Received: by 2002:a05:6214:448c:b0:6c1:8663:e8f0 with SMTP id 6a1803df08f44-6cb3b61465amr169180096d6.28.1727697904581; Mon, 30 Sep 2024 05:05:04 -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.05.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:05:04 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:25 +0000 Subject: [PATCH 30/45] media: i2c: cx25840: Use string_choices helpers MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-30-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_050505_764198_49A5AF5E X-CRM114-Status: GOOD ( 12.95 ) 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/i2c/cx25840/cx25840-ir.c:1089:4-9: opportunity for str_enabled_disabled(filtr) drivers/media/i2c/cx25840/cx25840-ir.c:1028:4-21: opportunity for str_enabled_disabled(cntrl & CNTRL_DMD) drivers/media/i2c/cx25840/cx25840-ir.c:1113:4-21: opportunity for str_enabled_disabled(cntrl & CNTRL_MOD) drivers/media/i2c/cx25840/cx25840-ir.c:1030:4-21: opportunity for str_enabled_disabled(cntrl & CNTRL_RFE) drivers/media/i2c/cx25840/cx25840-ir.c:1115:4-21: opportunity for str_enabled_disabled(cntrl & CNTRL_TFE) drivers/media/i2c/cx25840/cx25840-ir.c:1101:4-21: opportunity for str_enabled_disabled(irqen & IRQEN_ROE) drivers/media/i2c/cx25840/cx25840-ir.c:1107:4-21: opportunity for str_enabled_disabled(irqen & IRQEN_RSE) drivers/media/i2c/cx25840/cx25840-ir.c:1097:4-21: opportunity for str_enabled_disabled(irqen & IRQEN_RTE) drivers/media/i2c/cx25840/cx25840-ir.c:1135:4-21: opportunity for str_enabled_disabled(irqen & IRQEN_TSE) drivers/media/i2c/cx25840/cx25840-ir.c:1026:4-21: opportunity for str_yes_no(cntrl & CNTRL_RXE) drivers/media/i2c/cx25840/cx25840-ir.c:1111:4-21: opportunity for str_yes_no(cntrl & CNTRL_TXE) drivers/media/i2c/cx25840/cx25840-ir.c:1103:4-21: opportunity for str_yes_no(stats & STATS_RBY) drivers/media/i2c/cx25840/cx25840-ir.c:1099:4-21: opportunity for str_yes_no(stats & STATS_ROR) drivers/media/i2c/cx25840/cx25840-ir.c:1105:4-21: opportunity for str_yes_no(stats & STATS_RSR) drivers/media/i2c/cx25840/cx25840-ir.c:1095:4-21: opportunity for str_yes_no(stats & STATS_RTO) drivers/media/i2c/cx25840/cx25840-ir.c:1131:4-21: opportunity for str_yes_no(stats & STATS_TBY) drivers/media/i2c/cx25840/cx25840-ir.c:1133:4-21: opportunity for str_yes_no(stats & STATS_TSR) drivers/media/i2c/cx25840/cx25840-core.c:2369:2-8: opportunity for str_enable_disable(enable) drivers/media/i2c/cx25840/cx25840-core.c:2392:2-8: opportunity for str_enable_disable(enable) Signed-off-by: Ricardo Ribalda --- drivers/media/i2c/cx25840/cx25840-core.c | 4 ++-- drivers/media/i2c/cx25840/cx25840-ir.c | 34 ++++++++++++++++---------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/media/i2c/cx25840/cx25840-core.c b/drivers/media/i2c/cx25840/cx25840-core.c index a90a9e5705a0..dd8474609092 100644 --- a/drivers/media/i2c/cx25840/cx25840-core.c +++ b/drivers/media/i2c/cx25840/cx25840-core.c @@ -2366,7 +2366,7 @@ static int cx25840_s_audio_stream(struct v4l2_subdev *sd, int enable) return 0; v4l_dbg(1, cx25840_debug, client, "%s audio output\n", - enable ? "enable" : "disable"); + str_enable_disable(enable)); if (enable) { v = cx25840_read(client, 0x115) | 0x80; @@ -2389,7 +2389,7 @@ static int cx25840_s_stream(struct v4l2_subdev *sd, int enable) u8 v; v4l_dbg(1, cx25840_debug, client, "%s video output\n", - enable ? "enable" : "disable"); + str_enable_disable(enable)); /* * It's not clear what should be done for these devices. diff --git a/drivers/media/i2c/cx25840/cx25840-ir.c b/drivers/media/i2c/cx25840/cx25840-ir.c index 8cef9656c612..6f3978135178 100644 --- a/drivers/media/i2c/cx25840/cx25840-ir.c +++ b/drivers/media/i2c/cx25840/cx25840-ir.c @@ -1023,11 +1023,11 @@ int cx25840_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"; @@ -1086,33 +1086,33 @@ int cx25840_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, "\tCarrier polarity: %s\n", @@ -1128,11 +1128,11 @@ int cx25840_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; } From patchwork Mon Sep 30 12:04:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816238 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 12053CF6499 for ; Mon, 30 Sep 2024 12:38:59 +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=yeZpI3Ra5CG7IMhE/CKrUPUz5revSFC/2gaO36DfqMw=; b=hZv16qF860s7HbohGSwjfYwOWm DJksznv99EC+Pq8ao5y1DArb4r6r3nDa19MioqPetSgQJaGzEAwRRVxNm/mfPp2Qs1ByhtnMmWYfQ i/206CANo7Ze9aFzThk7MXpujWgsC9cDVsNsG/Lpfp5LCLKPPN698H4bQ8xVPfIGz3005DPKBzi0U 4TL6tWe5Ln+cNFMWuARgL1GE+Oaleu+bvGRbwRNNuFB4ZTzRzmLXexe6VW9IP82YZ4pdCKxNbyU4T ghGYmQWPvc6VmegSNF1t9yVdovsvqDx1SrLl7JhEzW5Kn3ZnkGDeSp8IDW9G8gLfOwrmdjfrFwMA0 RODmkZqA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svFfu-0000000H5Wa-0hlF; Mon, 30 Sep 2024 12:38:50 +0000 Received: from mail-qv1-xf31.google.com ([2607:f8b0:4864:20::f31]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svF9I-0000000GwbU-0gBA for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 12:05:09 +0000 Received: by mail-qv1-xf31.google.com with SMTP id 6a1803df08f44-6c5ab2de184so30238486d6.0 for ; Mon, 30 Sep 2024 05:05:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697907; x=1728302707; 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=yeZpI3Ra5CG7IMhE/CKrUPUz5revSFC/2gaO36DfqMw=; b=jp+MRxW/Izq3huSyWHTq8tyrU+iq44F2sQueDYoquERpeG8AoavmUCAFOR8Hfq9GxA cUkbrzsV/ct0mPVir6nULiIR6JzimYha9LQ4RE6tnSgu3TsWh5uH4jwI8dUhAIlxvgNT W0mMc5Rr/xktSAMFowtK6szlg4+yhK1NtuTqI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697907; x=1728302707; 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=yeZpI3Ra5CG7IMhE/CKrUPUz5revSFC/2gaO36DfqMw=; b=q2g7XXj+9Ibe/2JVYR0nAW0p1t9TpQn4GcnDBnNc6SzkjaRMP+FH7bSEsa9zKajeYf h2PgtmCyB3q1n11NG9aIYXGgfk3YFvcYb6dSFQXBSVkXOu/1yWpE3jmHtZM1ObfdWf1A 9MsW45bnsDL3Bfcd+KSDFm+DP3iP3rx7fBQtcx8rOTD/RwY51Ok68/KY9X3LbS0Gs5N5 HCtYQfRppXUmBhBWkWAehm1YtRFalM2SEAfogA+eUv45+zv81Oagekm5PML/G/fyuMDA bTr3BT+638iEck2rZ2uFnBZcCy9HBjUpmqp4nYWxtDph2OvpoXJfbBFTPrfIW6LjxRLh G9jw== X-Forwarded-Encrypted: i=1; AJvYcCWinbx0clOEKd+hcArt6/JsLIXqwbN1FlSZV6QHpKYEDxuJ5CDY3e0HteYNr/2t+UeHL2C+JhdDH9T3x98XKrik@lists.infradead.org X-Gm-Message-State: AOJu0YzUajn19DoMsrEX8rd6ozIGXBwzWCAsj50ev0s+78H7VyZpip5d +oF2SmegbJOTGWUdGI/RBeLH2Po5SswLk/9TBGyOEdZ8u+JDAwViFsLEqnnMaw== X-Google-Smtp-Source: AGHT+IFyOtAPK8xGQ/QMRxJMYu6WDsr9USOQ8VSoGNgApI/9s4N+ulaKyT/ysJasxumVieqsjFFOrQ== X-Received: by 2002:a05:6214:3f84:b0:6cb:455e:da5 with SMTP id 6a1803df08f44-6cb455e0e83mr174779006d6.45.1727697907195; Mon, 30 Sep 2024 05:05:07 -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.05.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:05:06 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:26 +0000 Subject: [PATCH 31/45] media: i2c: vpx3220: Use string_choices helpers MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-31-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_050508_243245_9FA37AF7 X-CRM114-Status: GOOD ( 12.65 ) 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 warning is fixed: drivers/media/i2c/vpx3220.c:404:41-47: opportunity for str_on_off(enable) Signed-off-by: Ricardo Ribalda --- drivers/media/i2c/vpx3220.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/vpx3220.c b/drivers/media/i2c/vpx3220.c index 5f1a22284168..c5b031dd59e7 100644 --- a/drivers/media/i2c/vpx3220.c +++ b/drivers/media/i2c/vpx3220.c @@ -401,7 +401,7 @@ static int vpx3220_s_routing(struct v4l2_subdev *sd, static int vpx3220_s_stream(struct v4l2_subdev *sd, int enable) { - v4l2_dbg(1, debug, sd, "s_stream %s\n", enable ? "on" : "off"); + v4l2_dbg(1, debug, sd, "s_stream %s\n", str_on_off(enable)); vpx3220_write(sd, 0xf2, (enable ? 0x1b : 0x00)); return 0; From patchwork Mon Sep 30 12:04:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816239 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 11B78CF6497 for ; Mon, 30 Sep 2024 12:40:14 +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=tASyZsxMamepS+/aqpGaV+hKbka/53sBNF0loAvAB9A=; b=4BSAofROnJaFsebVfEDhjiXY28 b2gLAVZa6HZ9UwU1Vlq4U5xGIWPxzWxGkhsoEzv+EhApm/c9uYSvRpPeEtYKO1c2cf6NZFnLguqhH 8SiMdfedyxT7wzO0wxf0JI/WOu2FKdEB9mZxQla8B89Wm5sjps7+rNty7IxjSnjFS1a4i98iUbIjC sO5IMfaW93p3NqCr6X+5zBfqTqWkROi7KE6NcGd26UwyJ0xV0wAhysL1DpPcecaoC/CGl/bcCdUxd I4Hg1tRv0oQ4cGJFiqmxVQi5rJdJ6bDAgWGsntlmLDDewlN83aw0JdwmVIMfapajq1fcQ5l9GzWJL VyHnc6QA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svFh5-0000000H5r0-2sJP; Mon, 30 Sep 2024 12:40:03 +0000 Received: from mail-qv1-xf2e.google.com ([2607:f8b0:4864:20::f2e]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svF9J-0000000Gwbo-2aer for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 12:05:11 +0000 Received: by mail-qv1-xf2e.google.com with SMTP id 6a1803df08f44-6cb2ad51162so36887086d6.3 for ; Mon, 30 Sep 2024 05:05:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697908; x=1728302708; 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=tASyZsxMamepS+/aqpGaV+hKbka/53sBNF0loAvAB9A=; b=BUYck07hL261fr4BOk7AZ9kwMiNBQ7UIzEVTzHVBqYHMBtW8rvX83iv8SHo4AmEhoP z85HmqOPQKR9uc5tDYFXCpSBATOVisBTCgLx7a2tC2xNghQWOxMv4XwN+OsmU/ocvxzb CekVOYMMSZYoD3b1Q1FcSqJndlaTECFLn7pEs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697908; x=1728302708; 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=tASyZsxMamepS+/aqpGaV+hKbka/53sBNF0loAvAB9A=; b=sZSnZ4RMiViQSJcnpOI9z+3+AJlR+sRVbQy314rDiACw82+dzM5hCKoIi771g3gVuo dmHtoUGnnrFUDDyiWskGiqDKEQ47TkbYEkJ8EwyFK08Inv+WUAVy4FFd3hOqTdO4xz+5 +6XsRqp4AeItlrruGFXTFQfRc4YKikA65OdjExTauCiFJ1xW7j61XkkY/Iy9Xzt/hVVt v9kAx+0TO8VoPLykW5wOcxOxrfJb9Ruv84Q5pBUR5R3bm9ZsQKJX6l0jS9R/1Ki29Ed1 hUYItpffHX7t+K4yrk1UM5p1obfRYzdA9rpUi6sQZCxHZbOkmL9exoNtWT4u9IolK9Yz EyAw== X-Forwarded-Encrypted: i=1; AJvYcCU9RiHzbeoxJfsBx3IUxD8Zpv9DXFHaXlOCASEzUEa8o8NvgZg4joKvGtYZI4auhZ+1tCgtEWo6jRD9h2yFbUtp@lists.infradead.org X-Gm-Message-State: AOJu0YzEAubG3jAqOCrGKVhTXzAS9GtkqJRnJxOrz7addbNeaEYGIre1 kBzqJSUoHZljNWRmBNvY3VF7NSnXK7acz7VXz2Z8xbDSwM5AhgbZGz5WQFZzzA== X-Google-Smtp-Source: AGHT+IFjm/EtrgyOgYzJ6FCtv8A70AwY6h/u/nfabbLzk2VgNMjTcGoqCqNUVQwkIEHXuuvTS3xGsw== X-Received: by 2002:a05:6214:4881:b0:6c7:c645:df60 with SMTP id 6a1803df08f44-6cb3b686f6cmr211008966d6.41.1727697908426; Mon, 30 Sep 2024 05:05:08 -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.05.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:05:08 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:27 +0000 Subject: [PATCH 32/45] media: i2c: tvp7002: Use string_choices helpers MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-32-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_050509_709721_978819DD X-CRM114-Status: GOOD ( 13.00 ) 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 warning is fixed: drivers/media/i2c/tvp7002.c:775:5-22: opportunity for str_yes_no(device -> streaming) Signed-off-by: Ricardo Ribalda --- drivers/media/i2c/tvp7002.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/tvp7002.c b/drivers/media/i2c/tvp7002.c index c09a5bd71fd0..2acf93a90c34 100644 --- a/drivers/media/i2c/tvp7002.c +++ b/drivers/media/i2c/tvp7002.c @@ -772,7 +772,7 @@ static int tvp7002_log_status(struct v4l2_subdev *sd) bt->width, bt->height); } v4l2_info(sd, "Streaming enabled: %s\n", - device->streaming ? "yes" : "no"); + str_yes_no(device->streaming)); /* Print the current value of the gain control */ v4l2_ctrl_handler_log_status(&device->hdl, sd->name); From patchwork Mon Sep 30 12:04:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816240 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 B3986CF6497 for ; Mon, 30 Sep 2024 12:41:26 +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=D8e26HE+3E35YBzu5RrV0IHIpztUFBPs/lzx1XUAlbA=; b=0E+N5+StBIjBcuRnAaSwsQqlxq TSvNaRxqnBZPwEmTebIElSeZUu1cqXl/AxZp2zHAsNNKG2IiAHKlxOfURlDwg5+PCwRzFVZOhn0yB bgcreTIs4Chx/BeZ1b15DJuar54Wak/4G8CbApxU0RfIKlLmXw8rqNfk/tveR65xvqNvoaAj3X77a S97vgyjnYcnDFPS3Sq+73JTEvRP4iECoESXiYb/25OVTeWBwGGhWr7nlX1GR9R3UGkJhj7AYyZGgM NmhIXh43oKsfuXkVGtKgKDWL5VwmOb6Wkf2/+6o4vxmKKLigpSdVBzdNC08Anh/yZBZ8vSLisgwX2 NS+KQYag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svFiG-0000000H67Z-2YOj; Mon, 30 Sep 2024 12:41:16 +0000 Received: from mail-qv1-xf34.google.com ([2607:f8b0:4864:20::f34]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svF9M-0000000GwdN-0OFB for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 12:05:13 +0000 Received: by mail-qv1-xf34.google.com with SMTP id 6a1803df08f44-6cb2e136da3so29190506d6.1 for ; Mon, 30 Sep 2024 05:05:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697911; x=1728302711; 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=D8e26HE+3E35YBzu5RrV0IHIpztUFBPs/lzx1XUAlbA=; b=Qof44TkiVB8ELvYUFePvyCwPOUHT0f3FsaMCkA06Xm4855nPhlwRmPHH/IE5mDlyvs CSm3Oj6KMpIwNBwyxzMgDiZuChqYbXGtl/1ngxIBe2p/EDs/GUBPQtUSWy5HRJhG7iTq kDXa1pYrTEse3DVSL3cfoqWu/sckBUG7PAPW8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697911; x=1728302711; 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=D8e26HE+3E35YBzu5RrV0IHIpztUFBPs/lzx1XUAlbA=; b=NufoXY3w9EoYqhp4rmZyXv5fESXC1jJb0uhrfxDlYGV9SpKLzkLyMw316jmBLAWtcx okdhLtaP063ZUD0L2xC2+0Il2rJgkByvGtPYCamfK30gFawzjRRZ19rBD3yXe5zcdNYE Z5fvJoghdYF8VlPjMvzENaZtk1r8eg/yfriS5sV+gxNj30i5fLJ9PZzKF4Rz0ER2zmY0 1SxcFSYK5qJQmcDWiVWkog98hkggkWg93h0y9P0q/0poynucx4mpZs6CwpV3INdAvoN9 makOSOP25p3/Mnm7aANl2TUjZeOWHuz9pDYoys6jThNM9CJKv3729R6zMgI/7KJhssSv cLuw== X-Forwarded-Encrypted: i=1; AJvYcCUWwB4oaZmrXFTGcWO8lKPWYs+tYosq+6GII/5tqBCP/AWT1NJDQ/pinQM5wfPHhqh0FZP0MKK2FafYj+JwiUDc@lists.infradead.org X-Gm-Message-State: AOJu0YzXORWwpOOdxAN9W//XsfdDZJmf9YVL2Ts55Vq2wgFDAvPWKZC6 OYbMPdI4+z0GLo9MkM1fu0h8bPRw1IDVPqqmsFMUKt2w95KDUCMZ2bttIyq+PQ== X-Google-Smtp-Source: AGHT+IEpi/h9qBTzENrO9vK1BVrLpd+v0VWjCMyXcKhCb+KBXNEG/xGQiqpkb/xdSgfcL4ga0CqsLg== X-Received: by 2002:a05:6214:2dc4:b0:6c5:5f04:3665 with SMTP id 6a1803df08f44-6cb3b6618e5mr175354206d6.48.1727697910946; Mon, 30 Sep 2024 05:05:10 -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.05.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:05:09 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:28 +0000 Subject: [PATCH 33/45] media: i2c: ths8200: Use string_choices helpers MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-33-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_050512_179336_C5754326 X-CRM114-Status: GOOD ( 12.68 ) 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/i2c/ths8200.c:133:4-19: opportunity for str_enabled_disabled(( reg_03 & 0x20 )) drivers/media/i2c/ths8200.c:149:52-54: opportunity for str_on_off(on) Signed-off-by: Ricardo Ribalda --- drivers/media/i2c/ths8200.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/i2c/ths8200.c b/drivers/media/i2c/ths8200.c index 686f10641c7a..a6d2fb64f563 100644 --- a/drivers/media/i2c/ths8200.c +++ b/drivers/media/i2c/ths8200.c @@ -130,7 +130,7 @@ static int ths8200_log_status(struct v4l2_subdev *sd) v4l2_info(sd, "power: %s\n", (reg_03 & 0x0c) ? "off" : "on"); v4l2_info(sd, "reset: %s\n", (reg_03 & 0x01) ? "off" : "on"); v4l2_info(sd, "test pattern: %s\n", - (reg_03 & 0x20) ? "enabled" : "disabled"); + str_enabled_disabled(reg_03 & 0x20)); v4l2_info(sd, "format: %ux%u\n", ths8200_read(sd, THS8200_DTG2_PIXEL_CNT_MSB) * 256 + ths8200_read(sd, THS8200_DTG2_PIXEL_CNT_LSB), @@ -146,7 +146,7 @@ static int ths8200_s_power(struct v4l2_subdev *sd, int on) { struct ths8200_state *state = to_state(sd); - v4l2_dbg(1, debug, sd, "%s: power %s\n", __func__, on ? "on" : "off"); + v4l2_dbg(1, debug, sd, "%s: power %s\n", __func__, str_on_off(on)); state->power_on = on; From patchwork Mon Sep 30 12:04:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816261 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 2EBE6CF6497 for ; Mon, 30 Sep 2024 12:42:43 +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=3Y9A3WlXYOmIt22yAkVtKfWzTv1HcbDXEuxLhuXF1BM=; b=2OgGSpmIBZcKA7zyQHydGnzt2J Z4lrQtVL/cpdH2Bv7vWva7/ohPh7l5lQrGmY/A346WUXBwcQrW2hb80TcQSz6LGtLbWHj/LsLlBJd vslzrsOuaalssz0H02Hf5Mu2jLhiJqgXRNS/tpaVh+BY1925lpPp4BzNIXMGwscxinBMCyK+I1B42 EsQSsTMBXhrnEV0Z89azDZu2gdkJ3jso+qZ90ehUyab+tKzs2V3UTgLIkVb09xmKeHXPAugvyfgke IoMxl4qmIC8nhu58cdS+Ot9Y9G4nEsqgllj45Ri6bbiPXaTNjTNxNliouLswtbDcQEDrSFaTm0ejh cDDHVwqg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svFjR-0000000H6YA-0ovd; Mon, 30 Sep 2024 12:42:29 +0000 Received: from mail-qk1-x731.google.com ([2607:f8b0:4864:20::731]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svF9N-0000000Gwdv-0nnx for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 12:05:14 +0000 Received: by mail-qk1-x731.google.com with SMTP id af79cd13be357-7a99e8ad977so359354785a.3 for ; Mon, 30 Sep 2024 05:05:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697912; x=1728302712; 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=3Y9A3WlXYOmIt22yAkVtKfWzTv1HcbDXEuxLhuXF1BM=; b=EGf6mI5vzeZH2Pm+ZTIrQlLcPEmAlPe7GP55YsujXLpjTtQMXg08nZ4zYeplQNDlAk FKNL8sEmZgWM5xXxBsFPSWroXVbwdwOcMSb6p4+o7rD3weMdfew4UAwhYYDfW1H8N4zy qJSEgfFw92o4fbZwvyaqrnnLtapw/ClawsXtw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697912; x=1728302712; 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=3Y9A3WlXYOmIt22yAkVtKfWzTv1HcbDXEuxLhuXF1BM=; b=obrITurB4nv0LRqYdr18dX/qj9RO3niGG9hokZd/79V0UuCa2pIjpGhcrPikMFjcIQ rB0Dld9EclgY557lA1Vn0u0b1BqyZFXEs7721sAGs3E1fwHCTMhyeFrTaOWTUNyTbfX8 PUSlzrKwRXyVWCsYlJYAXJ9JVhFngHlz49o3/9aBu8w3fmKtzRu1r+Y0LI9AT9noYXj5 MsPH70ClwOuw5nebTSp1nVx+Un9R7IPECMrahGzwRSj55J0Lcc/dyHjfLWIA8O1GagRc FCV85OKD0dnHJLmculdmpAfz+8oYPXbRZ4Pbt2uXLCSEsAzlWKpnr8F0N7HwHwzSLFNI MYRA== X-Forwarded-Encrypted: i=1; AJvYcCUJPPyyF1PBxLLlQOXSuDBYjrAGFAUjeVKg5F8hozwDdNL2pfsHO5CrntyZHYAQYHRduG13CdxAuqBk75dkmwOV@lists.infradead.org X-Gm-Message-State: AOJu0YzBS88VaDXqxQCR+4I1Gn72IrieNRujQJ5fZl/yzSgFFCulaMW9 FZHQQikwtKNazFlYY9w5DRRO/pxzKrpGiNQ2Lcq21wHrSgo6Y54d7i8OOIWovw== X-Google-Smtp-Source: AGHT+IEeEfZlZQBmO8RZI8xNY8EgNRIjUt1ZXgq35BOYTCkW0tdPK9t40pOtA1wbfy30W9apcgwPGQ== X-Received: by 2002:a05:6214:4198:b0:6cb:6655:e02d with SMTP id 6a1803df08f44-6cb6655e354mr40552846d6.3.1727697912026; Mon, 30 Sep 2024 05:05:12 -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.05.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:05:11 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:29 +0000 Subject: [PATCH 34/45] media: i2c: tda1997x: Use string_choices helpers MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-34-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_050513_273950_75001E56 X-CRM114-Status: GOOD ( 11.35 ) 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/i2c/tda1997x.c:1976:4-29: opportunity for str_yes_no(tda1997x_detect_tx_5v ( sd )) drivers/media/i2c/tda1997x.c:1978:4-30: opportunity for str_yes_no(tda1997x_detect_tx_hpd ( sd )) drivers/media/i2c/tda1997x.c:1972:37-56: opportunity for str_yes_no(state -> edid . present) Signed-off-by: Ricardo Ribalda --- drivers/media/i2c/tda1997x.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/i2c/tda1997x.c b/drivers/media/i2c/tda1997x.c index 3b7e5ff5b010..867c635fa37f 100644 --- a/drivers/media/i2c/tda1997x.c +++ b/drivers/media/i2c/tda1997x.c @@ -1969,13 +1969,13 @@ static int tda1997x_log_status(struct v4l2_subdev *sd) v4l2_info(sd, "-----Chip status-----\n"); v4l2_info(sd, "Chip: %s N%d\n", state->info->name, state->chip_revision + 1); - v4l2_info(sd, "EDID Enabled: %s\n", state->edid.present ? "yes" : "no"); + v4l2_info(sd, "EDID Enabled: %s\n", str_yes_no(state->edid.present)); v4l2_info(sd, "-----Signal status-----\n"); v4l2_info(sd, "Cable detected (+5V power): %s\n", - tda1997x_detect_tx_5v(sd) ? "yes" : "no"); + str_yes_no(tda1997x_detect_tx_5v(sd))); v4l2_info(sd, "HPD detected: %s\n", - tda1997x_detect_tx_hpd(sd) ? "yes" : "no"); + str_yes_no(tda1997x_detect_tx_hpd(sd))); v4l2_info(sd, "-----Video Timings-----\n"); switch (tda1997x_detect_std(state, &timings)) { From patchwork Mon Sep 30 12:04:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816262 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 39194CF6499 for ; Mon, 30 Sep 2024 12:43:52 +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=27WoLnk5gPTNJ0m2rtIWHwrzMjQJ4zxEXFjS8vXg2Uk=; b=ppoj81xEiTJcfHH8NuSpPLHejZ qIncB6bqBwCKPOv7bVK7OSkPl62E6STSpfsGn86h7Z/6s59PZavaXKgmThTli89uEBIL+df1HhB+3 K58gaJxrSRsU53tNKU5F2XrxX/3Q3NWNA6K7yNW2hzbtMifF+MPWYoN4xugb4EqVJj0lkx3Bdu0Ox hfpAMJ1d07AWBYa/ObqXLLU6S5dv6zs+WKTjsCDkMAcSvR7Pt3c+Daph54M+ZaY32LgKNKO91A6vK 1LGnQNjc/m/rVf+FUXH86G5CgpHnSqYcjGEcnYimyTYzrDTnCHXnina3pUxd636WRjnPsYf4G+ed3 PCls8YkQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svFkc-0000000H7CB-3PEP; Mon, 30 Sep 2024 12:43:42 +0000 Received: from mail-qv1-xf31.google.com ([2607:f8b0:4864:20::f31]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svF9O-0000000GweT-47dv for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 12:05:16 +0000 Received: by mail-qv1-xf31.google.com with SMTP id 6a1803df08f44-6cb2e5d0104so32211466d6.3 for ; Mon, 30 Sep 2024 05:05:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697914; x=1728302714; 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=27WoLnk5gPTNJ0m2rtIWHwrzMjQJ4zxEXFjS8vXg2Uk=; b=FYj3Klzhvr36bY/RxGCOqT8OvTqzfjjz1JfUPbTJ8PZyx59B72zzExm279jv376KjA UI4KnAbyf+9gw/Ylq9lszM/MIOE9WdIYMxUbu+T1NehrhwMK6H5b6p8Ny0ogfdxqBo7d cH53JIzHfuvuVbYM+BIkuZbP/8Ce7swAd1OyQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697914; x=1728302714; 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=27WoLnk5gPTNJ0m2rtIWHwrzMjQJ4zxEXFjS8vXg2Uk=; b=MpRxvZo70ZRH7JluhfGeK1iOVv7wZSwEA0QKW5JLmI4zuUpwU6E7mrfq9WezloSXiO rpEm/yQkerNfsTofy99DdbTfLIu5FoN40f+fZNrJMm/DyxnkRbqmEig4NnM5qVVgQDC6 iHWZ3uUILlJTAx4g8FW7OCfPovrlGt67qJlodzFbziG4PfCyaJgGyknOEeqjJdKsgbIe lWAT2cABNsu0AoKNhiXseolMCrOJ9asPkSAdkUubdsbMdgtNPLKNzeOyJaSQ2tSJefTk jnsk6Z2lqo9iDEbpJJZR3Fck+/SySly0XCx82Zc2Pbw7ywQkX8a+t89PPBYQutEs/vs5 frxQ== X-Forwarded-Encrypted: i=1; AJvYcCXPSWAfRdapbmvKBm+zFhOYNf/gSbqzg0w7HvkIu14lruqwNvuMefCKp/VIOIVQ9CABSK+nyOOSKqIWkPEjpPXK@lists.infradead.org X-Gm-Message-State: AOJu0YyTEQcyQVzVyDkGlPyOhvXGesPSOwpXpip96NTAnVqoq4BZbA0V UT33maiwoYmYXXeZKW6uecF7tRz5xu+35lI74SzBzfytX5q1PvP5N7kaZ2AFlg== X-Google-Smtp-Source: AGHT+IEmtR/kCt9kuVkbj7/r3Fqa0DixhR1uM5cl6xJKRSOoPA3YSLhx2F2SjU4khmzc/KfhSVtoIQ== X-Received: by 2002:a05:6214:4a87:b0:6cb:6059:92a with SMTP id 6a1803df08f44-6cb60590d50mr62400906d6.10.1727697913781; Mon, 30 Sep 2024 05:05:13 -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.05.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:05:12 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:30 +0000 Subject: [PATCH 35/45] media: i2c: tc358743: Use string_choices helpers MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-35-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_050515_071287_70BCAD73 X-CRM114-Status: GOOD ( 10.97 ) 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/i2c/tc358743.c:370:46-52: opportunity for str_enable_disable(enable) drivers/media/i2c/tc358743.c:1325:32-63: opportunity for str_on_off(hdmi_sys_status & MASK_S_AVMUTE) drivers/media/i2c/tc358743.c:1264:35-54: opportunity for str_on_off(sysctl & MASK_SLEEP) drivers/media/i2c/tc358743.c:1187:14-19: opportunity for str_yes_no(tx_5v) drivers/media/i2c/tc358743.c:1266:3-33: opportunity for str_yes_no(hdmi_sys_status & MASK_S_DDC5V) drivers/media/i2c/tc358743.c:1319:3-32: opportunity for str_yes_no(hdmi_sys_status & MASK_S_HDCP) drivers/media/i2c/tc358743.c:1281:3-35: opportunity for str_yes_no(hdmi_sys_status & MASK_S_PHY_PLL) drivers/media/i2c/tc358743.c:1283:3-36: opportunity for str_yes_no(hdmi_sys_status & MASK_S_PHY_SCDT) drivers/media/i2c/tc358743.c:1279:3-32: opportunity for str_yes_no(hdmi_sys_status & MASK_S_SYNC) drivers/media/i2c/tc358743.c:1277:3-32: opportunity for str_yes_no(hdmi_sys_status & MASK_S_TMDS) drivers/media/i2c/tc358743.c:1274:3-37: opportunity for str_yes_no(( i2c_rd16 ( sd , CECEN ) & MASK_CECEN )) drivers/media/i2c/tc358743.c:1309:3-42: opportunity for str_yes_no(( i2c_rd16 ( sd , CSI_STATUS ) & MASK_S_HLT )) drivers/media/i2c/tc358743.c:1306:3-44: opportunity for str_yes_no(( i2c_rd16 ( sd , CSI_STATUS ) & MASK_S_RXACT )) drivers/media/i2c/tc358743.c:1303:3-44: opportunity for str_yes_no(( i2c_rd16 ( sd , CSI_STATUS ) & MASK_S_TXACT )) drivers/media/i2c/tc358743.c:1300:3-44: opportunity for str_yes_no(( i2c_rd16 ( sd , CSI_STATUS ) & MASK_S_WSYNC )) drivers/media/i2c/tc358743.c:1268:3-50: opportunity for str_yes_no(( i2c_rd8 ( sd , EDID_MODE ) & MASK_EDID_MODE_E_DDC )) drivers/media/i2c/tc358743.c:1271:3-41: opportunity for str_yes_no(( i2c_rd8 ( sd , HPD_CTL ) & MASK_HPD_OUT0 )) Signed-off-by: Ricardo Ribalda --- drivers/media/i2c/tc358743.c | 44 +++++++++++++++++++------------------------- 1 file changed, 19 insertions(+), 25 deletions(-) diff --git a/drivers/media/i2c/tc358743.c b/drivers/media/i2c/tc358743.c index 65d58ddf0287..f2e1e55ae190 100644 --- a/drivers/media/i2c/tc358743.c +++ b/drivers/media/i2c/tc358743.c @@ -367,8 +367,8 @@ static void tc358743_delayed_work_enable_hotplug(struct work_struct *work) static void tc358743_set_hdmi_hdcp(struct v4l2_subdev *sd, bool enable) { - v4l2_dbg(2, debug, sd, "%s: %s\n", __func__, enable ? - "enable" : "disable"); + v4l2_dbg(2, debug, sd, "%s: %s\n", __func__, + str_enable_disable(enable)); if (enable) { i2c_wr8_and_or(sd, HDCP_REG3, ~KEY_RD_CMD, KEY_RD_CMD); @@ -1184,7 +1184,7 @@ static void tc358743_hdmi_sys_int_handler(struct v4l2_subdev *sd, bool *handled) bool tx_5v = tx_5v_power_present(sd); v4l2_dbg(1, debug, sd, "%s: Tx 5V power present: %s\n", - __func__, tx_5v ? "yes" : "no"); + __func__, str_yes_no(tx_5v)); if (tx_5v) { tc358743_enable_edid(sd); @@ -1261,26 +1261,24 @@ static int tc358743_log_status(struct v4l2_subdev *sd) !!(sysctl & MASK_CECRST), !!(sysctl & MASK_CTXRST), !!(sysctl & MASK_HDMIRST)); - v4l2_info(sd, "Sleep mode: %s\n", sysctl & MASK_SLEEP ? "on" : "off"); + v4l2_info(sd, "Sleep mode: %s\n", str_on_off(sysctl & MASK_SLEEP)); v4l2_info(sd, "Cable detected (+5V power): %s\n", - hdmi_sys_status & MASK_S_DDC5V ? "yes" : "no"); + str_yes_no(hdmi_sys_status & MASK_S_DDC5V)); v4l2_info(sd, "DDC lines enabled: %s\n", - (i2c_rd8(sd, EDID_MODE) & MASK_EDID_MODE_E_DDC) ? - "yes" : "no"); + str_yes_no(i2c_rd8(sd, EDID_MODE) & MASK_EDID_MODE_E_DDC)); v4l2_info(sd, "Hotplug enabled: %s\n", - (i2c_rd8(sd, HPD_CTL) & MASK_HPD_OUT0) ? - "yes" : "no"); + str_yes_no(i2c_rd8(sd, HPD_CTL) & MASK_HPD_OUT0)); v4l2_info(sd, "CEC enabled: %s\n", - (i2c_rd16(sd, CECEN) & MASK_CECEN) ? "yes" : "no"); + str_yes_no(i2c_rd16(sd, CECEN) & MASK_CECEN)); v4l2_info(sd, "-----Signal status-----\n"); v4l2_info(sd, "TMDS signal detected: %s\n", - hdmi_sys_status & MASK_S_TMDS ? "yes" : "no"); + str_yes_no(hdmi_sys_status & MASK_S_TMDS)); v4l2_info(sd, "Stable sync signal: %s\n", - hdmi_sys_status & MASK_S_SYNC ? "yes" : "no"); + str_yes_no(hdmi_sys_status & MASK_S_SYNC)); v4l2_info(sd, "PHY PLL locked: %s\n", - hdmi_sys_status & MASK_S_PHY_PLL ? "yes" : "no"); + str_yes_no(hdmi_sys_status & MASK_S_PHY_PLL)); v4l2_info(sd, "PHY DE detected: %s\n", - hdmi_sys_status & MASK_S_PHY_SCDT ? "yes" : "no"); + str_yes_no(hdmi_sys_status & MASK_S_PHY_SCDT)); if (tc358743_get_detected_timings(sd, &timings)) { v4l2_info(sd, "No video detected\n"); @@ -1297,17 +1295,13 @@ static int tc358743_log_status(struct v4l2_subdev *sd) v4l2_info(sd, "Lanes in use: %d\n", state->csi_lanes_in_use); v4l2_info(sd, "Waiting for particular sync signal: %s\n", - (i2c_rd16(sd, CSI_STATUS) & MASK_S_WSYNC) ? - "yes" : "no"); + str_yes_no(i2c_rd16(sd, CSI_STATUS) & MASK_S_WSYNC)); v4l2_info(sd, "Transmit mode: %s\n", - (i2c_rd16(sd, CSI_STATUS) & MASK_S_TXACT) ? - "yes" : "no"); + str_yes_no(i2c_rd16(sd, CSI_STATUS) & MASK_S_TXACT)); v4l2_info(sd, "Receive mode: %s\n", - (i2c_rd16(sd, CSI_STATUS) & MASK_S_RXACT) ? - "yes" : "no"); + str_yes_no(i2c_rd16(sd, CSI_STATUS) & MASK_S_RXACT)); v4l2_info(sd, "Stopped: %s\n", - (i2c_rd16(sd, CSI_STATUS) & MASK_S_HLT) ? - "yes" : "no"); + str_yes_no(i2c_rd16(sd, CSI_STATUS) & MASK_S_HLT)); v4l2_info(sd, "Color space: %s\n", state->mbus_fmt_code == MEDIA_BUS_FMT_UYVY8_1X16 ? "YCbCr 422 16-bit" : @@ -1316,14 +1310,14 @@ static int tc358743_log_status(struct v4l2_subdev *sd) v4l2_info(sd, "-----%s status-----\n", is_hdmi(sd) ? "HDMI" : "DVI-D"); v4l2_info(sd, "HDCP encrypted content: %s\n", - hdmi_sys_status & MASK_S_HDCP ? "yes" : "no"); + str_yes_no(hdmi_sys_status & MASK_S_HDCP)); v4l2_info(sd, "Input color space: %s %s range\n", input_color_space[(vi_status3 & MASK_S_V_COLOR) >> 1], (vi_status3 & MASK_LIMITED) ? "limited" : "full"); if (!is_hdmi(sd)) return 0; - v4l2_info(sd, "AV Mute: %s\n", hdmi_sys_status & MASK_S_AVMUTE ? "on" : - "off"); + v4l2_info(sd, "AV Mute: %s\n", + str_on_off(hdmi_sys_status & MASK_S_AVMUTE)); v4l2_info(sd, "Deep color mode: %d-bits per channel\n", deep_color_mode[(i2c_rd8(sd, VI_STATUS1) & MASK_S_DEEPCOLOR) >> 2]); From patchwork Mon Sep 30 12:04:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816268 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 65A07CF6499 for ; Mon, 30 Sep 2024 12:45: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=Y1nqJxv+kHTFXHSCWxO1NaLDK6vY0ti6KAFzNxfjGjU=; b=dIgzlzAFZ8PDqo8iD5TBwQcbkM kr9uKGKJ2zVikLiqHcTkbsEJBNwqMQuGM2S93Fb8bwc8R4PAVFznF02Np1eCY7ptX93kzgQrImxbk LbJbtPeafTgzHjxzbh+stO2U2Zy3Jjyvh5br+9Qb6FQWf68jMaEe1iJ3C7RABXdZUpv0x2uDgPz8G 61FcBaUc+xsnX8/+QlINfyRn9jvgLPKORP0xw36NJu8QvH/gypXAF8MOm3oR5TiiRn+ma88L1HYb5 JG+GoxCQo/mmLSwL5rbxSsRBR2j1O6Drkv61gXxW2B6gnsVXA4/RcUdTCW7OZcmEa8so78aSXaxue bwY13sXQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svFlo-0000000H7W6-15yd; Mon, 30 Sep 2024 12:44:56 +0000 Received: from mail-qv1-xf35.google.com ([2607:f8b0:4864:20::f35]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svF9Q-0000000GwfF-2elu for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 12:05:17 +0000 Received: by mail-qv1-xf35.google.com with SMTP id 6a1803df08f44-6cb2f272f8bso40067266d6.0 for ; Mon, 30 Sep 2024 05:05:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697916; x=1728302716; 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=Y1nqJxv+kHTFXHSCWxO1NaLDK6vY0ti6KAFzNxfjGjU=; b=m8WnQtYH3/YC49pZMzV8j6UWNn/sq21lEJxGwcZtsEZzN0165t/qqIfuz/0cnMUj+L E22EM0eKmWKcv0iTc30+VvQW50rBskkobDx9wx9cwlb0yUV0PLwQTKgn6s9Wrj1AW0oG eugpKX+PuYGQrOzvdBZmjZQNbaGUDTdxe1cXg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697916; x=1728302716; 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=Y1nqJxv+kHTFXHSCWxO1NaLDK6vY0ti6KAFzNxfjGjU=; b=asgQnkMMKQ+kgakYr+o7xE14JkLObt5vaFbSS223UnBNUKg2+orsoWETKbOlm9x1Yg X9K91xPq0qIJMDDWgojrziRBNTBJQtlRPCKe5wJoBGx3HMbB0iRZlubQg/Hr3ZPneHW3 XjMGZ9dAK7ShRB1LXbZ/iXo1RGEOZsZPcHX+18ovAH6smq3MJ1xlbnPXLFi/xcVwoQ0x FGAOHy88gneMW8YDMJTagj+yLZiPeLsxLeoWmDdAHa9m2CcdD8CiT7ZNJhEYYxvYeS5H e2mF2Tm1zKpvuSxANFBVb0LPpNIan96JY4+4jpo7U/iaPbF3UZZkd90dn9fDoHHBPQB7 249w== X-Forwarded-Encrypted: i=1; AJvYcCVNbmET8ncB0mTvHUxxPC2RTcPkE9pyG5QDqggg3+pFXbZMa5IhpehbNKrrRMswlubPDG+8CRVpT68eaDay2DIZ@lists.infradead.org X-Gm-Message-State: AOJu0YyBufCCY0PchQingqj1qEaHPC5Tu1J+0OmZzizLAH/346MipzLL o/qvHpbQ/YSZ3V10RudIqkNTW4Dwli5zSvfQnzFrSKQt2Ue6yg0MvtH+cDrSHw== X-Google-Smtp-Source: AGHT+IFHqIZOoSZ0SNoSJp6T9EpjigAIsbvAUF0oGwPlw/LLEGHSlB7PElYqfizjzUxKI+v34TuK6Q== X-Received: by 2002:a05:6214:3c9a:b0:6c3:55f3:ed92 with SMTP id 6a1803df08f44-6cb3b5e7233mr204180416d6.2.1727697915550; Mon, 30 Sep 2024 05:05:15 -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.05.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:05:15 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:31 +0000 Subject: [PATCH 36/45] media: i2c: st-mipid02: Use string_choices helpers MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-36-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_050516_713264_8D1B275C X-CRM114-Status: GOOD ( 12.52 ) 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 warning is fixed: drivers/media/i2c/st-mipid02.c:552:3-9: opportunity for str_enable_disable(enable) Signed-off-by: Ricardo Ribalda --- drivers/media/i2c/st-mipid02.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/st-mipid02.c b/drivers/media/i2c/st-mipid02.c index b947a55281f0..70a691504eed 100644 --- a/drivers/media/i2c/st-mipid02.c +++ b/drivers/media/i2c/st-mipid02.c @@ -549,7 +549,7 @@ static int mipid02_s_stream(struct v4l2_subdev *sd, int enable) mipid02_stream_disable(bridge); if (ret) dev_err(&client->dev, "failed to stream %s (%d)\n", - enable ? "enable" : "disable", ret); + str_enable_disable(enable), ret); return ret; } From patchwork Mon Sep 30 12:04:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816269 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 146C5CF6497 for ; Mon, 30 Sep 2024 12:46:18 +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=VS7D6fkzy/mB93t3oLBUPb5JuZ0mJyEpuRoOfQlLof8=; b=MrlydVO/QGa8eI4wIayGebZdRn 90qs1hVGEk/uvcciW5xniNd1+lY4yIh3xrHrSl27sOWswK6MTW3CyUUWFsvjTtBcUSo813iCQC/ji HdCjPOeatL2cWFsOaVSzsPhKba30qjLDx79sdH/AsFSBbHULfzJTZy2iA1LHEelAL3lYIl1Vj0J+P qy5NyRSpkDvB0SgNXcxaxHXlwJbjjEng+dI+/CniOIemYPhSvN5RKArFZq1T9r5neEYCbqXMzP/o7 wRqxEey5Fxya7h+GLl2sNDfxivnxyIiWwI67L5OMf22+0qnofhrt2Qw2pcVBNwibuugXb0V145Pwy 9kUQGuJg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svFn0-0000000H7oY-01m3; Mon, 30 Sep 2024 12:46:10 +0000 Received: from mail-ot1-x32f.google.com ([2607:f8b0:4864:20::32f]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svF9S-0000000Gwfy-1hXZ for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 12:05:19 +0000 Received: by mail-ot1-x32f.google.com with SMTP id 46e09a7af769-709346604a7so2210574a34.1 for ; Mon, 30 Sep 2024 05:05:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697917; x=1728302717; 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=VS7D6fkzy/mB93t3oLBUPb5JuZ0mJyEpuRoOfQlLof8=; b=GTEL6C9qGGgNr+iyhPaBnC3d+5ErF2SUJOzTCZPLAwtvpliezovH7CQa3U0WCxvcAP p0mtOMf7UKPqNLwrV6GsjPq34KB+wHYINyLvP5ex8q7Z7UBf4hwY9iXm18qmoUw1Z61J I8WNp76poY9ag5Um+DrvRgrR0r3HgCJx5kaqg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697917; x=1728302717; 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=VS7D6fkzy/mB93t3oLBUPb5JuZ0mJyEpuRoOfQlLof8=; b=UKJn8zRd3yrd89rIf8SHfs9ibRbjJlPjdVeL4qsOekj4BzS4ClTk/TcIZ22mufDxIl 8mxNPKYRg/tUnSIHwPSPyM4j/EsiWZbq/rMIJ/ZrNIwHFwUaWd7BlfXotLyEE9p4vJQX tPYqeJMitfUZfU+eBx4oB+59DRKA3W//aIimBnVcOukEp0byCy6XUOnvcohE8hz970+2 RlRZszdFRO3MPugEbMvcoMoYniYyuPtGq8RiVGQwtnbjNfnWxlCakmPdTXX9YFEJv4w+ VO1/2cGrTpm2WflhDlOkJIR9q3dj8tDVo74z2VJ9CkFqW8Eu6cNnwt/EQpLINi4lcjXN mcSQ== X-Forwarded-Encrypted: i=1; AJvYcCWTYO+3zOnVQOZjuSkG0j7yGTYfKqQQEcGRAD2F76rQfoujtOG0LrCO1XlnwPGWHRX6ZcXQbTR8bAaybcaVHZgZ@lists.infradead.org X-Gm-Message-State: AOJu0Yzbj/ygZarx10mvOP6oIZxZAI0lZISDdjWi5CRbOEyFz37QZaAD l1nMrnm1dHcF4jHmeIXvX1Fp38Wlr4ujyDsrDEKdImhrSEsBOZzRdwUg09aPCg== X-Google-Smtp-Source: AGHT+IEsGDncZXqIOKaIooO2hw5tICb0OJqubpFFkQiHlkBn39PImu6hgDgqbreQ/CasmuZpa2D32A== X-Received: by 2002:a05:6358:5288:b0:1ba:580e:dea2 with SMTP id e5c5f4694b2df-1becbc86414mr292235955d.17.1727697917163; Mon, 30 Sep 2024 05:05: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.05.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:05:16 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:32 +0000 Subject: [PATCH 37/45] media: i2c: msp3400: Use string_choices helpers MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-37-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_050518_486912_16C12137 X-CRM114-Status: GOOD ( 11.93 ) 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/i2c/msp3400-driver.c:341:4-21: opportunity for str_on_off(state -> muted -> val) drivers/media/i2c/msp3400-driver.c:342:4-27: opportunity for str_yes_no(state -> scan_in_progress) Signed-off-by: Ricardo Ribalda --- drivers/media/i2c/msp3400-driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/i2c/msp3400-driver.c b/drivers/media/i2c/msp3400-driver.c index 4c0b0ad68c08..c7807b17add9 100644 --- a/drivers/media/i2c/msp3400-driver.c +++ b/drivers/media/i2c/msp3400-driver.c @@ -338,8 +338,8 @@ static int msp_s_ctrl(struct v4l2_ctrl *ctrl) val = (val * 0x7f / 65535) << 8; dev_dbg_lvl(&client->dev, 1, msp_debug, "mute=%s scanning=%s volume=%d\n", - state->muted->val ? "on" : "off", - state->scan_in_progress ? "yes" : "no", + str_on_off(state->muted->val), + str_yes_no(state->scan_in_progress), state->volume->val); msp_write_dsp(client, 0x0000, val); From patchwork Mon Sep 30 12:04:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816270 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 30590CF64A3 for ; Mon, 30 Sep 2024 12:47: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=HJx29BD9yZboyGEAUyw+4rBBbXZtXq331Q8okj0vBtk=; b=MHFo8ta5l0okPL5RWVWNRQjIeA Pc4UGmoqhjewmAd7844RHGjwag+4jpgBXl4vBuONojWiT5owqtHveAy12SX+uXM6JQYCQ22cKSmnU X1sfadzhIjN0e8qqohvQJ53Qc7/hAwxyTraXALQYZXI1Cdpwshi61spiZPgUsbAU8RuAt/XFNiEMt FtmJc9gPVWuD5WSBR9bBERBy6oAJiC10apV/NqUTeUXzYt4erl4EZH9GmsJEoMdIaLRhSPgeTLtWs 4S8pS5CqysKx/zFJoig1I6XR2UtqKqfIm4DBLVnvJ24TtB40ojOdGMW9+4m8mUlKdPxouuzdogKoM MecBgXig==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svFoB-0000000H89z-22ZR; Mon, 30 Sep 2024 12:47:23 +0000 Received: from mail-qv1-xf2c.google.com ([2607:f8b0:4864:20::f2c]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svF9T-0000000GwgM-1vgw for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 12:05:21 +0000 Received: by mail-qv1-xf2c.google.com with SMTP id 6a1803df08f44-6cb2f344dbbso35008356d6.3 for ; Mon, 30 Sep 2024 05:05:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697918; x=1728302718; 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=HJx29BD9yZboyGEAUyw+4rBBbXZtXq331Q8okj0vBtk=; b=Mx/pFCZpnVFtxWEL79s0x06Wrfw2QCIceiuyHTNzleUlt9VUDh5v1TbEiMJRKvIGfI nAtlaApKGynObSnPZTHoE4Xf62Gy5sQMKlfUX7+Za13p6wMpzlbUnN3MWaPJIc4ss7xm V1ZQMHefNOIYnDJef/Aw4Br+CWo8V4ieLOYDY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697918; x=1728302718; 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=HJx29BD9yZboyGEAUyw+4rBBbXZtXq331Q8okj0vBtk=; b=Z3ReLYnQ7W7GkubcUiWVbYV0P4KJA9yZi9C3dSFpqvo7c/r4lL1jU88OER2KDuts+c zCYJvlRKgvJ0DUD4UAUeh9Eo5LILYXRQWwnNltlvz5np3WK3K0qoDcMRSBfJIjIvqEe3 j9A48HYIN1zvHvvBZYuNoF3pky5DggysVkXggGJHzCNQKt8rZQaWU2TOHFJ9JAuDNoXO ZmxtwVg9C4XxHnyl3+TQ5yeHiVR48tp9XIe1bwtR+tw0+wQ11TSx+HglrLVWp8WmY3Q2 My6u3Gcjxm1bPT5Q3d+etyyeK1K3GSJCZLJCJQhP+mUr4Am3erD4PZqTIjjUbpPTXIQx qM4w== X-Forwarded-Encrypted: i=1; AJvYcCV594RbSzonRYtD1OfJD8sa2TaFUL6IpVyF5B0cpGDy8+ip8G6qankq5l65FHbGx6ZcupqqgLFGqRT84rgY/ziF@lists.infradead.org X-Gm-Message-State: AOJu0YyzNmMOI+BDD7NQFjP6h7X0tjJn3btawcrfI1aplMiFhw+0izhe ukP1bZZYnDolX/he4S0LEt73ng68RtE0SvX4Fd8wm4YobihV/hBBcMa8doZZxg== X-Google-Smtp-Source: AGHT+IHvBkaWPQbVKiD/u2iOrMRkK3daurGtkkhjknrAX1KIWB3cA5A9a8FHevVPAdBTGyigNIjY6g== X-Received: by 2002:a05:6214:3a88:b0:6cb:2e94:3e24 with SMTP id 6a1803df08f44-6cb3b5b7edcmr189314226d6.11.1727697918247; Mon, 30 Sep 2024 05:05:18 -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.05.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:05:17 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:33 +0000 Subject: [PATCH 38/45] media: i2c: max9286: Use string_choices helpers MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-38-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_050519_534168_5550EB07 X-CRM114-Status: GOOD ( 13.15 ) 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/i2c/max9286.c:1333:3-9: opportunity for str_on_off(enable) drivers/media/i2c/saa7115.c:1366:3-9: opportunity for str_enable_disable(enable) Signed-off-by: Ricardo Ribalda --- drivers/media/i2c/max9286.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/max9286.c b/drivers/media/i2c/max9286.c index 9fc4e130a273..d0f542343344 100644 --- a/drivers/media/i2c/max9286.c +++ b/drivers/media/i2c/max9286.c @@ -1330,7 +1330,7 @@ static int max9286_poc_enable(struct max9286_priv *priv, bool enable) if (ret < 0) dev_err(&priv->client->dev, "Unable to turn power %s\n", - enable ? "on" : "off"); + str_on_off(enable)); return ret; } From patchwork Mon Sep 30 12:04:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816271 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 9102FCF6497 for ; Mon, 30 Sep 2024 12:48: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=ckz+f9oQpPUu6rIcK1E7/sklc7IJmpymEtGmVuUIyqc=; b=cnOaAvvv9vWRr9mXbv5yKsVmQ3 DSkmly22LgFhO9citifm6K7hTgHMwDRDlYZwLcCBV3o6zGEvgq2RWOz7WtJPJUl3mN+c3oKTP3RKY fRS+Fgk6hKKFD1pCwsdBNLl6/mi7aAdWSRaqjkdhMFCwLjZyzJH3mPMn/rN/7rwZl+ag6PgYCD1Xw 4C3bbQmEP3lfmOJcSzVIHEDXHT8zS/xkKiu/7mCY9BIet1wmGfoxESLyIJsWe7DI2/iNv+sXT/8dv +6bR2dcE4cLvswy9MgZHXNUkVKbuc26iLwQqgltDRo8d2348+cshUx7gvEqjbQbKjPPwR85BXEUNJ oooKcw9w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svFpM-0000000H8Ok-1f0I; Mon, 30 Sep 2024 12:48:36 +0000 Received: from mail-qk1-x731.google.com ([2607:f8b0:4864:20::731]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svF9V-0000000GwhL-1DVD for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 12:05:22 +0000 Received: by mail-qk1-x731.google.com with SMTP id af79cd13be357-7a99fdf2e1aso581495185a.2 for ; Mon, 30 Sep 2024 05:05:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697920; x=1728302720; 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=ckz+f9oQpPUu6rIcK1E7/sklc7IJmpymEtGmVuUIyqc=; b=a/ij72gsibU7pMLI4JVDH3WhxSKJkjURZHqQ+h64JLiw6w/ljh9deixa8pBd/jwSFt N0WwxB6Zq77TK3gFasHp3RedQKzdZKbjfklmryOcxEk1PbWKq1uFXTRyGiS0I+WXItKe FI9lpuHiFTecdWzm182AKAl7XpokcyfZGUhr4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697920; x=1728302720; 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=ckz+f9oQpPUu6rIcK1E7/sklc7IJmpymEtGmVuUIyqc=; b=HpJWrg2Uc6kyi8vfV3Y4qKz66viRgqU2bE9X5QUSG/0OMG+n7ss9+fAs3jiw64NSkr WRqtB/hC9pLLZf7gYMjHbyWEsrl9oxFZ1bpdnyx/TIpndYTWKQJZAhd+fCT6innR2LJR d0+q8qonWq5fvkR2JMZ5ylN9QLsFHH/XrREgLv+Dupt8xuPWqmKlHTUfBcV8pZi/O4US VQWnuepkFOWRniKJXHO6v3g9Iq4s4uTj618azJy7OWEGkYlbFWekq7auIGFquDM9qXeK nbQmrnf1djPkidgR1iQ+gPUMEtMF0cJHZuXBOZAkgMYgazcKSKypkCI2EnRqeyDC+yu+ uDgQ== X-Forwarded-Encrypted: i=1; AJvYcCXrFPHnEQRMc4d4/ZuvghJntAnHlUPgXAhbKL3p0ZigQDF82vFJ9MRWX8IrMn4Km2QMZ4Ep3eDRgafHiwI5LHrN@lists.infradead.org X-Gm-Message-State: AOJu0YxkZp4VLzi6yzbunfUAiOPHht6qAoqkHa+SAPQf9Kf1I44KtKnf Ig4PxFc+9uIxLQ5Cz/M0mHHyj7/Zt5olB4+6Lf/v6WhhQUMdWhcg279ycGCvIw== X-Google-Smtp-Source: AGHT+IEi2P8ci2OPbo+jpkaZ22WOo6DK57pM4gbAU29+4tgFAAJdQKDCxefcZ9fdV8Kube5E0H3gmQ== X-Received: by 2002:a05:6214:3a8c:b0:6c3:5c75:d2bc with SMTP id 6a1803df08f44-6cb3b66fab3mr198718286d6.47.1727697920467; Mon, 30 Sep 2024 05:05:20 -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.05.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:05:19 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:34 +0000 Subject: [PATCH 39/45] media: i2c: saa717x: Use string_choices helpers MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-39-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_050521_425721_E9A0B6DA X-CRM114-Status: GOOD ( 12.62 ) 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 warning is fixed: drivers/media/i2c/saa717x.c:1091:3-9: opportunity for str_enable_disable(enable) Signed-off-by: Ricardo Ribalda --- drivers/media/i2c/saa717x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/saa717x.c b/drivers/media/i2c/saa717x.c index b0793bb0c02a..2337cef45e3a 100644 --- a/drivers/media/i2c/saa717x.c +++ b/drivers/media/i2c/saa717x.c @@ -1088,7 +1088,7 @@ static int saa717x_s_stream(struct v4l2_subdev *sd, int enable) struct saa717x_state *decoder = to_state(sd); v4l2_dbg(1, debug, sd, "decoder %s output\n", - enable ? "enable" : "disable"); + str_enable_disable(enable)); decoder->enable = enable; saa717x_write(sd, 0x193, enable ? 0xa6 : 0x26); return 0; From patchwork Mon Sep 30 12:04:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816313 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 2ECB2CF64B3 for ; Mon, 30 Sep 2024 12:58:44 +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=JU7U+YsXwNUN3GXi+lZlabPGhAkg1lZuiKZFCmpVa4Q=; b=Si2gxXInrE5vkBh9s/mAgS3kdW gTZhp/SMQtoWXEqLJwBGmG3K0P9POfRfhrEQjG0ftEnax9wSDslvjR8QaJfgRoPchWJMnW1QvKXJi JbfyrjAQJqpU0eKPrOY9JzzDbahLxAbASsgYyqBPqHkLL2eaKYMxd2jKjUalWvfdFWMoPGxCDbLg2 2DS2XqNEgHsmAsK99Fu26ymyI5qF1fRDFkrSXU81uQfZ+GIqDG/7fyVgf4rCTQLRkwzeQV1G/0i0r 7SrLkNX5kSOiiYL3VFqMFO7XJmW7gYGHJPbD6MdpjgdVaI5X/Hdakcq1T5Dha+kRZGykRNn1Ac21F 1j+gtFhA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svFz0-0000000HAxI-36m5; Mon, 30 Sep 2024 12:58:34 +0000 Received: from mail-qv1-xf31.google.com ([2607:f8b0:4864:20::f31]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svF9W-0000000GwiB-23z6 for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 12:05:24 +0000 Received: by mail-qv1-xf31.google.com with SMTP id 6a1803df08f44-6cb2f272f8bso40067976d6.0 for ; Mon, 30 Sep 2024 05:05:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697921; x=1728302721; 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=JU7U+YsXwNUN3GXi+lZlabPGhAkg1lZuiKZFCmpVa4Q=; b=ZZaSfvbiql4Hh0/t6wnyP33f6odvIzdL2AdF9tNTtWY/oZtFyPvZsgu4gYozSh3N1i 4ZyCe7TvPUbvNpvR50KC9stzVOaZPQNQM9WCLGYTzeL8DG76uN2ReH5Q7+TE1pYhd4xR 9d+UGTRIZ339hRdd3KYymjsRNOfDg1sjjleDs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697921; x=1728302721; 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=JU7U+YsXwNUN3GXi+lZlabPGhAkg1lZuiKZFCmpVa4Q=; b=ohKA73j6/rIyR0jbzraM1IN/HMc8m81wPDwU9BnC29VSjd/1MtQhGOrzu2Zl729W7H nFOEWeOcOQsvHxOC6XfC0o0QjltxSGsN+jZ1EQMsC2HJwyveTGAKKJPDn3rRFTqzCTj+ V/p64YnZoQN/2A22MGA2AzcVRtB2nL2KEtYcZMttt7P/w8iTXO2P1JYD8J+gKuUTMC04 L9usF+mVOQd6FtgSWYu/em7u8rVos+LIOHArUX/nt+hSLsAdVP9DTloYl3LB3KmeyCxe Kc2Fy17+VIVpoF/hkfnKVEyt26R5I9vXeHWd3C4oG1wFsGuOE6Jv5wSKDUI8RSXP+OFL nJXA== X-Forwarded-Encrypted: i=1; AJvYcCWI+sCHszX96z15u9IoedlhudeqzbN0PN7OZYKSpNJBG2OsVB4m4o6ati/Xvj3aVZ5lBlO6pz6wa0NLui55eRs3@lists.infradead.org X-Gm-Message-State: AOJu0YzluKjKOZlfsB+QQ6tw+9cvOnzkeKFvHBJL3jH8Zs1yRgauQkGW 02spJm4LYOWi0stIG6RNVTRPzfU34xedASPHbHuSRe7MferITm1ltod9aezHiA== X-Google-Smtp-Source: AGHT+IFo7OOUc+eOD+KctwzfWQcOtVnWKBIl/eyXC/k7ALK2/LWIOZekEy/aM6hhFvO+98exx2mm7Q== X-Received: by 2002:a05:6214:310a:b0:6cb:52c9:b91e with SMTP id 6a1803df08f44-6cb52c9bbcbmr87563466d6.35.1727697921599; Mon, 30 Sep 2024 05:05:21 -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.05.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:05:21 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:35 +0000 Subject: [PATCH 40/45] media: i2c: saa7127: Use string_choices helpers MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-40-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_050522_572685_731AE72B X-CRM114-Status: GOOD ( 11.97 ) 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/i2c/saa7127.c:678:33-49: opportunity for str_enabled_disabled(state -> cc_enable) drivers/media/i2c/saa7127.c:677:33-50: opportunity for str_enabled_disabled(state -> vps_enable) drivers/media/i2c/saa7127.c:379:19-25: opportunity for str_on_off(enable) drivers/media/i2c/saa7127.c:346:49-55: opportunity for str_on_off(enable) drivers/media/i2c/saa7127.c:430:42-48: opportunity for str_on_off(enable) drivers/media/i2c/saa7127.c:405:42-48: opportunity for str_on_off(enable) Signed-off-by: Ricardo Ribalda --- drivers/media/i2c/saa7127.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/media/i2c/saa7127.c b/drivers/media/i2c/saa7127.c index 818ed19cf37b..1ea5e4b9019d 100644 --- a/drivers/media/i2c/saa7127.c +++ b/drivers/media/i2c/saa7127.c @@ -343,7 +343,8 @@ static int saa7127_set_vps(struct v4l2_subdev *sd, const struct v4l2_sliced_vbi_ if (enable && (data->field != 0 || data->line != 16)) return -EINVAL; if (state->vps_enable != enable) { - v4l2_dbg(1, debug, sd, "Turn VPS Signal %s\n", enable ? "on" : "off"); + v4l2_dbg(1, debug, sd, "Turn VPS Signal %s\n", + str_on_off(enable)); saa7127_write(sd, 0x54, enable << 7); state->vps_enable = enable; } @@ -376,7 +377,7 @@ static int saa7127_set_cc(struct v4l2_subdev *sd, const struct v4l2_sliced_vbi_d return -EINVAL; if (state->cc_enable != enable) { v4l2_dbg(1, debug, sd, - "Turn CC %s\n", enable ? "on" : "off"); + "Turn CC %s\n", str_on_off(enable)); saa7127_write(sd, SAA7127_REG_CLOSED_CAPTION, (state->xds_enable << 7) | (enable << 6) | 0x11); state->cc_enable = enable; @@ -402,7 +403,7 @@ static int saa7127_set_xds(struct v4l2_subdev *sd, const struct v4l2_sliced_vbi_ if (enable && (data->field != 1 || data->line != 21)) return -EINVAL; if (state->xds_enable != enable) { - v4l2_dbg(1, debug, sd, "Turn XDS %s\n", enable ? "on" : "off"); + v4l2_dbg(1, debug, sd, "Turn XDS %s\n", str_on_off(enable)); saa7127_write(sd, SAA7127_REG_CLOSED_CAPTION, (enable << 7) | (state->cc_enable << 6) | 0x11); state->xds_enable = enable; @@ -427,7 +428,7 @@ static int saa7127_set_wss(struct v4l2_subdev *sd, const struct v4l2_sliced_vbi_ if (enable && (data->field != 0 || data->line != 23)) return -EINVAL; if (state->wss_enable != enable) { - v4l2_dbg(1, debug, sd, "Turn WSS %s\n", enable ? "on" : "off"); + v4l2_dbg(1, debug, sd, "Turn WSS %s\n", str_on_off(enable)); saa7127_write(sd, 0x27, enable << 7); state->wss_enable = enable; } @@ -674,8 +675,10 @@ static int saa7127_log_status(struct v4l2_subdev *sd) output_strs[state->output_type] : "disabled"); v4l2_info(sd, "WSS: %s\n", state->wss_enable ? wss_strs[state->wss_mode] : "disabled"); - v4l2_info(sd, "VPS: %s\n", state->vps_enable ? "enabled" : "disabled"); - v4l2_info(sd, "CC: %s\n", state->cc_enable ? "enabled" : "disabled"); + v4l2_info(sd, "VPS: %s\n", + str_enabled_disabled(state->vps_enable)); + v4l2_info(sd, "CC: %s\n", + str_enabled_disabled(state->cc_enable)); return 0; } From patchwork Mon Sep 30 12:04:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816314 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 3FA72CF64B1 for ; Mon, 30 Sep 2024 13:00:06 +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=dipHc0aYdmEBdS77HCaW8bxKOJhKMvnfR/ECPy5ogKA=; b=lgAFKMCCcJFQQ1KX88D8tBQh8a R2hRX61ho5Idh+/AuKuHZMOLOCszgbfJgsN5dunSOp1aK8GYvtoygJMZrIVjfzdYx9n48TDf4yW2s sS4RbS4E0GmEozBGre2tz3h+2pFcP6IHnPew8NKHMzsiYesagUiQYdcpLQ1wytGQOz5UuPe/yZ7WI TMqfugjcHbbs0o39e3xvzIj2IXLXZndge9+Jw3o/vr9B0CBhBV/ln4ADfqjU2KS4N+1Z+IjAMc5WB vcJKLPHeIMVXSD3nUqk2A9kejEtgUM1KF0j/X1rajwH9FawnwuEZlOk5/MaQZtTPwGHFK73oOvjYZ 0JJ013lw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svG0J-0000000HBQ8-3xQk; Mon, 30 Sep 2024 12:59:55 +0000 Received: from mail-oo1-xc31.google.com ([2607:f8b0:4864:20::c31]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svF9Y-0000000GwjD-1YL6 for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 12:05:25 +0000 Received: by mail-oo1-xc31.google.com with SMTP id 006d021491bc7-5e5568f1baaso2414688eaf.2 for ; Mon, 30 Sep 2024 05:05:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697923; x=1728302723; 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=dipHc0aYdmEBdS77HCaW8bxKOJhKMvnfR/ECPy5ogKA=; b=KGmOYCezW7kAZMYC0tscxsI+WjFox60Zxghvjhwkn7yL0el3Dfir3i7eHP18uHEHXn +xIKLh8q8Oa8qaw5no8BEzc5k4VMWTQMV8bBg4OBNSlvf0c2MUDdM2hbA7K19rE8aQBu 0KnoXMf5LNYjhpzBM3GXSeIYjD608ldSaX3WM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697923; x=1728302723; 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=dipHc0aYdmEBdS77HCaW8bxKOJhKMvnfR/ECPy5ogKA=; b=Ebv8xjP7bzldUl4J42Z6jbGlw2HIAYiMr3LollfHXrHE9KoHxaI1uBYQ0oEQ8a1T0Q Y5pjVxj5TZO5kUVwtr2+LKoWm4Ejq4rhSd6mSXru4ExId4Slw4vXRgTZlQr9B172l8vQ SeLum3Wak/XRs+nsEYvnK+Luos7nP+Vsi/rFPKX9zFox9vd4ojFUaZxW5IbN1w/Mb7lA 0NDYtP8P1idWtr3g/ZEc5o8WJHSUI3EL73qVSV0fdRMHEQcka+d2btB8Mo3YdH4lIfjq USnZhchOQnO02hWiNbb5RXGqHkLZgcHEYsH7EaBICaS0+XxdCNFIkbg4OoIVBEvzSQci NZ+w== X-Forwarded-Encrypted: i=1; AJvYcCW0y9tg2WYqEVhfoDvZqrilJgtt/Ik6vG1HjQGc6ur5zlpNQw23beYqgDR/BN2WF/vSPdhvk6kLpfgAxld0sEOa@lists.infradead.org X-Gm-Message-State: AOJu0YxOGDxw63E3YSX5roGx024m6MQd6RK6WBxD2+Z+HiD6HQfNut3K 7JqdrplQOMooCi6wsSo9aYOe6xZ3sP30IpFkfGzJ/9LY+P/fWMHuD9I1Lqm1ag== X-Google-Smtp-Source: AGHT+IFoOt4rzgvhDCZteDnFFmUKzF/AVrjX9ESZ9nyOoTWl+oHTKxHAU5l+hHb9VoTek5XVl6j96w== X-Received: by 2002:a05:6358:784:b0:1b1:ac7f:51d5 with SMTP id e5c5f4694b2df-1becbd0145emr538282555d.22.1727697923522; Mon, 30 Sep 2024 05:05:23 -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.05.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:05:23 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:36 +0000 Subject: [PATCH 41/45] media: i2c: saa7115: Use string_choices helpers MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-41-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_050524_463187_91876965 X-CRM114-Status: GOOD ( 12.97 ) 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 warning is fixed: drivers/media/i2c/saa7115.c:1366:3-9: opportunity for str_enable_disable(enable) Signed-off-by: Ricardo Ribalda --- drivers/media/i2c/saa7115.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/saa7115.c b/drivers/media/i2c/saa7115.c index a1c71187e773..ff0931cf5ecf 100644 --- a/drivers/media/i2c/saa7115.c +++ b/drivers/media/i2c/saa7115.c @@ -1363,7 +1363,7 @@ static int saa711x_s_stream(struct v4l2_subdev *sd, int enable) struct saa711x_state *state = to_state(sd); v4l2_dbg(1, debug, sd, "%s output\n", - enable ? "enable" : "disable"); + str_enable_disable(enable)); if (state->enable == enable) return 0; From patchwork Mon Sep 30 12:04:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816315 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 C0F85CF64B6 for ; Mon, 30 Sep 2024 13:01:20 +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=azNmlM3B7hyMNMP40kUqke3tzTp1ln1Edxwu7YerKBg=; b=ASCGM01qw8VBzCfwYabzoAxLpz wtYiuSN9XM+I6RTpl74l+wN4yalJAjyN4W223RrggjmIuqCDsi8jHN8Evzw4wAos5uN/dDSllV/J/ t9cwwCgtk9/bQiT7wl/jH/kqqgO45C0p8Ccfa3WYXl6TvRrkFT5Z7Aootvuqkc7bkpAUHQYMIE0+6 erKpo+Mv4/6Nc+EnqbOrjR3fK9wfnP8T4v1LGchllnlRCi4s+qgMYoX8+d73ckhVeL54moSNC7A2H Zdmv7xNUh5jqMXk+C97erNEK71661SD8zkceWHprTkGIbS8T8C2TsvR4YzayiaNWmeT3d1paYDctw rV2rx9SA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svG1V-0000000HBkC-3D14; Mon, 30 Sep 2024 13:01:09 +0000 Received: from mail-qv1-xf32.google.com ([2607:f8b0:4864:20::f32]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svF9a-0000000GwkE-0mH8 for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 12:05:28 +0000 Received: by mail-qv1-xf32.google.com with SMTP id 6a1803df08f44-6cb3ba0a9a2so24005686d6.2 for ; Mon, 30 Sep 2024 05:05:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697925; x=1728302725; 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=azNmlM3B7hyMNMP40kUqke3tzTp1ln1Edxwu7YerKBg=; b=BjgjI543S1qNba2O6hCHXW87cbC7+dse70izJJjuCYB9Sys0Lsiq5NYRmzFTgRMs1A 1ituRO4HYnRNNlDU70sKISPRFiaGixBqk4oixBqM0C7GKkcVWWx0m/5KS2SK4CQ1O40+ gbT7qXYlQlbN7PkQN6GxstPa7g/fCzzuFQfIE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697925; x=1728302725; 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=azNmlM3B7hyMNMP40kUqke3tzTp1ln1Edxwu7YerKBg=; b=D/GPOE1ixvqoEYHN/TpO38JBIoA87QYt9AEoIcZS1xpR+trCGa1zvnhN6eMsDKUYAH FrtdVCtX768hbcPcR8h9ytaXly0eMt2oXvJG45pVT+xK2YUYRr59tt/WAHMCx0qaizPX wBo840cvPw8do1cLkGNCjljiUSPw8KSLlH/ypfib9E7CJGaOzOWmpZpFJVg2wFNXy0ii 0RCas2FthkU/h/UlsRbSK5n7edDXCB0913egN7mpzFc6+3iK+5lKlsUf01NkMeNXYbdu pFtI+XV1F1B3Akbyc/aw6qQYQgiMHsjw/VHEAZTZSQyVLT1OXEJthfxq5GUOdvLVnAXn P4kA== X-Forwarded-Encrypted: i=1; AJvYcCUGPNJZLfG0H5wPORxRShchwjV9RcnwGGwkmiisBfbOJ0xrbNEpnrxWmhZwD+zMv5JEPVwtTV+7aeCkjNdULPgW@lists.infradead.org X-Gm-Message-State: AOJu0Yy3zsylu9DGue5VlOqCbfiCxA9sriufPSWxbrbGHpxHuqeyEI9l KOm63PHesMU5dYkD3dI0wlHOY8xb/Ddyl8aQr/4aIlFlvc2NGvHj1uC57dsUPA== X-Google-Smtp-Source: AGHT+IH+OoBvU1VpQTPHiaktqSzIksNgZvG/jG37uysXmmuE+j75SqTMgbPUwFz7aDU3AoUz/9R6MA== X-Received: by 2002:a05:6214:450a:b0:6c5:60a1:d99d with SMTP id 6a1803df08f44-6cb3b64c714mr169599236d6.47.1727697925305; Mon, 30 Sep 2024 05:05: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.05.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:05:24 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:37 +0000 Subject: [PATCH 42/45] media: i2c: saa7110: Use string_choices helpers MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-42-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_050526_272280_4E97FD0B X-CRM114-Status: GOOD ( 12.84 ) 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 warning is fixed drivers/media/i2c/saa7110.c:313:37-43: opportunity for str_on_off(enable) Signed-off-by: Ricardo Ribalda --- drivers/media/i2c/saa7110.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/saa7110.c b/drivers/media/i2c/saa7110.c index 942aeeb40c52..15134ac706d7 100644 --- a/drivers/media/i2c/saa7110.c +++ b/drivers/media/i2c/saa7110.c @@ -310,7 +310,7 @@ static int saa7110_s_stream(struct v4l2_subdev *sd, int enable) if (decoder->enable != enable) { decoder->enable = enable; saa7110_write(sd, 0x0E, enable ? 0x18 : 0x80); - v4l2_dbg(1, debug, sd, "YUV %s\n", enable ? "on" : "off"); + v4l2_dbg(1, debug, sd, "YUV %s\n", str_on_off(enable)); } return 0; } From patchwork Mon Sep 30 12:04:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816316 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 2F3A8CF64B1 for ; Mon, 30 Sep 2024 13:03:51 +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=GL1+Q9/ULYlU3CLmPIk9AVOdXWpb/NtMEppJq3PJtYk=; b=NGDl+0HCsp5W+oIayxFkYwCCBc 29y9GrpY33K+V5pAwzQw4gNX39iIU14j/Lmwg6UXlxnlGpokblUo7V740hlwoFBjnRpDI1Rcmjgeq +oytKs1CrFH2x1eumwnZ+T6wG2w5wnA2Ts39V9lm2Dj47jjTFez+wYkSaUXFRK1x+N/0D5Hdd2nlp yjQwkh4IEnZwHkP1N4XZ2q9iI/lIfGrPT5E5dx5KdRawSIFGGU/A1iCoEXPGC1cZJxn329ihNWbPG m8FvXd6XgXx+v5lNz54Z4JrA1P9gkXUCn1kNmhfdH8t/wgT7wzO8iGRyBmaBhJHu7UNH35MqM8D+7 lWRoSHcA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svG3v-0000000HCAM-1PFz; Mon, 30 Sep 2024 13:03:39 +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 1svF9c-0000000Gwlb-0yMx for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 12:05:29 +0000 Received: by mail-qv1-xf2a.google.com with SMTP id 6a1803df08f44-6cb2f272f8bso40068746d6.0 for ; Mon, 30 Sep 2024 05:05:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697927; x=1728302727; 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=GL1+Q9/ULYlU3CLmPIk9AVOdXWpb/NtMEppJq3PJtYk=; b=hFOS0p+Y9Dt8r/WmhqmhTaTUksM1Te2OAsA7gZLDqSQQdHpRg8oIRfax3q1nfND+zE SVVrC9qHEdkKsCg9urysmvia+Sh6wHbLEeROG7LctUmm8vz9Yo8FfA9ejJNbzWalsRlq GuIVzLDMEuA1bE6ZBQ+ceSSwnTw/E0wZE9XoQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697927; x=1728302727; 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=GL1+Q9/ULYlU3CLmPIk9AVOdXWpb/NtMEppJq3PJtYk=; b=xLOm7FtDth4Ir7VHiNRtPFQRYYT+Jh4Y8Ucr/Mp8gz3jzvUaDmtc3rMGAAD7WzlTZN Socm9YDnY+bjoJhpbbFw2wQUI65trK8Hg2omlbzrBdNvz1jskBxPsIfS6mnhbowuWDBB G+ZMvwt0W1bIUIAuG8me267ljMa9ZCpd9VJGUc8mIRqbGXqK+9LRL/eQZ7gP0G0V9abD gN/IhAdT16H/Gs+g/nV5GalloEefLcFFzRlEcMqjay4jcTJF4rLju35fZ8xXiFyJ+Jn3 41HIizb+wxQsrc8TEsfeoBor+WGB3ZrADtACUm/b1ssItkzd5X7IkKScLrEhsi/E8B5Y 7fTg== X-Forwarded-Encrypted: i=1; AJvYcCUxtoX3T3JwVwZBn9KM8GW27lKjDgpBIOB/xYABy+RZVOlthbMVclNSBFeEQMPjl06cFZE8BoPqThYuvtsPmQUO@lists.infradead.org X-Gm-Message-State: AOJu0YzSz0oHjIyc2tCVpOCix3qXRxxZqD+RaK6iKgIX7/X/dSZUhzMc us53O3dB6kBDEh/V5S+sDsM2J/OMknmVlWPV0ciPEfCycT/SXTwDXvIJYmKU9w== X-Google-Smtp-Source: AGHT+IG/6are8ci6AYDSQshUu34zjFa2sn9Z7jhsZeKvJuNj89zUt3QMjrvn9kvAxF3Mp7T2iyMvYw== X-Received: by 2002:a05:6214:5587:b0:6cb:3c08:30a0 with SMTP id 6a1803df08f44-6cb3c0830c5mr167635306d6.49.1727697927150; Mon, 30 Sep 2024 05:05:27 -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.05.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:05:26 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:38 +0000 Subject: [PATCH 43/45] media: i2c: adv7842: Use string_choices helpers MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-43-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_050528_423895_BED275C4 X-CRM114-Status: GOOD ( 10.73 ) 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/i2c/adv7842.c:2761:5-29: opportunity for str_true_false(io_read ( sd , 0x6f ) & 0x01) drivers/media/i2c/adv7842.c:2754:5-29: opportunity for str_true_false(io_read ( sd , 0x6f ) & 0x02) drivers/media/i2c/adv7842.c:2821:3-31: opportunity for str_true_false(( hdmi_read ( sd , 0x05 ) & 0x40 )) drivers/media/i2c/adv7842.c:2763:5-31: opportunity for str_true_false(( io_read ( sd , 0x6a ) & 0x01 )) drivers/media/i2c/adv7842.c:2756:5-31: opportunity for str_true_false(( io_read ( sd , 0x6a ) & 0x02 )) drivers/media/i2c/adv7842.c:2765:5-31: opportunity for str_true_false(( io_read ( sd , 0x6a ) & 0x10 )) drivers/media/i2c/adv7842.c:2758:5-31: opportunity for str_true_false(( io_read ( sd , 0x6a ) & 0x20 )) drivers/media/i2c/adv7842.c:2736:4-22: opportunity for str_enabled_disabled(reg_io_0x21 & 0x01) drivers/media/i2c/adv7842.c:2735:4-22: opportunity for str_enabled_disabled(reg_io_0x21 & 0x02) drivers/media/i2c/adv7842.c:2737:28-51: opportunity for str_enabled_disabled(state -> cec_enabled_adap) drivers/media/i2c/adv7842.c:2812:4-24: opportunity for str_enabled_disabled(( reg_io_0x02 & 0x08 )) drivers/media/i2c/adv7842.c:2679:3-30: opportunity for str_enabled_disabled(( sdp_read ( sd , 0x12 ) & 0x08 )) drivers/media/i2c/adv7842.c:2730:4-52: opportunity for str_enabled_disabled(( ( reg_rep_0x7d & 0x04 ) && ( reg_rep_0x77 & 0x04 ) )) drivers/media/i2c/adv7842.c:2732:4-52: opportunity for str_enabled_disabled(( ( reg_rep_0x7d & 0x08 ) && ( reg_rep_0x77 & 0x08 ) )) drivers/media/i2c/adv7842.c:2768:5-33: opportunity for str_on_off(! ! ( cp_read ( sd , 0xff ) & 0x10 )) drivers/media/i2c/adv7842.c:2843:3-31: opportunity for str_on_off(( hdmi_read ( sd , 0x04 ) & 0x40 )) drivers/media/i2c/adv7842.c:2654:2-29: opportunity for str_on_off(( sdp_read ( sd , 0x56 ) & 0x01 )) drivers/media/i2c/adv7842.c:2823:3-31: opportunity for str_yes_no(( hdmi_read ( sd , 0x04 ) & 0x20 )) Signed-off-by: Ricardo Ribalda --- drivers/media/i2c/adv7842.c | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/drivers/media/i2c/adv7842.c b/drivers/media/i2c/adv7842.c index 014fc913225c..a43479c3ff03 100644 --- a/drivers/media/i2c/adv7842.c +++ b/drivers/media/i2c/adv7842.c @@ -2651,7 +2651,7 @@ static int adv7842_sdp_log_status(struct v4l2_subdev *sd) io_read(sd, 0x01) & 0x0f, io_read(sd, 0x00) & 0x3f); v4l2_info(sd, "SDP: free run: %s\n", - (sdp_read(sd, 0x56) & 0x01) ? "on" : "off"); + str_on_off(sdp_read(sd, 0x56) & 0x01)); v4l2_info(sd, "SDP: %s\n", sdp_signal_detected ? "valid SD/PR signal detected" : "invalid/no signal"); if (sdp_signal_detected) { @@ -2676,7 +2676,7 @@ static int adv7842_sdp_log_status(struct v4l2_subdev *sd) v4l2_info(sd, "SDP: %s\n", (sdp_read(sd, 0x57) & 0x08) ? "Interlaced" : "Progressive"); v4l2_info(sd, "SDP: deinterlacer %s\n", - (sdp_read(sd, 0x12) & 0x08) ? "enabled" : "disabled"); + str_enabled_disabled(sdp_read(sd, 0x12) & 0x08)); v4l2_info(sd, "SDP: csc %s mode\n", (sdp_io_read(sd, 0xe0) & 0x40) ? "auto" : "manual"); } @@ -2727,15 +2727,13 @@ static int adv7842_cp_log_status(struct v4l2_subdev *sd) v4l2_info(sd, "HDMI/DVI-D port selected: %s\n", state->hdmi_port_a ? "A" : "B"); v4l2_info(sd, "EDID A %s, B %s\n", - ((reg_rep_0x7d & 0x04) && (reg_rep_0x77 & 0x04)) ? - "enabled" : "disabled", - ((reg_rep_0x7d & 0x08) && (reg_rep_0x77 & 0x08)) ? - "enabled" : "disabled"); + str_enabled_disabled((reg_rep_0x7d & 0x04) && (reg_rep_0x77 & 0x04)), + str_enabled_disabled((reg_rep_0x7d & 0x08) && (reg_rep_0x77 & 0x08))); v4l2_info(sd, "HPD A %s, B %s\n", - reg_io_0x21 & 0x02 ? "enabled" : "disabled", - reg_io_0x21 & 0x01 ? "enabled" : "disabled"); - v4l2_info(sd, "CEC: %s\n", state->cec_enabled_adap ? - "enabled" : "disabled"); + str_enabled_disabled(reg_io_0x21 & 0x02), + str_enabled_disabled(reg_io_0x21 & 0x01)); + v4l2_info(sd, "CEC: %s\n", + str_enabled_disabled(state->cec_enabled_adap)); if (state->cec_enabled_adap) { int i; @@ -2751,21 +2749,21 @@ static int adv7842_cp_log_status(struct v4l2_subdev *sd) v4l2_info(sd, "-----Signal status-----\n"); if (state->hdmi_port_a) { v4l2_info(sd, "Cable detected (+5V power): %s\n", - io_read(sd, 0x6f) & 0x02 ? "true" : "false"); + str_true_false(io_read(sd, 0x6f) & 0x02)); v4l2_info(sd, "TMDS signal detected: %s\n", - (io_read(sd, 0x6a) & 0x02) ? "true" : "false"); + str_true_false(io_read(sd, 0x6a) & 0x02)); v4l2_info(sd, "TMDS signal locked: %s\n", - (io_read(sd, 0x6a) & 0x20) ? "true" : "false"); + str_true_false(io_read(sd, 0x6a) & 0x20)); } else { v4l2_info(sd, "Cable detected (+5V power):%s\n", - io_read(sd, 0x6f) & 0x01 ? "true" : "false"); + str_true_false(io_read(sd, 0x6f) & 0x01)); v4l2_info(sd, "TMDS signal detected: %s\n", - (io_read(sd, 0x6a) & 0x01) ? "true" : "false"); + str_true_false(io_read(sd, 0x6a) & 0x01)); v4l2_info(sd, "TMDS signal locked: %s\n", - (io_read(sd, 0x6a) & 0x10) ? "true" : "false"); + str_true_false(io_read(sd, 0x6a) & 0x10)); } v4l2_info(sd, "CP free run: %s\n", - (!!(cp_read(sd, 0xff) & 0x10) ? "on" : "off")); + str_on_off(cp_read(sd, 0xff) & 0x10)); v4l2_info(sd, "Prim-mode = 0x%x, video std = 0x%x, v_freq = 0x%x\n", io_read(sd, 0x01) & 0x0f, io_read(sd, 0x00) & 0x3f, (io_read(sd, 0x01) & 0x70) >> 4); @@ -2809,7 +2807,7 @@ static int adv7842_cp_log_status(struct v4l2_subdev *sd) (reg_io_0x02 & 0x02) ? "RGB" : "YCbCr", (((reg_io_0x02 >> 2) & 0x01) ^ (reg_io_0x02 & 0x01)) ? "(16-235)" : "(0-255)", - (reg_io_0x02 & 0x08) ? "enabled" : "disabled"); + str_enabled_disabled(reg_io_0x02 & 0x08)); v4l2_info(sd, "Color space conversion: %s\n", csc_coeff_sel_rb[cp_read(sd, 0xf4) >> 4]); @@ -2818,9 +2816,9 @@ static int adv7842_cp_log_status(struct v4l2_subdev *sd) v4l2_info(sd, "-----%s status-----\n", is_hdmi(sd) ? "HDMI" : "DVI-D"); v4l2_info(sd, "HDCP encrypted content: %s\n", - (hdmi_read(sd, 0x05) & 0x40) ? "true" : "false"); + str_true_false(hdmi_read(sd, 0x05) & 0x40)); v4l2_info(sd, "HDCP keys read: %s%s\n", - (hdmi_read(sd, 0x04) & 0x20) ? "yes" : "no", + str_yes_no(hdmi_read(sd, 0x04) & 0x20), (hdmi_read(sd, 0x04) & 0x10) ? "ERROR" : ""); if (!is_hdmi(sd)) return 0; @@ -2840,7 +2838,7 @@ static int adv7842_cp_log_status(struct v4l2_subdev *sd) (hdmi_read(sd, 0x5e) << 8) + hdmi_read(sd, 0x5f)); v4l2_info(sd, "AV Mute: %s\n", - (hdmi_read(sd, 0x04) & 0x40) ? "on" : "off"); + str_on_off(hdmi_read(sd, 0x04) & 0x40)); v4l2_info(sd, "Deep color mode: %s\n", deep_color_mode_txt[hdmi_read(sd, 0x0b) >> 6]); From patchwork Mon Sep 30 12:04:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816320 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 DECB1CF64B1 for ; Mon, 30 Sep 2024 13:05:05 +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=NEpH3GW+zX127Rx2gWkJapzmZ8AtweIcRQ6dozRhT1Y=; b=izdMoDNqyqMyeLxr2qxdUg2k08 iOZMZTa9NANZgB8LFVLLJ+ey80jTQEb3H55ImRgBVI8HbgUYapoFl8FcZwmt3M/A6q4zQuc6McRbu TiDnQ2D96a/IvkzRUfahJMKTzwlCk0uJnAJ1kUnMSff9u+zrf3TcWY98/dA8FP7g9XsYkgwmIdgkB h2bLje8tAXXQP0hHXTN5oQHHW77zv6E11ftEQyQAUK2SnIOKqm5Kk0VTSTwZ3Hfr8stBNuOYfstFK EqS6IXGJ5vaKkme/CKiysGhDzQkZYFFPxvzI1cpjM7zBgKsrw57ahWji2eqwFeyb054G2sJutkz8l mzi1w+Kg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svG55-0000000HCMA-3d0W; Mon, 30 Sep 2024 13:04:51 +0000 Received: from mail-qk1-x72d.google.com ([2607:f8b0:4864:20::72d]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svF9e-0000000Gwmv-0l8d for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 12:05:31 +0000 Received: by mail-qk1-x72d.google.com with SMTP id af79cd13be357-7a9af813f6cso405675285a.3 for ; Mon, 30 Sep 2024 05:05:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697929; x=1728302729; 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=NEpH3GW+zX127Rx2gWkJapzmZ8AtweIcRQ6dozRhT1Y=; b=YI7Fn0TD+5qIoF26eIECTpua56VcOM5WzE5A0HQKU5hU/jPXxysntYx2yQWX55Cb4z HzrwY1T01XYEhlK0Ylj1kWjtrKmEqmicCFNvBnwq3TI9RYBVQFWHbYR1sCDXk6qzPknt pg9HNsZ7E1774kyxEgziNbAHmGazBMT3q9UUs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697929; x=1728302729; 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=NEpH3GW+zX127Rx2gWkJapzmZ8AtweIcRQ6dozRhT1Y=; b=kGGWBy+7lJoLKczcakXjVAmT+O5PM6l2qr1F67sJtMM+IZuQ/A+yTFyJ7AN06ULCAf WVTKCNvwsdCTM7VZ2KCtkIT8+ixSYP35yk746P2bBQxoupJ9Ayf3Zyba4d2L0qJ3sIVB xNk4klqFYoN+x/JrLgBDdba4WqYxqD7fHGc/SwVaip61zJw9Dijtq3NnG0X7wvfpcEMV pKX7kf1nv1q7WEGm976v/RH8rU/eR0ivd+360qDXosmT8k9ZUhL0bL/zCv+AGgwnk73+ 98tEO5oDzn+bwhEOWOS8xUV63MUUJoHNxnVZpzKphkQNXt/c9e3/BJTob6BL95aucgca SFMQ== X-Forwarded-Encrypted: i=1; AJvYcCVKFTi7uD4lARP04Y+T/RVuawM1NFjHEEAxgTLL/oLg3QZUDWuUok6IOAY8YchPfsIA/dE+8noUOhDmyL7hMMXh@lists.infradead.org X-Gm-Message-State: AOJu0YxSrWvDBAelnkpNcqs8vXZXWrwBxjhwr8vEZfceRvEOBH0NH5R4 rPKO8OiE239cGjhzkzI279UZSsRBI22gaHW9DOnllW3kOV1AS+GhtrN2WRGi0Q== X-Google-Smtp-Source: AGHT+IFPaIZM1NSUWS2N20Z229u6ehVGSu/pXbG6WOauy86M5vVJLdj9bB3eMmf2b81ROre6rRHWmQ== X-Received: by 2002:a05:6214:3207:b0:6c5:7446:4fdf with SMTP id 6a1803df08f44-6cb3b5e283dmr198571366d6.24.1727697929145; Mon, 30 Sep 2024 05:05:29 -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.05.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:05:28 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:39 +0000 Subject: [PATCH 44/45] media: i2c: adv76xx: Use string_choices helpers MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-44-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_050530_267274_C17D61DE X-CRM114-Status: GOOD ( 10.87 ) 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/i2c/adv7604.c:2641:3-31: opportunity for str_true_false(( hdmi_read ( sd , 0x05 ) & 0x40 )) drivers/media/i2c/adv7604.c:2595:34-48: opportunity for str_false_true(no_lock_cp ( sd )) drivers/media/i2c/adv7604.c:2593:36-52: opportunity for str_false_true(no_lock_sspd ( sd )) drivers/media/i2c/adv7604.c:2594:36-52: opportunity for str_false_true(no_lock_stdi ( sd )) drivers/media/i2c/adv7604.c:2592:3-19: opportunity for str_false_true(no_lock_tmds ( sd )) drivers/media/i2c/adv7604.c:2590:3-21: opportunity for str_false_true(no_signal_tmds ( sd )) drivers/media/i2c/adv7604.c:2568:28-51: opportunity for str_enabled_disabled(state -> cec_enabled_adap) drivers/media/i2c/adv7604.c:2630:3-23: opportunity for str_enabled_disabled(( reg_io_0x02 & 0x08 )) drivers/media/i2c/adv7604.c:2597:3-20: opportunity for str_on_off(( in_free_run ( sd ) )) drivers/media/i2c/adv7604.c:2664:33-61: opportunity for str_on_off(( hdmi_read ( sd , 0x04 ) & 0x40 )) drivers/media/i2c/adv7604.c:2643:3-31: opportunity for str_yes_no(( hdmi_read ( sd , 0x04 ) & 0x20 )) Signed-off-by: Ricardo Ribalda --- drivers/media/i2c/adv7604.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c index 48230d5109f0..fb74f2947413 100644 --- a/drivers/media/i2c/adv7604.c +++ b/drivers/media/i2c/adv7604.c @@ -2565,8 +2565,8 @@ static int adv76xx_log_status(struct v4l2_subdev *sd) ((edid_enabled & 0x02) ? "Yes" : "No"), ((edid_enabled & 0x04) ? "Yes" : "No"), ((edid_enabled & 0x08) ? "Yes" : "No")); - v4l2_info(sd, "CEC: %s\n", state->cec_enabled_adap ? - "enabled" : "disabled"); + v4l2_info(sd, "CEC: %s\n", + str_enabled_disabled(state->cec_enabled_adap)); if (state->cec_enabled_adap) { int i; @@ -2587,14 +2587,14 @@ static int adv76xx_log_status(struct v4l2_subdev *sd) ((cable_det & 0x04) ? "Yes" : "No"), ((cable_det & 0x08) ? "Yes" : "No")); v4l2_info(sd, "TMDS signal detected: %s\n", - no_signal_tmds(sd) ? "false" : "true"); + str_false_true(no_signal_tmds(sd))); v4l2_info(sd, "TMDS signal locked: %s\n", - no_lock_tmds(sd) ? "false" : "true"); - v4l2_info(sd, "SSPD locked: %s\n", no_lock_sspd(sd) ? "false" : "true"); - v4l2_info(sd, "STDI locked: %s\n", no_lock_stdi(sd) ? "false" : "true"); - v4l2_info(sd, "CP locked: %s\n", no_lock_cp(sd) ? "false" : "true"); + str_false_true(no_lock_tmds(sd))); + v4l2_info(sd, "SSPD locked: %s\n", str_false_true(no_lock_sspd(sd))); + v4l2_info(sd, "STDI locked: %s\n", str_false_true(no_lock_stdi(sd))); + v4l2_info(sd, "CP locked: %s\n", str_false_true(no_lock_cp(sd))); v4l2_info(sd, "CP free run: %s\n", - (in_free_run(sd)) ? "on" : "off"); + str_on_off(in_free_run(sd))); v4l2_info(sd, "Prim-mode = 0x%x, video std = 0x%x, v_freq = 0x%x\n", io_read(sd, 0x01) & 0x0f, io_read(sd, 0x00) & 0x3f, (io_read(sd, 0x01) & 0x70) >> 4); @@ -2627,7 +2627,7 @@ static int adv76xx_log_status(struct v4l2_subdev *sd) (reg_io_0x02 & 0x02) ? "RGB" : "YCbCr", (((reg_io_0x02 >> 2) & 0x01) ^ (reg_io_0x02 & 0x01)) ? "(16-235)" : "(0-255)", - (reg_io_0x02 & 0x08) ? "enabled" : "disabled"); + str_enabled_disabled(reg_io_0x02 & 0x08)); v4l2_info(sd, "Color space conversion: %s\n", csc_coeff_sel_rb[cp_read(sd, info->cp_csc) >> 4]); @@ -2638,9 +2638,9 @@ static int adv76xx_log_status(struct v4l2_subdev *sd) v4l2_info(sd, "Digital video port selected: %c\n", (hdmi_read(sd, 0x00) & 0x03) + 'A'); v4l2_info(sd, "HDCP encrypted content: %s\n", - (hdmi_read(sd, 0x05) & 0x40) ? "true" : "false"); + str_true_false(hdmi_read(sd, 0x05) & 0x40)); v4l2_info(sd, "HDCP keys read: %s%s\n", - (hdmi_read(sd, 0x04) & 0x20) ? "yes" : "no", + str_yes_no(hdmi_read(sd, 0x04) & 0x20), (hdmi_read(sd, 0x04) & 0x10) ? "ERROR" : ""); if (is_hdmi(sd)) { bool audio_pll_locked = hdmi_read(sd, 0x04) & 0x01; @@ -2661,7 +2661,8 @@ static int adv76xx_log_status(struct v4l2_subdev *sd) v4l2_info(sd, "Audio N: %u\n", ((hdmi_read(sd, 0x5d) & 0x0f) << 16) + (hdmi_read(sd, 0x5e) << 8) + hdmi_read(sd, 0x5f)); - v4l2_info(sd, "AV Mute: %s\n", (hdmi_read(sd, 0x04) & 0x40) ? "on" : "off"); + v4l2_info(sd, "AV Mute: %s\n", + str_on_off(hdmi_read(sd, 0x04) & 0x40)); v4l2_info(sd, "Deep color mode: %s\n", deep_color_mode_txt[(hdmi_read(sd, 0x0b) & 0x60) >> 5]); v4l2_info(sd, "HDMI colorspace: %s\n", hdmi_color_space_txt[hdmi_read(sd, 0x53) & 0xf]); From patchwork Mon Sep 30 12:04:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816321 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 9C8DACF64B6 for ; Mon, 30 Sep 2024 13:06:14 +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=y4CZBI+n6IjdrtDGuJsp4m8Z3nCdNkGXw0PtmNPGNzY=; b=Q1JWFTCzh8STViXDfSj0b1O+6L 1FMbeKkR3j3MRGPtr07e2spF4G1U9OA0YACpjLjHrtabGOGh5WUjoBrdty++VnyGGo3Qo0yHFiS1V I39/e68dgt9OAVyEeWgX0qxuiSv5EIWNGaSc09wBWxgg6G9HbTgPp/m2B74/vuCKVqxdyyyc/wlNf qBFAQkQqu4d/nVjMbDIxYDHdf+C08u0Xsf39cNeGzEw2XqEtBcJvFGzgzfcD9Wc8mwwdMULVWT/Cr 3YdIKLdXwQOf5nYjXkYS8QFb83g8Vgrr5whhju5SpfTK6gAAUvNsG7TmCc5ZRCF7QvtzT4DVJHDOv L+g4MIDw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svG6F-0000000HCVd-18wv; Mon, 30 Sep 2024 13:06:03 +0000 Received: from mail-ot1-x32a.google.com ([2607:f8b0:4864:20::32a]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svF9f-0000000Gwnp-3UcT for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 12:05:33 +0000 Received: by mail-ot1-x32a.google.com with SMTP id 46e09a7af769-71116d8504bso2652563a34.3 for ; Mon, 30 Sep 2024 05:05:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697931; x=1728302731; 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=y4CZBI+n6IjdrtDGuJsp4m8Z3nCdNkGXw0PtmNPGNzY=; b=of/etYXi4dAELbE+WQWA77l/dFgo+fjZnmPfxIaN/iPdl3tL7cHXiPesAa5x/VJOtb Up5RJTDOc0Z6IUVZSvbygoOJNLy08Ed4rk4vIFdZf/nmqf0FNmXjlUT8ejYM+nJ3jOhw rY2x4fcHfE1wp0OxnEEG+qZ4RdRJYHfliE4iM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697931; x=1728302731; 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=y4CZBI+n6IjdrtDGuJsp4m8Z3nCdNkGXw0PtmNPGNzY=; b=gi1cGmpWRV/QseAfQo4rCroysKxWuUH5r7xepbA+q9FrqUkVcQbRPpmtYiFHKs1mUm 1+J08HMS+HjwZWnk2lUyKRh0MO92oAI0qUFrIbPhkd5ydAXx8hVrVhBJPhIJ9zIwSJNf K+0cOjRzqz9PAiJPyVKCYFtycwZCFbr4wFO+KSl0QdimaR/AP57rOPBDvvm6+MqpFi51 XuUWzMV90hFoFPchhgFQeev+GMxpEL0P5tU+8k5vb830B4IAx8dYfYERcgz9VSjYJrjX T+Uyu18qdB1/TJnoI+L1EAUUQQtZ8u9nBCYKr47plwVDXacjdaUIwwMuTHw/c2F0MTsQ 4cRg== X-Forwarded-Encrypted: i=1; AJvYcCWpgk26R6cRgnM+RvJVGgpxsXCZBqUVdRH1azNtS/jWIJ5uzCfhs9moGxyd4i6Fr6ufg5hgF5RFber/byvmF9wb@lists.infradead.org X-Gm-Message-State: AOJu0YzCDgjFHBsMdSLz9CEOpU9G2Bb8Hh+AlGAkTHP0EwzWcfkt/2k3 P8BhntdikWvVuUO0JU46+e5669MSO6PY1uZF2rQhUFWcYCqwhKT1BKuIuNbYlQ== X-Google-Smtp-Source: AGHT+IF0K+EHYN7PignB/8NYu53YVj7j++O0mwk1W5RBN0+QHuQojpzGFveGrxjlPlRfoI1UafopSQ== X-Received: by 2002:a05:6358:2c8e:b0:1b5:c4f3:faec with SMTP id e5c5f4694b2df-1becbb585e8mr274204655d.4.1727697931042; Mon, 30 Sep 2024 05:05:31 -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.05.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:05:30 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:40 +0000 Subject: [PATCH 45/45] media: i2c: adv7511: Use string_choices helpers MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-45-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_050531_914662_68371748 X-CRM114-Status: GOOD ( 12.94 ) 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/i2c/adv7511-v4l2.c:873:46-52: opportunity for str_enable_disable(enable) drivers/media/i2c/adv7511-v4l2.c:620:28-51: opportunity for str_enabled_disabled(state -> cec_enabled_adap) drivers/media/i2c/adv7511-v4l2.c:642:52-54: opportunity for str_on_off(on) drivers/media/i2c/adv7511-v4l2.c:568:29-44: opportunity for str_on_off(state -> power_on) Signed-off-by: Ricardo Ribalda --- drivers/media/i2c/adv7511-v4l2.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/media/i2c/adv7511-v4l2.c b/drivers/media/i2c/adv7511-v4l2.c index e9406d552699..d9af81015e72 100644 --- a/drivers/media/i2c/adv7511-v4l2.c +++ b/drivers/media/i2c/adv7511-v4l2.c @@ -565,7 +565,7 @@ static int adv7511_log_status(struct v4l2_subdev *sd) "9", "A", "B", "C", "D", "E", "F" }; - v4l2_info(sd, "power %s\n", state->power_on ? "on" : "off"); + v4l2_info(sd, "power %s\n", str_on_off(state->power_on)); v4l2_info(sd, "%s hotplug, %s Rx Sense, %s EDID (%d block(s))\n", (adv7511_rd(sd, 0x42) & MASK_ADV7511_HPD_DETECT) ? "detected" : "no", (adv7511_rd(sd, 0x42) & MASK_ADV7511_MSEN_DETECT) ? "detected" : "no", @@ -617,8 +617,8 @@ static int adv7511_log_status(struct v4l2_subdev *sd) v4l2_info(sd, "i2c cec addr: 0x%x\n", state->i2c_cec_addr); - v4l2_info(sd, "CEC: %s\n", state->cec_enabled_adap ? - "enabled" : "disabled"); + v4l2_info(sd, "CEC: %s\n", + str_enabled_disabled(state->cec_enabled_adap)); if (state->cec_enabled_adap) { for (i = 0; i < ADV7511_MAX_ADDRS; i++) { bool is_valid = state->cec_valid_addrs & (1 << i); @@ -639,7 +639,7 @@ static int adv7511_s_power(struct v4l2_subdev *sd, int on) const int retries = 20; int i; - v4l2_dbg(1, debug, sd, "%s: power %s\n", __func__, on ? "on" : "off"); + v4l2_dbg(1, debug, sd, "%s: power %s\n", __func__, str_on_off(on)); state->power_on = on; @@ -870,7 +870,8 @@ static void adv7511_set_isr(struct v4l2_subdev *sd, bool enable) u8 irqs_rd; int retries = 100; - v4l2_dbg(2, debug, sd, "%s: %s\n", __func__, enable ? "enable" : "disable"); + v4l2_dbg(2, debug, sd, "%s: %s\n", __func__, + str_enable_disable(enable)); if (state->enabled_irq == enable) return;