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);