From mboxrd@z Thu Jan 1 00:00:00 1970 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 80975C4332F for ; Sat, 19 Nov 2022 11:04: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:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=uc9/tkQ+3HndP2YzyWspmJPgkL2zNiC0TfWlnDF36EE=; b=Y39eRWERULlbejRsqcPsfGRmpU olLaE1l2bbGyZPvr8l+6N5bk5lAX2YLg3Vk9r6J1H3dnnxScx2V+Xfjeofow3dUzBt26yW7D5BOVg rsG1fMYWAP0kmxb7vWC9hEaFXnY35Aan4UPjGIpTbpz/ffsnyiDlsT9NOFT4O9oIhHOEAo0aiEKnC 73G7drKhIs8JpGAaVr09kE1SJq8JTt3nrQW307E4sI2EzJWf6t07DT6oLVqgfhRfO1zSR88h5atQQ jyTEhNMoPlJhbKLMhzWrtDlCFuFvrxMq6xxPYsrE68AUOcPbAt7qKd6aAsKorvXF0fid+vycR8b5B yyiKGcOg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1owLdG-00DDDE-4y; Sat, 19 Nov 2022 11:03:34 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1owLdB-00DDAW-Q8; Sat, 19 Nov 2022 11:03:31 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id C7C3C5C004E; Sat, 19 Nov 2022 06:03:28 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Sat, 19 Nov 2022 06:03:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= cc:cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1668855808; x=1668942208; bh=93HYdnB82U fc0zGbkKCa09oD/bVcHkhM7pWrtDnGP1E=; b=LNgHGobtvH87z8OzQzsw3NUFs8 ZKD9DQ2e0x7bS5UlrFvTz37OrvmY9nfYYKPW92rtx4e/eipP8EsuDw+VN2uXHMLL V1A+7+PYEKHr/HPu4dT3sfvo6NtYSDgpYr/advbExSywAKrI+s8g/Ila20hS2ZzE 1ZBnOTcp9P6TvZrbLpbFP+gjV7pVVIJZpCMxN2D5zsTbJLR9r5Lq5Yu4+I1k+Ihx merwCp4yKbXNFvyvFBYGn4Qa1zcNqscitznhyFo7KAfXxoF9aH+ol2DSSA42/IsK NiyHYdp0pIFcqW+EMu01ffWR/a4j5SKNr+ky24UFGLOUkjCYq3zvmrtxuCwQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1668855808; x=1668942208; bh=93HYdnB82Ufc0zGbkKCa09oD/bVc HkhM7pWrtDnGP1E=; b=wZTZOsXUtSDYR3lU0RoAXXBqTOjrXnD26dC7RnPZyokP Uy4HMu+KzXEA6SuiJPG5l6GIJRCqoSI811bOR4h//gYr+cSvHi6yqcNp/jucyDlr +ZKLxa1kZFvX3WdOVhGLcIXtt5GdxPkypugf0hQvu18Rdlj2K+DskLI5wsv/xaUe VImkluF1eEGooypqa61p56j6XLQQDakIzFx31yV+sRcDGDa2Wx++T/23ZQXb2BoP INIIxZZpyZxoc8PEtf7Ko4U06N+QjKMkprSYIxxdMETsjVULPa2OTsEFlUeT9VUK Y2X5XEaSlQHqv+qZX1GwG9I+N9jR6WeFpOZ7JRILkQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrhedvgddvfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfhfgggtuggjsehttdertddttdejnecuhfhrohhmpeffrghfnhgr ucfjihhrshgthhhfvghlugcuoegurghfnhgrsehfrghsthhmrghilhdrtghomheqnecugg ftrfgrthhtvghrnhepvdehtdeludekgeevleefuedvudejieetheekvdfhteekffdujefh fedtudehvdeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepuggrfhhnrgesfhgrshhtmhgrihhlrdgtohhm X-ME-Proxy: Feedback-ID: i0e894699:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 19 Nov 2022 06:03:25 -0500 (EST) Date: Sat, 19 Nov 2022 13:03:22 +0200 From: Dafna Hirschfeld To: Paul Elder Cc: linux-media@vger.kernel.org, Laurent Pinchart , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Heiko Stuebner , Helen Koike , linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Kieran Bingham Subject: Re: [PATCH v3 03/14] media: rkisp1: Add and use rkisp1_has_feature() macro Message-ID: <20221119110322.4drj7qqtp46vjcnn@guri> References: <20221118093931.1284465-1-paul.elder@ideasonboard.com> <20221118093931.1284465-4-paul.elder@ideasonboard.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20221118093931.1284465-4-paul.elder@ideasonboard.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221119_030330_012602_F8CA9C21 X-CRM114-Status: GOOD ( 13.27 ) 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: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 18.11.2022 18:39, Paul Elder wrote: >From: Laurent Pinchart > >Simplify feature tests with a macro that shortens lines. > >Signed-off-by: Laurent Pinchart >Reviewed-by: Paul Elder >Reviewed-by: Kieran Bingham >--- > .../media/platform/rockchip/rkisp1/rkisp1-common.h | 3 +++ > .../media/platform/rockchip/rkisp1/rkisp1-dev.c | 14 +++++++------- > 2 files changed, 10 insertions(+), 7 deletions(-) > >diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-common.h b/drivers/media/platform/rockchip/rkisp1/rkisp1-common.h >index a1293c45aae1..fc33c185b99f 100644 >--- a/drivers/media/platform/rockchip/rkisp1/rkisp1-common.h >+++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-common.h >@@ -111,6 +111,9 @@ enum rkisp1_feature { > RKISP1_FEATURE_MIPI_CSI2 = BIT(0), > }; > >+#define rkisp1_has_feature(rkisp1, feature) \ >+ ((rkisp1)->info->features & RKISP1_FEATURE_##feature) maybe instead of that string concatination you can remove the 'RKISP1_FEATURE' prefix from the enum thanks, Dafna >+ > /* > * struct rkisp1_info - Model-specific ISP Information > * >diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c >index f2475c6235ea..e348d8c86861 100644 >--- a/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c >+++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c >@@ -206,7 +206,7 @@ static int rkisp1_subdev_notifier_register(struct rkisp1_device *rkisp1) > switch (reg) { > case 0: > /* MIPI CSI-2 port */ >- if (!(rkisp1->info->features & RKISP1_FEATURE_MIPI_CSI2)) { >+ if (!rkisp1_has_feature(rkisp1, MIPI_CSI2)) { > dev_err(rkisp1->dev, > "internal CSI must be available for port 0\n"); > ret = -EINVAL; >@@ -338,7 +338,7 @@ static int rkisp1_create_links(struct rkisp1_device *rkisp1) > unsigned int i; > int ret; > >- if (rkisp1->info->features & RKISP1_FEATURE_MIPI_CSI2) { >+ if (rkisp1_has_feature(rkisp1, MIPI_CSI2)) { > /* Link the CSI receiver to the ISP. */ > ret = media_create_pad_link(&rkisp1->csi.sd.entity, > RKISP1_CSI_PAD_SRC, >@@ -390,7 +390,7 @@ static int rkisp1_create_links(struct rkisp1_device *rkisp1) > > static void rkisp1_entities_unregister(struct rkisp1_device *rkisp1) > { >- if (rkisp1->info->features & RKISP1_FEATURE_MIPI_CSI2) >+ if (rkisp1_has_feature(rkisp1, MIPI_CSI2)) > rkisp1_csi_unregister(rkisp1); > rkisp1_params_unregister(rkisp1); > rkisp1_stats_unregister(rkisp1); >@@ -423,7 +423,7 @@ static int rkisp1_entities_register(struct rkisp1_device *rkisp1) > if (ret) > goto error; > >- if (rkisp1->info->features & RKISP1_FEATURE_MIPI_CSI2) { >+ if (rkisp1_has_feature(rkisp1, MIPI_CSI2)) { > ret = rkisp1_csi_register(rkisp1); > if (ret) > goto error; >@@ -590,7 +590,7 @@ static int rkisp1_probe(struct platform_device *pdev) > goto err_unreg_v4l2_dev; > } > >- if (rkisp1->info->features & RKISP1_FEATURE_MIPI_CSI2) { >+ if (rkisp1_has_feature(rkisp1, MIPI_CSI2)) { > ret = rkisp1_csi_init(rkisp1); > if (ret) > goto err_unreg_media_dev; >@@ -611,7 +611,7 @@ static int rkisp1_probe(struct platform_device *pdev) > err_unreg_entities: > rkisp1_entities_unregister(rkisp1); > err_cleanup_csi: >- if (rkisp1->info->features & RKISP1_FEATURE_MIPI_CSI2) >+ if (rkisp1_has_feature(rkisp1, MIPI_CSI2)) > rkisp1_csi_cleanup(rkisp1); > err_unreg_media_dev: > media_device_unregister(&rkisp1->media_dev); >@@ -630,7 +630,7 @@ static int rkisp1_remove(struct platform_device *pdev) > v4l2_async_nf_cleanup(&rkisp1->notifier); > > rkisp1_entities_unregister(rkisp1); >- if (rkisp1->info->features & RKISP1_FEATURE_MIPI_CSI2) >+ if (rkisp1_has_feature(rkisp1, MIPI_CSI2)) > rkisp1_csi_cleanup(rkisp1); > rkisp1_debug_cleanup(rkisp1); > >-- >2.35.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel