From patchwork Sun Dec 24 11:49:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 183038 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp2093667dyi; Sun, 24 Dec 2023 03:50:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IF2Z7lrba1WvQb4LJHAyrSAup3XFGNSNHe3N5KMorqw8wKimzgfy6KZVLKPveHyUIt6rxYh X-Received: by 2002:a05:620a:12c1:b0:77e:fba3:4eff with SMTP id e1-20020a05620a12c100b0077efba34effmr4910597qkl.85.1703418606417; Sun, 24 Dec 2023 03:50:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703418606; cv=none; d=google.com; s=arc-20160816; b=HGe9SEu5XYM3lSNiQi4zAWYerc7TleelivIux/sSLgCqftV+kQNLR7ZduuhoRPq6aX P1pG+PQOSKhyKSI3i/OJXfLRQ0LmKtQnGAq2JI20js39le5mQ6lesQs4FrYDJSFgZiuU tATYXdIWUhncxz/HXz2OXJplk9oBSzPImu7weibftwZ3iiLpqRfYH1PYldqNRwDpNwDC 07rQi1pIdwXbj073mVSiipoHGhHRlr+SFWkufo9zSqlJkt/Mij1MfNGa1cg86j+PXiSw ++61ycMUyFCrxdjhUViuMTozMCNVg3QHhXlPT4GzCDqS6914EYrbRFN2S2nbQF02zD0Z ecWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:to:from :dkim-signature; bh=mzCr6s+sUXGJX1TCqlhYC9rStKOi8VqlAp3Rk3HIOR0=; fh=FbjPzT9WWTKSglYskE+giKKmjX6PgCMhn86yvylggxU=; b=FO1ByLSrgHxofZfCGL8CHCFu9HpU9qav8WWblCx8XprdklnSyVlVOmo+qnvVYji9Bc qQSws2gXVlbDMg1mbZxDzSTYy6F6QMlaICuJREX/xg3D0s3SJtnqUwzmTqR+Mxt6HYQy NdQb/2YmhR5AJRSDWcYlLN9Ybgc8EHqSmTLXWKcCXX3CNbtAJApyrAN9WelaXT83+Lwq 8oslV/Tl41NtY4iI74JqRy/gUB44P7mN6YH8IAToBYAoj7e6t70qiiyR9nBx+fconLeX L0VSNT6qkUe7uJq0/A23hghQw7Mrz0qHOheGD6KEGsDlQpeBN8o2PkBknOykWfBhWtDV s60w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aYixHiYJ; spf=pass (google.com: domain of linux-kernel+bounces-10693-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10693-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id bn5-20020a05620a2ac500b007810add037csi8429518qkb.494.2023.12.24.03.50.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 03:50:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10693-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aYixHiYJ; spf=pass (google.com: domain of linux-kernel+bounces-10693-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10693-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 39A361C20C1C for ; Sun, 24 Dec 2023 11:50:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 851AB846C; Sun, 24 Dec 2023 11:49:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="aYixHiYJ" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3290A23C8 for ; Sun, 24 Dec 2023 11:49:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-a2340c803c6so364098066b.0 for ; Sun, 24 Dec 2023 03:49:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703418560; x=1704023360; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=mzCr6s+sUXGJX1TCqlhYC9rStKOi8VqlAp3Rk3HIOR0=; b=aYixHiYJQ4MJKLPry86OaWhN8UifopydlOUmHLtWUrO7gEt0qfhNaOZaGhTqRxtyd4 jhEg9fdcEx57VGMg6YGMpO0tJEseNgjA9jCKXc5B8V9zPIfEthIdN3yY5oAeeww/8sTJ 011JU3WB2V00wWCevTQeqIt11D5/SntmO4dqB5u8ZIhZhEUnNH1g//LAohD3nhWRuCF8 AfcKM7p/Z+/+p/p3oQaAin6XB26xf7YPuSpc/Sj8Lz7Ef13n10naOZXyT5g8JL3RCSac ne0DhpFYEtQlUR9NDPg6u44NG+Qi2Ui6beg7jfOQ/oOG4COURdO6kquTF/74TxQTnGOt 5JIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703418560; x=1704023360; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=mzCr6s+sUXGJX1TCqlhYC9rStKOi8VqlAp3Rk3HIOR0=; b=aJXyc6QwyJl2WN/prqfJkU+bHt93a/2TYwYb17U+xg+McYdY5NYCHLrdGo0SrLvWVT n23989RuJyEAbYGYUkj5tQEbcDdSVcadKgTA5R4Ujt8oj9JMi/R8LJx8LGTYPcF+l4MH SQC491ZRDxHA7lZ+Y4jmFHHQHYAosPKpx+vFuCjGNuCq7QrHPFGD3k7TlTU/s7TFYEss AbO+l/faO4EKmgcsf/rSwVAaBf64hhE/cqy7UysUKXEggZF1UZ2yvsYOfXppRfTyopUv nmOubgVqOgpaUpUsQCRmT9WIVLqeLbNdrPevfLWLW2dMqoYXouLlPg/RVSk+jQ7Nrbeb 01ow== X-Gm-Message-State: AOJu0Yy0FchxzxjMXgagUP62CaBU9PbG6aAqLdk6Agz3YHdwtjcgZbIJ 0IabFtzAWNl/jrJXLvNXQbiu4lcD3cpzEg== X-Received: by 2002:a50:d49b:0:b0:552:85f4:ed39 with SMTP id s27-20020a50d49b000000b0055285f4ed39mr2643458edi.38.1703418559839; Sun, 24 Dec 2023 03:49:19 -0800 (PST) Received: from krzk-bin.. ([78.10.206.178]) by smtp.gmail.com with ESMTPSA id z23-20020aa7c657000000b0054ccac03945sm4999771edr.12.2023.12.24.03.49.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 03:49:19 -0800 (PST) From: Krzysztof Kozlowski To: Sylwester Nawrocki , Mauro Carvalho Chehab , Krzysztof Kozlowski , Alim Akhtar , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 01/12] media: fimc-lite: drop unused flite_hw_set_camera_polarity() Date: Sun, 24 Dec 2023 12:49:05 +0100 Message-Id: <20231224114916.111433-1-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786163868697128206 X-GMAIL-MSGID: 1786163868697128206 Function flite_hw_set_camera_polarity() is not defined, so drop its declaration from the header. Signed-off-by: Krzysztof Kozlowski --- drivers/media/platform/samsung/exynos4-is/fimc-lite-reg.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-lite-reg.h b/drivers/media/platform/samsung/exynos4-is/fimc-lite-reg.h index c5656e902750..3b8af3ce1838 100644 --- a/drivers/media/platform/samsung/exynos4-is/fimc-lite-reg.h +++ b/drivers/media/platform/samsung/exynos4-is/fimc-lite-reg.h @@ -134,8 +134,6 @@ void flite_hw_capture_start(struct fimc_lite *dev); void flite_hw_capture_stop(struct fimc_lite *dev); void flite_hw_set_camera_bus(struct fimc_lite *dev, struct fimc_source_info *s_info); -void flite_hw_set_camera_polarity(struct fimc_lite *dev, - struct fimc_source_info *cam); void flite_hw_set_window_offset(struct fimc_lite *dev, struct flite_frame *f); void flite_hw_set_source_format(struct fimc_lite *dev, struct flite_frame *f); From patchwork Sun Dec 24 11:49:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 183039 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp2093699dyi; Sun, 24 Dec 2023 03:50:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IFRtQQgBGsM1dTb3dwWi3uHEa3mOwdk3ihaX+B83ve52vPh7HuuC07f3WWanJbNtjqLJJXJ X-Received: by 2002:a05:6214:2527:b0:67f:2350:6d35 with SMTP id gg7-20020a056214252700b0067f23506d35mr6055138qvb.39.1703418612035; Sun, 24 Dec 2023 03:50:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703418612; cv=none; d=google.com; s=arc-20160816; b=jguSPdpiw3Q45/IvZRWfjUyWCOuR6L6/FuBxVYV6vJRebRTaO3LBmCSsYTzRrnbW9O Dsn6/ePXWEhMd0mce9Eoe8u0wq9p/RFdWiPDIe1pgS173WNYwzbgveYS/nZAELZBdXZB pEDNhOl81UFGM5Km5xlOfIX2eb+dzhckdVMZT3XYRaH6T3DmelXn1FLUmYcPgki9GYff AB8Ypzes9Tg/qTbHW4YBGGgxYivozANIL8OSKMZSaVKNqv9qMPTVL9kLbjuqK1fVnQgP CkzZcxsRM88m5Ao9Ol5sensI8UTDIRjbBqcSYm4x8XKpCIzDB+0Vv31uTEzMh8nevoZW teEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:to:from:dkim-signature; bh=k+AICZB/3i+9hmEPe7EXcGEewYuTAI7wt2ZhMt/aXAs=; fh=FbjPzT9WWTKSglYskE+giKKmjX6PgCMhn86yvylggxU=; b=YQGafksHgQjA2nDzjiFxvYKbZlvUA6gMJ4p105isIZHz2zAgo+xN/SLP/OqNnr8bB8 dBooQGLeWm4dbYZ2IoLRm1i3Q1TvpksEQBZ66Rj9bZwy/lQRGprAMq3jo7f/j1AD3pnR bOAicb/ZCYl+MePiDUUMzcULMFJ5J8DxMCc1bisP15BpYPSwhSnw62wP07j++bu9eXGx FrxuNmr4mVaUSoHfnQY8UJ1aA5om4bz3MR8XBeNmErqTHiGsWWRBHXNHV8jbeQAWQf1w QR05CyH+GbNO0GekhOaHGtBtVDmg+95MoS2YrexDV1EaBjtLBHgtPJPvyTT9bgkE/Bv/ X+mA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zUVpwJx5; spf=pass (google.com: domain of linux-kernel+bounces-10694-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10694-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id x7-20020a0ce0c7000000b0067eec442a00si8164922qvk.515.2023.12.24.03.50.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 03:50:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10694-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zUVpwJx5; spf=pass (google.com: domain of linux-kernel+bounces-10694-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10694-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id BF9BB1C20A93 for ; Sun, 24 Dec 2023 11:50:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C39CBCA69; Sun, 24 Dec 2023 11:49:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="zUVpwJx5" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5C30A23CD for ; Sun, 24 Dec 2023 11:49:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-5542a7f1f3cso3254607a12.2 for ; Sun, 24 Dec 2023 03:49:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703418561; x=1704023361; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=k+AICZB/3i+9hmEPe7EXcGEewYuTAI7wt2ZhMt/aXAs=; b=zUVpwJx5ORGRP5+0ffSCyEPq7qG4r609b3zERmixme+gomAcQ58PLomyGJCjEY5oyN NEtLBnUpBoT9mNPZYl+sD2Uhve3uXdFrobPa709DOdu76qbyKYmXw7vkFteQwo5olZ2A VlwSkgnTBooebXE/F+n+yng19KBdpT8cXH/m4R+sov+mluFGCRgI3chWl9es2pPA1Z5j b+PWC+PwnnftqYW7VnbsYDpwUPSk7/9BPRSIy7acUHiU4nuJlQTG0AWH759tiiI1BoMe IgYxs0i3w2cCeqcKIJKCoCf4osQo/NTBY9QYZp5FI7UD1feUfcW5oOTjOX4vguNQZk7q r7eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703418561; x=1704023361; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=k+AICZB/3i+9hmEPe7EXcGEewYuTAI7wt2ZhMt/aXAs=; b=mxLHFYo95YEzaqnRPdanYLhIZaGE4C3kjKNHLa2GJ6MYbb4CjPNTEJ+3f+fep3Yxjn piGzuuUXp888NwnAL4DGse3MJs4xyjZSTzXaFJXRZWVE3AuNeoOsXjg1P/CpyQMLKQiH xKPq9QfVDtAUnXe19Wxvu9gQD9se8RfXpVoxfmyRjzJXvhQheIEFSs39iD+WioQSJW03 k/ihBfCkmEN7kBqi39ovLmwDlTxSLfGWh4POZsJkih5ICfpJNHlN5eXBXjLmzA+377OQ rUBs/IdANfPsYlurofrZ8uE9+B8MNksTkyeXBvVgoeg/+GuAUDTf9+xP3+iSJDgSMWE8 FYGw== X-Gm-Message-State: AOJu0YypwOldR2XpEmd2tWq0Dr0uV6J5J1JITbehR7P/t/jI9Pg5Ssdd qzS3VV15L6G/FBmg8+qvAcFBS9HMyFVJrQ== X-Received: by 2002:a05:6402:12d2:b0:552:e50f:524e with SMTP id k18-20020a05640212d200b00552e50f524emr2858705edx.79.1703418561604; Sun, 24 Dec 2023 03:49:21 -0800 (PST) Received: from krzk-bin.. ([78.10.206.178]) by smtp.gmail.com with ESMTPSA id z23-20020aa7c657000000b0054ccac03945sm4999771edr.12.2023.12.24.03.49.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 03:49:20 -0800 (PST) From: Krzysztof Kozlowski To: Sylwester Nawrocki , Mauro Carvalho Chehab , Krzysztof Kozlowski , Alim Akhtar , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 02/12] media: fimc-lite: constify several pointers in function arguments Date: Sun, 24 Dec 2023 12:49:06 +0100 Message-Id: <20231224114916.111433-2-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231224114916.111433-1-krzysztof.kozlowski@linaro.org> References: <20231224114916.111433-1-krzysztof.kozlowski@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786163874588388545 X-GMAIL-MSGID: 1786163874588388545 Several functions do not modify pointed structure, thus the pointer can point to const data for additional safety and self-documenting intention of the function. Signed-off-by: Krzysztof Kozlowski --- .../platform/samsung/exynos4-is/fimc-lite-reg.c | 13 +++++++------ .../platform/samsung/exynos4-is/fimc-lite-reg.h | 10 +++++----- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-lite-reg.c b/drivers/media/platform/samsung/exynos4-is/fimc-lite-reg.c index 57996b4104b4..2483277a6cb0 100644 --- a/drivers/media/platform/samsung/exynos4-is/fimc-lite-reg.c +++ b/drivers/media/platform/samsung/exynos4-is/fimc-lite-reg.c @@ -124,7 +124,7 @@ static const u32 src_pixfmt_map[8][3] = { }; /* Set camera input pixel format and resolution */ -void flite_hw_set_source_format(struct fimc_lite *dev, struct flite_frame *f) +void flite_hw_set_source_format(struct fimc_lite *dev, const struct flite_frame *f) { u32 pixelcode = f->fmt->mbus_code; int i = ARRAY_SIZE(src_pixfmt_map); @@ -155,7 +155,7 @@ void flite_hw_set_source_format(struct fimc_lite *dev, struct flite_frame *f) } /* Set the camera host input window offsets (cropping) */ -void flite_hw_set_window_offset(struct fimc_lite *dev, struct flite_frame *f) +void flite_hw_set_window_offset(struct fimc_lite *dev, const struct flite_frame *f) { u32 hoff2, voff2; u32 cfg; @@ -186,7 +186,7 @@ static void flite_hw_set_camera_port(struct fimc_lite *dev, int id) /* Select serial or parallel bus, camera port (A,B) and set signals polarity */ void flite_hw_set_camera_bus(struct fimc_lite *dev, - struct fimc_source_info *si) + const struct fimc_source_info *si) { u32 cfg = readl(dev->regs + FLITE_REG_CIGCTRL); unsigned int flags = si->flags; @@ -226,7 +226,8 @@ static void flite_hw_set_pack12(struct fimc_lite *dev, int on) writel(cfg, dev->regs + FLITE_REG_CIODMAFMT); } -static void flite_hw_set_out_order(struct fimc_lite *dev, struct flite_frame *f) +static void flite_hw_set_out_order(struct fimc_lite *dev, + const struct flite_frame *f) { static const u32 pixcode[4][2] = { { MEDIA_BUS_FMT_YUYV8_2X8, FLITE_REG_CIODMAFMT_YCBYCR }, @@ -244,7 +245,7 @@ static void flite_hw_set_out_order(struct fimc_lite *dev, struct flite_frame *f) writel(cfg | pixcode[i][1], dev->regs + FLITE_REG_CIODMAFMT); } -void flite_hw_set_dma_window(struct fimc_lite *dev, struct flite_frame *f) +void flite_hw_set_dma_window(struct fimc_lite *dev, const struct flite_frame *f) { u32 cfg; @@ -294,7 +295,7 @@ void flite_hw_mask_dma_buffer(struct fimc_lite *dev, u32 index) } /* Enable/disable output DMA, set output pixel size and offsets (composition) */ -void flite_hw_set_output_dma(struct fimc_lite *dev, struct flite_frame *f, +void flite_hw_set_output_dma(struct fimc_lite *dev, const struct flite_frame *f, bool enable) { u32 cfg = readl(dev->regs + FLITE_REG_CIGCTRL); diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-lite-reg.h b/drivers/media/platform/samsung/exynos4-is/fimc-lite-reg.h index 3b8af3ce1838..c5ec36dfb2f9 100644 --- a/drivers/media/platform/samsung/exynos4-is/fimc-lite-reg.h +++ b/drivers/media/platform/samsung/exynos4-is/fimc-lite-reg.h @@ -133,13 +133,13 @@ void flite_hw_set_interrupt_mask(struct fimc_lite *dev); void flite_hw_capture_start(struct fimc_lite *dev); void flite_hw_capture_stop(struct fimc_lite *dev); void flite_hw_set_camera_bus(struct fimc_lite *dev, - struct fimc_source_info *s_info); -void flite_hw_set_window_offset(struct fimc_lite *dev, struct flite_frame *f); -void flite_hw_set_source_format(struct fimc_lite *dev, struct flite_frame *f); + const struct fimc_source_info *s_info); +void flite_hw_set_window_offset(struct fimc_lite *dev, const struct flite_frame *f); +void flite_hw_set_source_format(struct fimc_lite *dev, const struct flite_frame *f); -void flite_hw_set_output_dma(struct fimc_lite *dev, struct flite_frame *f, +void flite_hw_set_output_dma(struct fimc_lite *dev, const struct flite_frame *f, bool enable); -void flite_hw_set_dma_window(struct fimc_lite *dev, struct flite_frame *f); +void flite_hw_set_dma_window(struct fimc_lite *dev, const struct flite_frame *f); void flite_hw_set_test_pattern(struct fimc_lite *dev, bool on); void flite_hw_dump_regs(struct fimc_lite *dev, const char *label); void flite_hw_set_dma_buffer(struct fimc_lite *dev, struct flite_buffer *buf); From patchwork Sun Dec 24 11:49:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 183040 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp2093798dyi; Sun, 24 Dec 2023 03:50:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IH8Ixf16Perrg6tD2eAnJ00soSXRdK3CCOk+zi0zz2KiwHc0LplTbj5xd9pstDVnG0BNCc7 X-Received: by 2002:a17:90b:f16:b0:28b:1868:9924 with SMTP id br22-20020a17090b0f1600b0028b18689924mr1215125pjb.64.1703418629979; Sun, 24 Dec 2023 03:50:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703418629; cv=none; d=google.com; s=arc-20160816; b=i/uUr8j2CK2Vf8UqP9+5ru47h4BM2Y+twui3iiERnmqH+jGdyzoQeqt7qg6p9kme1r fbk1RCMmnPrvl9R2fBOvDubzjSixW1qGO7/Gg1iwVwvdBDheOz3lwy9GvzuoCti/FaAy STKJBNBdmdrOusT5hWZxtl2D5wJ/tqUGJUSrqOJxcH/Dxc+/TGdb+HblZuCjnb+Vg2Su yeULtzoCj5uQzQTU12hhkcP1tQgB8bncfgUUpTVM6tQyNbyYYpVuQRW/Z90gThJhi0rV pjVVBGNnmSwkcA+Q/fNI8i0CKkjlvRAiuBwwwnDtcDrCKXsuyPhuIjwww32j4ZXRo+4F Axtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:to:from:dkim-signature; bh=+A2sLdMYd9jrOu4aUtIFiY1f/32swGwSuhGRSvbimyg=; fh=FbjPzT9WWTKSglYskE+giKKmjX6PgCMhn86yvylggxU=; b=QziJ9z9nn8obpOvryygsr463T7ShcjOSfZ5ZmmxW/Xccjl17VRNt29z9oi3rY8k6KP fXseOPe2tpkMG9peUAY/i7Yiv8UGbvdAn2yrQouTQ8EHzdIfJZBmb9Qvnu8LnpzPd3Ra BVTJ2paJVnNM9bUkgFeRF6yAp4CAfQ5IFwutjehUabpkQ1ZAlxFlEOdkTvUBvuPKPu8E O18LZ/ccdpVjcmOYNlSspeXG6P9PoHhFyK9zv6xN+6W27SXzY33pwFgCbpq4pzYHtxq8 bYBWNcZnUW5AB7f77KssbaX4jeAo9vt6VLfd8CbVD3zP/mPkYhosVpihPD2f4e4Rq+Fy ejDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=f0xhWpr9; spf=pass (google.com: domain of linux-kernel+bounces-10695-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10695-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id on13-20020a17090b1d0d00b0028ad088026asi6533364pjb.76.2023.12.24.03.50.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 03:50:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10695-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=f0xhWpr9; spf=pass (google.com: domain of linux-kernel+bounces-10695-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10695-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id BBFFB28229D for ; Sun, 24 Dec 2023 11:50:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D884AD2FD; Sun, 24 Dec 2023 11:49:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="f0xhWpr9" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 877BB3D7C for ; Sun, 24 Dec 2023 11:49:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-554d06bfd83so183248a12.1 for ; Sun, 24 Dec 2023 03:49:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703418563; x=1704023363; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=+A2sLdMYd9jrOu4aUtIFiY1f/32swGwSuhGRSvbimyg=; b=f0xhWpr9yAuT8pn3ZBNfas90r1lbC3N5IR7Gr0buY5B3uORUkmoPij2PA9MtJ2gGR4 r6c2w2uhg3KCEJTADH9QJ6ynr+J13UB+KBnI9j6b0+I5UI8iUC8otz43UhzNH4RIHP8q gWX/5lSTNt0jihNQeVNvBgkKHQki1dMxjHra7LgqkHhjogWx9ZN7tzDZE4sVtZdubICR xWzpZIfm5nkLE2yLTBkfBz8Lwgw7zlwNH86pYrl6w6LBu9pDVnLr94W+qmOYea49H31K uh3hJIUzc1u1oeSHfTezjVIk4/E8jeDj1RLIyL5QRJnLpQVv/QnZhB9bq+FbLm6k7Rcv nSgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703418563; x=1704023363; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+A2sLdMYd9jrOu4aUtIFiY1f/32swGwSuhGRSvbimyg=; b=Ry7uJcRfZ7zyY7AaZD3RZjbVNIxH4FWztFmXW60HTFTbUceyGMBBCHWjUZOvxP3FTt pLF/LBN3J5gZftVwqUuRtdiO87YX4siCr943SzwNyGK3jjadkK3V1BYtSkjmitJbJCL8 55hlfUZEUNd4kjwZL50/75X11pO9ntP2mwoDP3v6B0laROgORI195eI2LUzu66/AV9Zw 8SNEB2QiFIErzQGDsu0qE6ZVxWMQe0M6h8zQ+HqDvfPjQgSiDdPWeJCxpsI62Bt79jk8 TOpaB3EY2nJqv5sMG2YmdU3HLESAKhH3o4gskIO05hYqV9+Aot1gemK3wpiKvZjI3G9A b1Lw== X-Gm-Message-State: AOJu0YwxXNs2gLYluR/6YRz0VD1Cxp8ts/9daN+CDH7+gjT5UmodIj/z FJ6hIDI5qWCe1oZk3TKllriHuzLM67vtoA== X-Received: by 2002:aa7:cb50:0:b0:551:4f67:18df with SMTP id w16-20020aa7cb50000000b005514f6718dfmr2757054edt.59.1703418562841; Sun, 24 Dec 2023 03:49:22 -0800 (PST) Received: from krzk-bin.. ([78.10.206.178]) by smtp.gmail.com with ESMTPSA id z23-20020aa7c657000000b0054ccac03945sm4999771edr.12.2023.12.24.03.49.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 03:49:22 -0800 (PST) From: Krzysztof Kozlowski To: Sylwester Nawrocki , Mauro Carvalho Chehab , Krzysztof Kozlowski , Alim Akhtar , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 03/12] media: fimc-lite: constify pointers to v4l2_pix_format_mplane Date: Sun, 24 Dec 2023 12:49:07 +0100 Message-Id: <20231224114916.111433-3-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231224114916.111433-1-krzysztof.kozlowski@linaro.org> References: <20231224114916.111433-1-krzysztof.kozlowski@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786163893497610932 X-GMAIL-MSGID: 1786163893497610932 In few places functions do not modify pointed "struct v4l2_pix_format_mplane", thus the pointer can point to const data for additional safety and self-documenting intention of the function. Signed-off-by: Krzysztof Kozlowski --- drivers/media/platform/samsung/exynos4-is/fimc-lite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-lite.c b/drivers/media/platform/samsung/exynos4-is/fimc-lite.c index 7898c9bebb04..d1d860fa3454 100644 --- a/drivers/media/platform/samsung/exynos4-is/fimc-lite.c +++ b/drivers/media/platform/samsung/exynos4-is/fimc-lite.c @@ -738,7 +738,7 @@ static int fimc_lite_try_fmt_mplane(struct file *file, void *fh, static int fimc_lite_s_fmt_mplane(struct file *file, void *priv, struct v4l2_format *f) { - struct v4l2_pix_format_mplane *pixm = &f->fmt.pix_mp; + const struct v4l2_pix_format_mplane *pixm = &f->fmt.pix_mp; struct fimc_lite *fimc = video_drvdata(file); struct flite_frame *frame = &fimc->out_frame; const struct fimc_fmt *fmt = NULL; From patchwork Sun Dec 24 11:49:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 183041 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp2093858dyi; Sun, 24 Dec 2023 03:50:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IFJHrLgZHxmX6BSJ46NVH82Zb0DOy4TyPexpNkUa3LreuILessO3MIn1yKOyz5+bgdip10F X-Received: by 2002:a0c:fc03:0:b0:67f:9fbd:6736 with SMTP id z3-20020a0cfc03000000b0067f9fbd6736mr3499057qvo.78.1703418644435; Sun, 24 Dec 2023 03:50:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703418644; cv=none; d=google.com; s=arc-20160816; b=Pl6xNKqmfzXIVxdVk93Bbq8fCIFcZvGaE65U1F71LuRuyB9AEvyF2SdgJKhOosFcPm CUqd/yDHnAuQQsFqXBIkScuPr8905SEqw48dWI3pCn94CbNXhYpagEr1Fw16Nl7zlVe6 fOJ5BNov7Jw4+EGma94cqgWfri1ZvoUGENH4PYRrVOLLGHSgUnk7O8mQIrRkz568KpDX HmXpReoY+G5M+R4lACalxUVBz0XnQWNvPKJy9LQq0a1BAu1OHLVjTmEmJ+E4WQw6I7In iHlh3xObZRrQ9LxXmKS96xy6VLmTQ6wArbvwGMS7Z4Y1nE7WDghiMJR16k4sDxxYgzbI TniA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:to:from:dkim-signature; bh=PVApuuT/XfmeqHfcxDHhSC3DLyKiRm/PdGLsLnce34I=; fh=FbjPzT9WWTKSglYskE+giKKmjX6PgCMhn86yvylggxU=; b=nPxosBtyg6uD6h6DRmAlQScW6rIr2yXENQlzspHtVpxViSX7UHv5qb1wvlo7r26lDm kIRiNyKMMU2CRYG7/gDehS+/t2AyVsdn7Bw04dMmQCTnBWyD9zALhXwdYJ90tH8gc2YG MPV6rTg02C1SSe8zmFGODBNHLOobguLYSGiBBJB0ETXPSmkT8AWhsPvnoS3lFiQcw86/ 3xvAmahQdCqmOifFV9/lH78HY4/WM/f67BRlkHiGzPBvDn6dgyGLfo2qH0dVfgNPqjzz a/7VOgoggYoHQEk2J527X3kDF3ClJKkjxYB1qMenuDFV0gVDF0obQQuYDY97b7kNMP7A V3fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oW8qvqqx; spf=pass (google.com: domain of linux-kernel+bounces-10696-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10696-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id n17-20020a0ce951000000b0067f7fb095edsi8364509qvo.177.2023.12.24.03.50.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 03:50:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10696-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oW8qvqqx; spf=pass (google.com: domain of linux-kernel+bounces-10696-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10696-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 3B6741C20B39 for ; Sun, 24 Dec 2023 11:50:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F0BE9DDCA; Sun, 24 Dec 2023 11:49:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="oW8qvqqx" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BAED353AF for ; Sun, 24 Dec 2023 11:49:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ed1-f48.google.com with SMTP id 4fb4d7f45d1cf-554909ac877so814980a12.1 for ; Sun, 24 Dec 2023 03:49:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703418564; x=1704023364; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=PVApuuT/XfmeqHfcxDHhSC3DLyKiRm/PdGLsLnce34I=; b=oW8qvqqxKIMzSfA78RPM0ykCcl3Fdq24pYtowV4bnzfUaaTbSN73FxywbF0mHhmVLM UFiErkOAtUrjdalmg38/G+veVpzMr4WHxvG/GY4UimQ3QbAMiDwTum8V4FPpePoS/KD/ nIgX+P9lcZv993dM08qWM4HnkwhqMY5+8pPaBaGL+xorc5fLWxg6pbFAQ04wcVUYBXwT lRmHK8tpqUh+RuBzJO9SOXiCRlrUWy7jjDRxJLM4xyCbvCo7bvuvGl7FSHVAMVKOVKp3 SMDzuLpNDBGpLP6CHnOn5HCnL3FSHDJBf8sPDyCoXO0XrfG6dxtw7Gb6UTUq44rEScuI 1EaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703418564; x=1704023364; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PVApuuT/XfmeqHfcxDHhSC3DLyKiRm/PdGLsLnce34I=; b=ZKpNAFoOAhl9ebvy+O/DRG7vOKMrDTl7jcPjfgKqfhAKZ6yzn1hSmOV1rqTdkSolua tAPvPD4dJrSQrEvSzmU1s5FGsBMwe0B3IX6kc9tTnTDm8xSNJbawuIVGjORSbXGcKbZC y3x3KEjW1vuyrZqowbheil0/C8BkPbdFRdQbq5YP6zVbXPF89/ZMnrV+wfr7uKCtEUXC zdW4o0ARgmXgjNM4d8ZvOtBkZ06Kt/tiNlvgkv09QCQlHTzR58QKunvcQSDmDXeBx4fc 47PA1r5BPabTcBFo2v6PsqXiFwEodeIuTBOq2uDcxGkjOV7ZPL2fPiRE3+o1Nq3hpbho IRwA== X-Gm-Message-State: AOJu0YwauWQn3E7OyYln9tk9gb7eNNXRu+HgRRgo1V49spDLiUXOwRH7 xVuzWBIeXRcDzlLS0DBe769ZlqVwLneVnA== X-Received: by 2002:aa7:d40c:0:b0:554:af5e:d4ce with SMTP id z12-20020aa7d40c000000b00554af5ed4cemr1137829edq.70.1703418564133; Sun, 24 Dec 2023 03:49:24 -0800 (PST) Received: from krzk-bin.. ([78.10.206.178]) by smtp.gmail.com with ESMTPSA id z23-20020aa7c657000000b0054ccac03945sm4999771edr.12.2023.12.24.03.49.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 03:49:23 -0800 (PST) From: Krzysztof Kozlowski To: Sylwester Nawrocki , Mauro Carvalho Chehab , Krzysztof Kozlowski , Alim Akhtar , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 04/12] media: fimc-is: drop unused fimc_vidioc_enum_fmt_mplane() Date: Sun, 24 Dec 2023 12:49:08 +0100 Message-Id: <20231224114916.111433-4-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231224114916.111433-1-krzysztof.kozlowski@linaro.org> References: <20231224114916.111433-1-krzysztof.kozlowski@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786163908089400216 X-GMAIL-MSGID: 1786163908089400216 Function fimc_vidioc_enum_fmt_mplane() is not defined, so drop its declaration from the header. Signed-off-by: Krzysztof Kozlowski --- drivers/media/platform/samsung/exynos4-is/fimc-core.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-core.h b/drivers/media/platform/samsung/exynos4-is/fimc-core.h index 2b0760add092..cc840e6e07a9 100644 --- a/drivers/media/platform/samsung/exynos4-is/fimc-core.h +++ b/drivers/media/platform/samsung/exynos4-is/fimc-core.h @@ -610,8 +610,6 @@ static inline struct fimc_frame *ctx_get_frame(struct fimc_ctx *ctx, /* -----------------------------------------------------*/ /* fimc-core.c */ -int fimc_vidioc_enum_fmt_mplane(struct file *file, void *priv, - struct v4l2_fmtdesc *f); int fimc_ctrls_create(struct fimc_ctx *ctx); void fimc_ctrls_delete(struct fimc_ctx *ctx); void fimc_ctrls_activate(struct fimc_ctx *ctx, bool active); From patchwork Sun Dec 24 11:49:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 183042 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp2093923dyi; Sun, 24 Dec 2023 03:51:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IEZoJFz7h7ijWWLYzGtWqo/QMlPpfDUhDCQU6bKAmP+lTLsNQhG+lpz8DXAJQLk4qeIz+Wy X-Received: by 2002:a50:c31a:0:b0:553:165e:b213 with SMTP id a26-20020a50c31a000000b00553165eb213mr3276447edb.25.1703418659957; Sun, 24 Dec 2023 03:50:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703418659; cv=none; d=google.com; s=arc-20160816; b=Q0cAoZ01I6OeJE+JSBSjjltCkdvZJhDAxe/rYK8eG2v105RQOCSo8y9+DxjZtTHix/ xDNz0E1rYscN6lqhgFm48DxP27fbRD8goy8Q3vYcVrvVNKKn0N2eLsgFpRMaXCkHyWxd 6e5s9XQgaiVmTaN0jSgQ13TuZ0o1koLlcBX7xvKxn3QQcAiR39kO6mLxeRJQVB/PjcLz X8UpNlzcuW6FF7EQL9zRgliKjo9rLYGkF7D2eEVQXaixE7rm8BdCM/3kCzMpNblcPn37 DCR+prEjIAO6igZO7iXJBJOvqpNgnEnOebUxGUdrcqEawVmFjCFvCmXS9DuG8twfXSd3 rtYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:to:from:dkim-signature; bh=N/7yGGqfPDJBjbjF6BHEdiopGYDrUqZzrzy34YLYqKk=; fh=FbjPzT9WWTKSglYskE+giKKmjX6PgCMhn86yvylggxU=; b=RAN6z8AcgJo8PkV9fnuCnqxUSuEqskQfInuoGmC4A9EYk5GgXpd4JgdXpn1AnU1mjB g7Or699nuS3uXZ5x9Ks3fQfeaAZJd52osqR7higIbtbku/Wi2PGeY6gLOiQDfxnjAv7o EMzb7EokDYQ+GjXvX3GZJaqNjtmIp+TCD0nOZE5fB1H6To9L0wPD0oo9sw2qIfQJNTxe DItLecctheENt1M7grDhf2gS2W9skA8X7E9QTVwE27KVjvh5ccLzYKiSOkzLdakz88YB zu62CfRmTOAJomXjsVFufSJQQojYpiGVW3kNAKfkeawY9mppJXJ1EAMXRqXeurQ165i/ QRkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EGtYT3OQ; spf=pass (google.com: domain of linux-kernel+bounces-10697-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10697-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a13-20020a05640213cd00b005549e07cd5esi1112812edx.102.2023.12.24.03.50.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 03:50:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10697-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EGtYT3OQ; spf=pass (google.com: domain of linux-kernel+bounces-10697-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10697-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 9192A1F20F80 for ; Sun, 24 Dec 2023 11:50:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 03424EAE8; Sun, 24 Dec 2023 11:49:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="EGtYT3OQ" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D28F56AA7 for ; Sun, 24 Dec 2023 11:49:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ej1-f49.google.com with SMTP id a640c23a62f3a-a22deb95d21so384385966b.3 for ; Sun, 24 Dec 2023 03:49:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703418565; x=1704023365; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=N/7yGGqfPDJBjbjF6BHEdiopGYDrUqZzrzy34YLYqKk=; b=EGtYT3OQ3/Z+GiG4WPAUTtJzHUjhgn6tBoqetRM8gMTs1tyucxdA22fZ56bANWWnZ4 QhS27uSsQWrIHQHJFczdyduVbVBHOTnq/e5iej4sOdhyj78VF3M8FQeGU5XNA7MO+Pua RIk/ZPZ5nY7RRnID++voHij4EUtMcG2pjIXnNlMr+IxID+jB6iMdlbRFT9WNTvcwXGtb zcXJjhlVCBvXDFuv41nmL4iteyL7y3i6LsEhgl7jpFYR2Y29bRo/Io1Og3Ks4bBbiEYf gQmNAscgYNeQ0Bj792hJBzflvyEuaLn6uSKUcyU2RCQeUJVUcFH3hysv4GL4mmHoxTq4 E+sA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703418565; x=1704023365; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=N/7yGGqfPDJBjbjF6BHEdiopGYDrUqZzrzy34YLYqKk=; b=V7HTXNSF5gwDg9RDjGoylXVVllC3Zopuqr9gZozBCgae25ZJ392GaklmfjOIMUOheL XlDIRgnt142ltjgRJad2HRdWorSDph33qYhgkZK3QYKe9hjer7i4+k7DGaG2LLDfwLuP lWhumEM0LbWuvX5DsffVFKkv8rt556gLWamrQar63HcLd3rHSUggfNEriQAJnSF3uGZh NBZL8DR9mjwIBLETL6Cc4/zJlGKVqXU999YIyotroqQ3oUwWxFibXDbDVg6UegUCmOEz GS1FQHiY5Cce/tmuubg9C9XKcT5VITabGyivpddHqj+lgeBxvhM0zQa1YeSlrftx7BOu pm7w== X-Gm-Message-State: AOJu0YxI7ieyid17ns4RgxdtjgHss+F2I7PgjSYCch9sluS+eCGh5yQ1 v5AkmN3iIpJhPZAkRRiCO/laI8rJkEMRpw== X-Received: by 2002:a50:d617:0:b0:553:f06d:3ab7 with SMTP id x23-20020a50d617000000b00553f06d3ab7mr2823307edi.35.1703418565299; Sun, 24 Dec 2023 03:49:25 -0800 (PST) Received: from krzk-bin.. ([78.10.206.178]) by smtp.gmail.com with ESMTPSA id z23-20020aa7c657000000b0054ccac03945sm4999771edr.12.2023.12.24.03.49.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 03:49:24 -0800 (PST) From: Krzysztof Kozlowski To: Sylwester Nawrocki , Mauro Carvalho Chehab , Krzysztof Kozlowski , Alim Akhtar , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 05/12] media: fimc-is: constify clock names Date: Sun, 24 Dec 2023 12:49:09 +0100 Message-Id: <20231224114916.111433-5-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231224114916.111433-1-krzysztof.kozlowski@linaro.org> References: <20231224114916.111433-1-krzysztof.kozlowski@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786163924955630647 X-GMAIL-MSGID: 1786163924955630647 Static array with clock names can be made const for code safety. Signed-off-by: Krzysztof Kozlowski --- drivers/media/platform/samsung/exynos4-is/fimc-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-core.c b/drivers/media/platform/samsung/exynos4-is/fimc-core.c index 97908778e1c8..ad72cc31dc45 100644 --- a/drivers/media/platform/samsung/exynos4-is/fimc-core.c +++ b/drivers/media/platform/samsung/exynos4-is/fimc-core.c @@ -29,7 +29,7 @@ #include "fimc-reg.h" #include "media-dev.h" -static char *fimc_clocks[MAX_FIMC_CLOCKS] = { +static const char *fimc_clocks[MAX_FIMC_CLOCKS] = { "sclk_fimc", "fimc" }; From patchwork Sun Dec 24 11:49:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 183043 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp2094066dyi; Sun, 24 Dec 2023 03:51:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IFXYw6jifzV1yYWYVHASn8tfPQl8kmSqZR/pipuwNwRmrLkFp9fEY4YVXQf/Y0O/OQpSwZg X-Received: by 2002:a05:600c:364c:b0:40d:3880:9a81 with SMTP id y12-20020a05600c364c00b0040d38809a81mr2537771wmq.182.1703418697446; Sun, 24 Dec 2023 03:51:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703418697; cv=none; d=google.com; s=arc-20160816; b=PTdrCNAx7AGyckNrGv3AMvbmpJFVFQqV+HZay+dh5OpQuDdEpZy2Uj5VgA5QwEXq0V OavHpzIQhp2mgmJKSosjEm9RYJflK0QzOJ/HrbJt532o3sRvJGYYLoTaUAImGB4B9+ss YuH6muZaSOqa6dnXV59dbkoQ0PIkAJmAI0j78cA2jE2dhuwYTBPCVkRELaQ8THQedzoy ezSqb3RwTvlEDkjVj0ZjWbCr/uulS5KagXSdiLBOr3KtzAfvSZeUcX6A2dETXMiHdx+g J76R1g2Td3UYkhhMiSVH76tgOflB7LP676cmnWdiICJzvcItLkgKBrYXvmF7ydg29W8k siDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:to:from:dkim-signature; bh=sP3ZUYJrc19Cv/IjV/mAOUbO0abZ7npMLo6H/Ze3L60=; fh=FbjPzT9WWTKSglYskE+giKKmjX6PgCMhn86yvylggxU=; b=wjF9sU7/JaWZy0Bf1C7pKEwOiFAbioc7bbdiz0jE/d12L5OdmcqlaHMrdyXspa7TnQ jHecFHGwKKhc2ZAHM1fuG9L4Gm4TuaREqtN6Kat4oLOW2QRpLD+LjG/P+/10Jfit/oN2 hZRZ5AngfHfom/G0O7uD1vehGArqot7K8lO3nyyIPPeN0kNb8MdodGqEU+ZdotJTeW67 iqgOYauG/UO5TuMTJIst59wCmICaU3BvHdrDv+EJkMEWMDdxrlzUyu+nZ0MzDuFHLkLK MPYrgHP00x4DwffeXi91S2SCril6jpNONSJdxqLmp2pzJPw3VofGISO4bHwH5/h0ZVFg uupA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Cu0x0hRG; spf=pass (google.com: domain of linux-kernel+bounces-10698-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10698-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id i9-20020a170906a28900b00a233da3c8fbsi3706296ejz.697.2023.12.24.03.51.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 03:51:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10698-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Cu0x0hRG; spf=pass (google.com: domain of linux-kernel+bounces-10698-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10698-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id DEF9B1F20FC4 for ; Sun, 24 Dec 2023 11:51:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5D3D2E572; Sun, 24 Dec 2023 11:49:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Cu0x0hRG" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 315D4D282 for ; Sun, 24 Dec 2023 11:49:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ed1-f42.google.com with SMTP id 4fb4d7f45d1cf-5534abbc637so3459608a12.0 for ; Sun, 24 Dec 2023 03:49:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703418566; x=1704023366; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=sP3ZUYJrc19Cv/IjV/mAOUbO0abZ7npMLo6H/Ze3L60=; b=Cu0x0hRG6sWYVmLCOgFaCgN6Eh7NlhBLbY8oGVgFxBUIi+IDNQMrRkF305OK8yShRQ gXiAqFvMHpjU9qZ9Quh0ZDxxQApyX7ZhIGX8MYwmHSVgMC2pzMqn0hcKkziFcGVGawjt JwZhjGUT0+/yYkgVK9SQz/3ojwOHmvlvc9byhEpLPGepOOGcs2vfcGxuttncNWK89oLz L3LN5dtO+zhb0kZqtV/G8MdOyHokdDRM1euZSX24uqr7CW+Z9eEn+tIamoKl5OQo+mtB 3iMgIHOlRS7vMTYphdTqKwPKnAdpTYfHiRjAHgHlcQiLpV8ZtHDKt6BkJeDhvd0zDvrw aNuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703418566; x=1704023366; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sP3ZUYJrc19Cv/IjV/mAOUbO0abZ7npMLo6H/Ze3L60=; b=XaeC/E5vr2FmvKapNnZT2IGJsosIoZkWkLmHai9esQTmd22r0431U/qpyIreXeIRv+ uFbHciTnT8xMJKU5SD+quOkE2QrLLqzflyW0AiSbOzPfhl8cNO7y9Bpt0DVG+i7B9gZh xzApD30DeU98Mv+VHiDHN+KeFfgwZBxkuGWrylxthy5q8xqbtjLnPlQpn1M23uWQfHrj Lfh5dN8u+y6nPl3S9nGmgBFTFdr8hWLbM54pPmTuF8gie1fnepfMUxRro1BokUc/jqvW tX+PPP4I4RLMxA53gSJD9w9sUe5HWhp8tB6NpKpHDTtFP+hCu407j9980KC1LQzhSKBQ d/bA== X-Gm-Message-State: AOJu0Yypum/bhq2wLZz8prgYWVuM+O//3sE0rXHrqVcKkg9KFpIB/4eT Z9/5u7gaaGTISAgoyaup3oZt+k/uyIKy6Q== X-Received: by 2002:aa7:d64d:0:b0:553:ac86:3a4c with SMTP id v13-20020aa7d64d000000b00553ac863a4cmr3160883edr.51.1703418566479; Sun, 24 Dec 2023 03:49:26 -0800 (PST) Received: from krzk-bin.. ([78.10.206.178]) by smtp.gmail.com with ESMTPSA id z23-20020aa7c657000000b0054ccac03945sm4999771edr.12.2023.12.24.03.49.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 03:49:25 -0800 (PST) From: Krzysztof Kozlowski To: Sylwester Nawrocki , Mauro Carvalho Chehab , Krzysztof Kozlowski , Alim Akhtar , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 06/12] media: fimc-is: constify several pointers in function arguments Date: Sun, 24 Dec 2023 12:49:10 +0100 Message-Id: <20231224114916.111433-6-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231224114916.111433-1-krzysztof.kozlowski@linaro.org> References: <20231224114916.111433-1-krzysztof.kozlowski@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786163964322907239 X-GMAIL-MSGID: 1786163964322907239 Several functions do not modify pointed structure, thus the pointer can point to const data for additional safety and self-documenting intention of the function. Signed-off-by: Krzysztof Kozlowski --- .../media/platform/samsung/exynos4-is/fimc-core.c | 6 +++--- .../media/platform/samsung/exynos4-is/fimc-core.h | 12 ++++++------ drivers/media/platform/samsung/exynos4-is/fimc-reg.c | 10 +++++----- drivers/media/platform/samsung/exynos4-is/fimc-reg.h | 10 +++++----- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-core.c b/drivers/media/platform/samsung/exynos4-is/fimc-core.c index ad72cc31dc45..13b04fda8716 100644 --- a/drivers/media/platform/samsung/exynos4-is/fimc-core.c +++ b/drivers/media/platform/samsung/exynos4-is/fimc-core.c @@ -326,7 +326,7 @@ static irqreturn_t fimc_irq_handler(int irq, void *priv) /* The color format (colplanes, memplanes) must be already configured. */ int fimc_prepare_addr(struct fimc_ctx *ctx, struct vb2_buffer *vb, - struct fimc_frame *frame, struct fimc_addr *addr) + const struct fimc_frame *frame, struct fimc_addr *addr) { int ret = 0; u32 pix_size; @@ -670,7 +670,7 @@ void fimc_alpha_ctrl_update(struct fimc_ctx *ctx) v4l2_ctrl_unlock(ctrl); } -void __fimc_get_format(struct fimc_frame *frame, struct v4l2_format *f) +void __fimc_get_format(const struct fimc_frame *frame, struct v4l2_format *f) { struct v4l2_pix_format_mplane *pixm = &f->fmt.pix_mp; int i; @@ -695,7 +695,7 @@ void __fimc_get_format(struct fimc_frame *frame, struct v4l2_format *f) * @height: requested pixel height * @pix: multi-plane format to adjust */ -void fimc_adjust_mplane_format(struct fimc_fmt *fmt, u32 width, u32 height, +void fimc_adjust_mplane_format(const struct fimc_fmt *fmt, u32 width, u32 height, struct v4l2_pix_format_mplane *pix) { u32 bytesperline = 0; diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-core.h b/drivers/media/platform/samsung/exynos4-is/fimc-core.h index cc840e6e07a9..261c9aac2f7f 100644 --- a/drivers/media/platform/samsung/exynos4-is/fimc-core.h +++ b/drivers/media/platform/samsung/exynos4-is/fimc-core.h @@ -515,7 +515,7 @@ static inline void set_frame_crop(struct fimc_frame *f, f->height = height; } -static inline u32 fimc_get_format_depth(struct fimc_fmt *ff) +static inline u32 fimc_get_format_depth(const struct fimc_fmt *ff) { u32 i, depth = 0; @@ -557,7 +557,7 @@ static inline bool fimc_ctx_state_is_set(u32 mask, struct fimc_ctx *ctx) return ret; } -static inline int tiled_fmt(struct fimc_fmt *fmt) +static inline int tiled_fmt(const struct fimc_fmt *fmt) { return fmt->fourcc == V4L2_PIX_FMT_NV12MT; } @@ -575,7 +575,7 @@ static inline bool fimc_user_defined_mbus_fmt(u32 code) } /* Return the alpha component bit mask */ -static inline int fimc_get_alpha_mask(struct fimc_fmt *fmt) +static inline int fimc_get_alpha_mask(const struct fimc_fmt *fmt) { switch (fmt->color) { case FIMC_FMT_RGB444: return 0x0f; @@ -614,8 +614,8 @@ int fimc_ctrls_create(struct fimc_ctx *ctx); void fimc_ctrls_delete(struct fimc_ctx *ctx); void fimc_ctrls_activate(struct fimc_ctx *ctx, bool active); void fimc_alpha_ctrl_update(struct fimc_ctx *ctx); -void __fimc_get_format(struct fimc_frame *frame, struct v4l2_format *f); -void fimc_adjust_mplane_format(struct fimc_fmt *fmt, u32 width, u32 height, +void __fimc_get_format(const struct fimc_frame *frame, struct v4l2_format *f); +void fimc_adjust_mplane_format(const struct fimc_fmt *fmt, u32 width, u32 height, struct v4l2_pix_format_mplane *pix); struct fimc_fmt *fimc_find_format(const u32 *pixelformat, const u32 *mbus_code, unsigned int mask, int index); @@ -626,7 +626,7 @@ int fimc_check_scaler_ratio(struct fimc_ctx *ctx, int sw, int sh, int fimc_set_scaler_info(struct fimc_ctx *ctx); int fimc_prepare_config(struct fimc_ctx *ctx, u32 flags); int fimc_prepare_addr(struct fimc_ctx *ctx, struct vb2_buffer *vb, - struct fimc_frame *frame, struct fimc_addr *addr); + const struct fimc_frame *frame, struct fimc_addr *addr); void fimc_prepare_dma_offset(struct fimc_ctx *ctx, struct fimc_frame *f); void fimc_set_yuv_order(struct fimc_ctx *ctx); void fimc_capture_irq_handler(struct fimc_dev *fimc, int deq_buf); diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-reg.c b/drivers/media/platform/samsung/exynos4-is/fimc-reg.c index 95165a2cc7d1..f20fb74dd0c6 100644 --- a/drivers/media/platform/samsung/exynos4-is/fimc-reg.c +++ b/drivers/media/platform/samsung/exynos4-is/fimc-reg.c @@ -526,7 +526,7 @@ void fimc_hw_set_output_path(struct fimc_ctx *ctx) writel(cfg, dev->regs + FIMC_REG_CISCCTRL); } -void fimc_hw_set_input_addr(struct fimc_dev *dev, struct fimc_addr *addr) +void fimc_hw_set_input_addr(struct fimc_dev *dev, const struct fimc_addr *addr) { u32 cfg = readl(dev->regs + FIMC_REG_CIREAL_ISIZE); cfg |= FIMC_REG_CIREAL_ISIZE_ADDR_CH_DIS; @@ -541,7 +541,7 @@ void fimc_hw_set_input_addr(struct fimc_dev *dev, struct fimc_addr *addr) } void fimc_hw_set_output_addr(struct fimc_dev *dev, - struct fimc_addr *addr, int index) + const struct fimc_addr *addr, int index) { int i = (index == -1) ? 0 : index; do { @@ -554,7 +554,7 @@ void fimc_hw_set_output_addr(struct fimc_dev *dev, } int fimc_hw_set_camera_polarity(struct fimc_dev *fimc, - struct fimc_source_info *cam) + const struct fimc_source_info *cam) { u32 cfg = readl(fimc->regs + FIMC_REG_CIGCTRL); @@ -648,7 +648,7 @@ int fimc_hw_set_camera_source(struct fimc_dev *fimc, return 0; } -void fimc_hw_set_camera_offset(struct fimc_dev *fimc, struct fimc_frame *f) +void fimc_hw_set_camera_offset(struct fimc_dev *fimc, const struct fimc_frame *f) { u32 hoff2, voff2; @@ -668,7 +668,7 @@ void fimc_hw_set_camera_offset(struct fimc_dev *fimc, struct fimc_frame *f) } int fimc_hw_set_camera_type(struct fimc_dev *fimc, - struct fimc_source_info *source) + const struct fimc_source_info *source) { struct fimc_vid_cap *vid_cap = &fimc->vid_cap; u32 csis_data_alignment = 32; diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-reg.h b/drivers/media/platform/samsung/exynos4-is/fimc-reg.h index b9b33aa1f12f..9714f4309655 100644 --- a/drivers/media/platform/samsung/exynos4-is/fimc-reg.h +++ b/drivers/media/platform/samsung/exynos4-is/fimc-reg.h @@ -302,16 +302,16 @@ void fimc_hw_set_rgb_alpha(struct fimc_ctx *ctx); void fimc_hw_set_in_dma(struct fimc_ctx *ctx); void fimc_hw_set_input_path(struct fimc_ctx *ctx); void fimc_hw_set_output_path(struct fimc_ctx *ctx); -void fimc_hw_set_input_addr(struct fimc_dev *fimc, struct fimc_addr *addr); -void fimc_hw_set_output_addr(struct fimc_dev *fimc, struct fimc_addr *addr, +void fimc_hw_set_input_addr(struct fimc_dev *fimc, const struct fimc_addr *addr); +void fimc_hw_set_output_addr(struct fimc_dev *fimc, const struct fimc_addr *addr, int index); int fimc_hw_set_camera_source(struct fimc_dev *fimc, struct fimc_source_info *cam); -void fimc_hw_set_camera_offset(struct fimc_dev *fimc, struct fimc_frame *f); +void fimc_hw_set_camera_offset(struct fimc_dev *fimc, const struct fimc_frame *f); int fimc_hw_set_camera_polarity(struct fimc_dev *fimc, - struct fimc_source_info *cam); + const struct fimc_source_info *cam); int fimc_hw_set_camera_type(struct fimc_dev *fimc, - struct fimc_source_info *cam); + const struct fimc_source_info *cam); void fimc_hw_clear_irq(struct fimc_dev *dev); void fimc_hw_enable_scaler(struct fimc_dev *dev, bool on); void fimc_hw_activate_input_dma(struct fimc_dev *dev, bool on); From patchwork Sun Dec 24 11:49:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 183044 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp2094172dyi; Sun, 24 Dec 2023 03:51:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IEKtPZFeY0FCoVSanXAS0H4wNPRqyw7MA7AGdGAZk8/O9k48G2WHPzK0ZskSv/Gn8L5iK80 X-Received: by 2002:a05:6e02:b48:b0:35f:ef55:6abf with SMTP id f8-20020a056e020b4800b0035fef556abfmr3911710ilu.0.1703418719388; Sun, 24 Dec 2023 03:51:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703418719; cv=none; d=google.com; s=arc-20160816; b=NK78xFXbwXqpDQZeCUV0eHV1N+bEUr6bAM1skqHizPCTlli7UGS73+qCJdC9mxi/8s d4MLKeZSSgjEA69Mt9yEhDA43mpuBW/+LTui2MSeP+EZHU2mJ0DuGVCUAf5DScJNvbRN kA/+pR6PDzkH5otZq0td6DyQC94HQNrX2GVMut7+s/sjJ6GnlnTIu6TXXgk86szK7ckz 4qQOp+HnuzrmVdj4c/KWbdWdhvOkIQ9yU91QXUJrNz7d9MxF9VxowHGdKXnQBADhuVoy cKYd1fxyKE4v1JHNer6XJvENC1yKH1QUuNyhsdD015Ht9q26iM7z9IZUUHjmEPY7WY53 RV7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:to:from:dkim-signature; bh=KuoZ5gF8FMh++nKHkc2ffIG7u4Pa2qSYGztYC958mos=; fh=FbjPzT9WWTKSglYskE+giKKmjX6PgCMhn86yvylggxU=; b=ICrenEFM2HYlmIJ3H/Upyu+eaNwWuXWOO29dp0tjA0QnmqDggjgE86fmYTvjF3tfMN fd/hs+tJ7C4rvGr1jbjzclRoXdf0qNBBYZiOf7ESg1GAt3b8NgQO57YfPYn1V+bb6rMv Cq66ol6FyU6ruiPi7hm8eZOUdJ4dpgzApbaJGrCL1Sul2FMxieQPDzZfwiGPeEw1YgFw O1WTCgUB8JCa4JVnNkCMi+OlVmNrHdMQZpZ8KW3az0O1zidh7wNODMCBfj4iUou8lETJ 42rv6IuEXnMC9HZtuYde4ukaqWQIDpS50RaKCoqqy9f9GNOCdiXb4+i3sWRcBKzUur5T zUcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UmIa1UBa; spf=pass (google.com: domain of linux-kernel+bounces-10699-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10699-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id p5-20020a17090ab90500b0028bbf3d667asi9000831pjr.71.2023.12.24.03.51.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 03:51:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10699-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UmIa1UBa; spf=pass (google.com: domain of linux-kernel+bounces-10699-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10699-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 689C6B21920 for ; Sun, 24 Dec 2023 11:51:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 86C564431; Sun, 24 Dec 2023 11:49:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="UmIa1UBa" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 692A2D534 for ; Sun, 24 Dec 2023 11:49:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ed1-f52.google.com with SMTP id 4fb4d7f45d1cf-554d9e63e46so30196a12.0 for ; Sun, 24 Dec 2023 03:49:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703418568; x=1704023368; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=KuoZ5gF8FMh++nKHkc2ffIG7u4Pa2qSYGztYC958mos=; b=UmIa1UBaNXU5hFgu1f9TZtqPgdpJi6WJH6ibyd4eKnz4c1MIWhQv/MR4jIVsnIRgel a70sLfPyMQp5Esu2WpHPyi7KpeX8pS2g7fk9ySA21oBwtGjcfqvYy4TL15in/XLZskXb mA6OZKrh0bL89nRoWGwF+v5x128G6Mx8hpRBOYkRCBz/6Gz15z4ASyf9F4sRqx499wxW /+hhSAyH5WLeF33pa4Qjk7cZxAMilKw/WxKRI1g1HmEJUhMDX3IYZDk2JZsb2wJdo6Em EdyjZM/qwdnjBg/r8xdrNINI8dX5btLOr160+AGKi3erAzQNrWgEkoznd4yE20JrKAx3 Pk4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703418568; x=1704023368; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KuoZ5gF8FMh++nKHkc2ffIG7u4Pa2qSYGztYC958mos=; b=fxzWan+/MaPbQ7Jzn1LtQEI8EymVYfDleab3assT2e+X4idbN1If1O78mNZGKFYhgA 383ItFJ4OZnQuiSISQ1WA5FZMNXoYk0Pq+O6LXGGtuvniNJXf7PpL4CIMJ3yy8RCHwM1 dTq3qJbCDkXYfE1ct0vouXPqgGXYVrk14UCdoKges8Ve1LGxECnG/JCEcxPtnSDPyowU fsi1cZfrHDguYwZJy1MV0D7zJMEtVb7xSua/VMml/y7U1/qQf2w+CCuZmor8zb8SA6uE cF2iKW2V1mquA1ax/fdNK8ke8jZ3tPZ3roSaSATIzF5/81AnUU4dXAJyBuhE4t5J2zg4 ppsA== X-Gm-Message-State: AOJu0YyNwWPbixl+toHjRTBF/baoeMdjMSwiOtVZSqcuioimdfRwMODP POqh0IUsUEMvihW5Niga5ihFtAk9DEOdAg== X-Received: by 2002:a50:d6d8:0:b0:554:42ed:d306 with SMTP id l24-20020a50d6d8000000b0055442edd306mr3320956edj.60.1703418567807; Sun, 24 Dec 2023 03:49:27 -0800 (PST) Received: from krzk-bin.. ([78.10.206.178]) by smtp.gmail.com with ESMTPSA id z23-20020aa7c657000000b0054ccac03945sm4999771edr.12.2023.12.24.03.49.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 03:49:27 -0800 (PST) From: Krzysztof Kozlowski To: Sylwester Nawrocki , Mauro Carvalho Chehab , Krzysztof Kozlowski , Alim Akhtar , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 07/12] media: fimc-is: constify local pointers to fimc_fmt Date: Sun, 24 Dec 2023 12:49:11 +0100 Message-Id: <20231224114916.111433-7-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231224114916.111433-1-krzysztof.kozlowski@linaro.org> References: <20231224114916.111433-1-krzysztof.kozlowski@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786163987009866451 X-GMAIL-MSGID: 1786163987009866451 Constify the local variable pointing to "struct fimc_fmt" to annotate the function is not modifying pointed data. This is the easy and obvious step of constifying all "struct fimc_fmt" instances. Signed-off-by: Krzysztof Kozlowski --- drivers/media/platform/samsung/exynos4-is/fimc-capture.c | 6 +++--- drivers/media/platform/samsung/exynos4-is/fimc-m2m.c | 4 ++-- drivers/media/platform/samsung/exynos4-is/fimc-reg.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-capture.c b/drivers/media/platform/samsung/exynos4-is/fimc-capture.c index 05cafba1c728..dde36e5be0c7 100644 --- a/drivers/media/platform/samsung/exynos4-is/fimc-capture.c +++ b/drivers/media/platform/samsung/exynos4-is/fimc-capture.c @@ -343,7 +343,7 @@ static int queue_setup(struct vb2_queue *vq, { struct fimc_ctx *ctx = vq->drv_priv; struct fimc_frame *frame = &ctx->d_frame; - struct fimc_fmt *fmt = frame->fmt; + const struct fimc_fmt *fmt = frame->fmt; unsigned long wh = frame->f_width * frame->f_height; int i; @@ -722,7 +722,7 @@ static int fimc_cap_querycap(struct file *file, void *priv, static int fimc_cap_enum_fmt(struct file *file, void *priv, struct v4l2_fmtdesc *f) { - struct fimc_fmt *fmt; + const struct fimc_fmt *fmt; fmt = fimc_find_format(NULL, NULL, FMT_FLAGS_CAM | FMT_FLAGS_M2M, f->index); @@ -1460,7 +1460,7 @@ static int fimc_subdev_enum_mbus_code(struct v4l2_subdev *sd, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_mbus_code_enum *code) { - struct fimc_fmt *fmt; + const struct fimc_fmt *fmt; fmt = fimc_find_format(NULL, NULL, FMT_FLAGS_CAM, code->index); if (!fmt) diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-m2m.c b/drivers/media/platform/samsung/exynos4-is/fimc-m2m.c index df8e2aa454d8..1918390a2469 100644 --- a/drivers/media/platform/samsung/exynos4-is/fimc-m2m.c +++ b/drivers/media/platform/samsung/exynos4-is/fimc-m2m.c @@ -237,7 +237,7 @@ static int fimc_m2m_querycap(struct file *file, void *fh, static int fimc_m2m_enum_fmt(struct file *file, void *priv, struct v4l2_fmtdesc *f) { - struct fimc_fmt *fmt; + const struct fimc_fmt *fmt; fmt = fimc_find_format(NULL, NULL, get_m2m_fmt_flags(f->type), f->index); @@ -266,7 +266,7 @@ static int fimc_try_fmt_mplane(struct fimc_ctx *ctx, struct v4l2_format *f) struct fimc_dev *fimc = ctx->fimc_dev; const struct fimc_variant *variant = fimc->variant; struct v4l2_pix_format_mplane *pix = &f->fmt.pix_mp; - struct fimc_fmt *fmt; + const struct fimc_fmt *fmt; u32 max_w, mod_x, mod_y; if (!IS_M2M(f->type)) diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-reg.c b/drivers/media/platform/samsung/exynos4-is/fimc-reg.c index f20fb74dd0c6..dbc43b703324 100644 --- a/drivers/media/platform/samsung/exynos4-is/fimc-reg.c +++ b/drivers/media/platform/samsung/exynos4-is/fimc-reg.c @@ -168,7 +168,7 @@ void fimc_hw_set_out_dma(struct fimc_ctx *ctx) struct fimc_dev *dev = ctx->fimc_dev; struct fimc_frame *frame = &ctx->d_frame; struct fimc_dma_offset *offset = &frame->dma_offset; - struct fimc_fmt *fmt = frame->fmt; + const struct fimc_fmt *fmt = frame->fmt; u32 cfg; /* Set the input dma offsets. */ From patchwork Sun Dec 24 11:49:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 183045 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp2094219dyi; Sun, 24 Dec 2023 03:52:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IGbPeR5WMDw1uJXBxTuZQsSox/8tfLIwYwMrlpCwBUu6Kd+jbhxlxJWGbL59toiPNh5ZXlb X-Received: by 2002:a05:622a:1c4:b0:427:a4eb:d7d0 with SMTP id t4-20020a05622a01c400b00427a4ebd7d0mr6780703qtw.103.1703418727188; Sun, 24 Dec 2023 03:52:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703418727; cv=none; d=google.com; s=arc-20160816; b=IPo+Hm74kTACAfcFi/WAKAG4/PETjKv+R0UcdvE62ENfrfeXggERtro8Ak4kTWTScR bPNAOBSGWwO+wBAsSUWmT9Kq/0q+BR68Dy0Px0DzWDiD+9JrkZu6eydCzXp26G1WtMLY 0uE/V7fG3XX1lUbRzmZf0tE4d79VAiFO5bzSe0VjmvQJCS97MUJxF2RdJ9A3V4++uYWZ mN/Hg2H12DFZG8gu4fwDP5B4K2dw66mCvBm0NgInNzTAQElLjG9Nv6FMqct2vDSAAcF2 A3pg05tRPquaCttC10f5W0EBub+vrNtJZhpZwQwpiTi6AjhS2+JaZZkJJ4kSyiLVTmYN msqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:to:from:dkim-signature; bh=JjqFsq9sE2uptvTEqYo0bWh4e8oH89aUsUBRl1B+TSU=; fh=FbjPzT9WWTKSglYskE+giKKmjX6PgCMhn86yvylggxU=; b=c4yODhNedCgLXZo9+NI4qgAzenAHiPAhBGxXijCgsZIsHV/HTmFBdqM6hveBhVm4tK DI02C3/G0KfpWN0qQSyKBAlmLE0wRPmZ7hNN/EoRj/CuVdCh9Qemxx34djM7J44y3KK1 6orfRcq1XtOlblS1pwAqJQF+WUbdBn5ObeJiuZC6z6++dCskwsGwtyT7OG3Btoqr573r X6lJwhx53vXBy+zynj3DZA0e6fJOTEBHxUTmZontOiQA8uBRhQ8bwr8kUdWszhwrlf1h 7zpCt1A9igazcYxQavKJtRqY9v3+1rkIkPsSAm8hfVVXDCFnEZICO4ScsHGLJTGcsZo7 KbUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=f9LpRJZA; spf=pass (google.com: domain of linux-kernel+bounces-10700-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10700-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id v40-20020a05622a18a800b004257ba79a12si8154858qtc.715.2023.12.24.03.52.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 03:52:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10700-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=f9LpRJZA; spf=pass (google.com: domain of linux-kernel+bounces-10700-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10700-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id E7E7B1C20A9B for ; Sun, 24 Dec 2023 11:52:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2093211CBC; Sun, 24 Dec 2023 11:49:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="f9LpRJZA" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BA856EAD9 for ; Sun, 24 Dec 2023 11:49:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-a1915034144so386074666b.0 for ; Sun, 24 Dec 2023 03:49:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703418569; x=1704023369; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=JjqFsq9sE2uptvTEqYo0bWh4e8oH89aUsUBRl1B+TSU=; b=f9LpRJZAgDsu9E0naEdeM0nrCx5w+40li/wNDtrwc6pKUBoxyKxfE9aXp9elpLI5vL 355SCipPJ8ZAy8HvTXPQ40Jc7u1GEct1shZPVjcLthslUJadPS42daT7Gp5ohc2VJE/k MPajUMeU4InHwEHe6kuktX0zySim/LkRGRxNsIO1YMd0NvU/S2ItessP+IU6STD/8/ni my4FVyWZaP1cRoD7PyWjG1k0gNsZ3Nx1yQ4gxIpLRcccpuBfzSiRbb8hADPKvJYUeKmj TIj2syXh6meOIu3LPRaq11Dwm7bydtDmzGToT87Ky3mUg47UhLYTKUhQDkd3lT8ziP4p qOoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703418569; x=1704023369; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JjqFsq9sE2uptvTEqYo0bWh4e8oH89aUsUBRl1B+TSU=; b=Wmf0Frb8x9/dX1QLbt8Ir2e/kTe+QwQ2ep1/hIIOVXNRlR8PTC7zskLt+Rt82PuKbc YhqLFHkir98GI2pd5tpC1EsapmOdN87/eyu7+SOt7DLdjByjGuVgWbm/lGtajUTANv0Q 7NONIHyupmzR14f1ZYE3Mn6Q1OVdKYZE3obP03LRb9hmYmzs/WXbRkHJWHY717gqaaVe aL9g6HMTcAFaphDcTip84gTMBH8uQpNRTw3oTrM2Md+6EtB8Ica1yAvhNM13vJcMrttS CQbseuFVNbrUnYCyPyrNG5rDoikbv9tqLa1+CzTDgLP9B4YeVo+BYQAxjY4jKNx7N3WO Ux8Q== X-Gm-Message-State: AOJu0Yxh37Eyl5GJGxdwlC+i12U5M+5AXJ8+QaTOjPHCYP7XCNaAaddd nsqWauoBLVW3LdU1r4j75u6HQJx6jGBXJQ== X-Received: by 2002:a05:6402:377:b0:553:9e98:517b with SMTP id s23-20020a056402037700b005539e98517bmr2753755edw.78.1703418569051; Sun, 24 Dec 2023 03:49:29 -0800 (PST) Received: from krzk-bin.. ([78.10.206.178]) by smtp.gmail.com with ESMTPSA id z23-20020aa7c657000000b0054ccac03945sm4999771edr.12.2023.12.24.03.49.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 03:49:28 -0800 (PST) From: Krzysztof Kozlowski To: Sylwester Nawrocki , Mauro Carvalho Chehab , Krzysztof Kozlowski , Alim Akhtar , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 08/12] media: fimc-is: constify fimc_formats array Date: Sun, 24 Dec 2023 12:49:12 +0100 Message-Id: <20231224114916.111433-8-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231224114916.111433-1-krzysztof.kozlowski@linaro.org> References: <20231224114916.111433-1-krzysztof.kozlowski@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786163995288046929 X-GMAIL-MSGID: 1786163995288046929 Pointers to elements of the static array "fimc_formats" with "struct fimc_fmt" are passed all around to various calls, but all of them do not modify pointed data. Constify the pointers everywhere which at the end allows to make static array "fimc_formats" const itself. Signed-off-by: Krzysztof Kozlowski --- .../samsung/exynos4-is/fimc-capture.c | 26 +++++++++---------- .../platform/samsung/exynos4-is/fimc-core.c | 11 ++++---- .../platform/samsung/exynos4-is/fimc-core.h | 9 ++++--- .../platform/samsung/exynos4-is/fimc-m2m.c | 7 ++--- 4 files changed, 28 insertions(+), 25 deletions(-) diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-capture.c b/drivers/media/platform/samsung/exynos4-is/fimc-capture.c index dde36e5be0c7..a3a677a3065f 100644 --- a/drivers/media/platform/samsung/exynos4-is/fimc-capture.c +++ b/drivers/media/platform/samsung/exynos4-is/fimc-capture.c @@ -559,9 +559,9 @@ static const struct v4l2_file_operations fimc_capture_fops = { * Format and crop negotiation helpers */ -static struct fimc_fmt *fimc_capture_try_format(struct fimc_ctx *ctx, - u32 *width, u32 *height, - u32 *code, u32 *fourcc, int pad) +static const struct fimc_fmt *fimc_capture_try_format(struct fimc_ctx *ctx, + u32 *width, u32 *height, + u32 *code, u32 *fourcc, int pad) { bool rotation = ctx->rotation == 90 || ctx->rotation == 270; struct fimc_dev *fimc = ctx->fimc_dev; @@ -569,8 +569,8 @@ static struct fimc_fmt *fimc_capture_try_format(struct fimc_ctx *ctx, const struct fimc_pix_limit *pl = var->pix_limit; struct fimc_frame *dst = &ctx->d_frame; u32 depth, min_w, max_w, min_h, align_h = 3; + const struct fimc_fmt *ffmt; u32 mask = FMT_FLAGS_CAM; - struct fimc_fmt *ffmt; /* Conversion from/to JPEG or User Defined format is not supported */ if (code && ctx->s_frame.fmt && pad == FIMC_SD_PAD_SOURCE && @@ -757,7 +757,7 @@ static struct media_entity *fimc_pipeline_get_head(struct media_entity *me) */ static int fimc_pipeline_try_format(struct fimc_ctx *ctx, struct v4l2_mbus_framefmt *tfmt, - struct fimc_fmt **fmt_id, + const struct fimc_fmt **fmt_id, bool set) { struct fimc_dev *fimc = ctx->fimc_dev; @@ -768,8 +768,8 @@ static int fimc_pipeline_try_format(struct fimc_ctx *ctx, : V4L2_SUBDEV_FORMAT_TRY, }; struct v4l2_mbus_framefmt *mf = &sfmt.format; + const struct fimc_fmt *ffmt; struct media_entity *me; - struct fimc_fmt *ffmt; struct media_pad *pad; int ret, i = 1; u32 fcc; @@ -903,8 +903,8 @@ static int fimc_cap_g_fmt_mplane(struct file *file, void *fh, */ static int __video_try_or_set_format(struct fimc_dev *fimc, struct v4l2_format *f, bool try, - struct fimc_fmt **inp_fmt, - struct fimc_fmt **out_fmt) + const struct fimc_fmt **inp_fmt, + const struct fimc_fmt **out_fmt) { struct v4l2_pix_format_mplane *pix = &f->fmt.pix_mp; struct fimc_vid_cap *vc = &fimc->vid_cap; @@ -986,7 +986,7 @@ static int fimc_cap_try_fmt_mplane(struct file *file, void *fh, struct v4l2_format *f) { struct fimc_dev *fimc = video_drvdata(file); - struct fimc_fmt *out_fmt = NULL, *inp_fmt = NULL; + const struct fimc_fmt *out_fmt = NULL, *inp_fmt = NULL; return __video_try_or_set_format(fimc, f, true, &inp_fmt, &out_fmt); } @@ -1012,7 +1012,7 @@ static int __fimc_capture_set_format(struct fimc_dev *fimc, struct fimc_ctx *ctx = vc->ctx; struct v4l2_pix_format_mplane *pix = &f->fmt.pix_mp; struct fimc_frame *ff = &ctx->d_frame; - struct fimc_fmt *inp_fmt = NULL; + const struct fimc_fmt *inp_fmt = NULL; int ret, i; if (vb2_is_busy(&fimc->vid_cap.vbq)) @@ -1519,7 +1519,7 @@ static int fimc_subdev_set_fmt(struct v4l2_subdev *sd, struct fimc_vid_cap *vc = &fimc->vid_cap; struct fimc_ctx *ctx = vc->ctx; struct fimc_frame *ff; - struct fimc_fmt *ffmt; + const struct fimc_fmt *ffmt; dbg("pad%d: code: 0x%x, %dx%d", fmt->pad, mf->code, mf->width, mf->height); @@ -1715,9 +1715,9 @@ static int fimc_register_capture_device(struct fimc_dev *fimc, { struct video_device *vfd = &fimc->vid_cap.ve.vdev; struct vb2_queue *q = &fimc->vid_cap.vbq; - struct fimc_ctx *ctx; struct fimc_vid_cap *vid_cap; - struct fimc_fmt *fmt; + const struct fimc_fmt *fmt; + struct fimc_ctx *ctx; int ret = -ENOMEM; ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-core.c b/drivers/media/platform/samsung/exynos4-is/fimc-core.c index 13b04fda8716..37f4952c7a9b 100644 --- a/drivers/media/platform/samsung/exynos4-is/fimc-core.c +++ b/drivers/media/platform/samsung/exynos4-is/fimc-core.c @@ -33,7 +33,7 @@ static const char *fimc_clocks[MAX_FIMC_CLOCKS] = { "sclk_fimc", "fimc" }; -static struct fimc_fmt fimc_formats[] = { +static const struct fimc_fmt fimc_formats[] = { { .fourcc = V4L2_PIX_FMT_RGB565, .depth = { 16 }, @@ -180,7 +180,7 @@ static struct fimc_fmt fimc_formats[] = { }, }; -struct fimc_fmt *fimc_get_format(unsigned int index) +const struct fimc_fmt *fimc_get_format(unsigned int index) { if (index >= ARRAY_SIZE(fimc_formats)) return NULL; @@ -752,10 +752,11 @@ void fimc_adjust_mplane_format(const struct fimc_fmt *fmt, u32 width, u32 height * @mask: the color flags to match * @index: offset in the fimc_formats array, ignored if negative */ -struct fimc_fmt *fimc_find_format(const u32 *pixelformat, const u32 *mbus_code, - unsigned int mask, int index) +const struct fimc_fmt *fimc_find_format(const u32 *pixelformat, + const u32 *mbus_code, + unsigned int mask, int index) { - struct fimc_fmt *fmt, *def_fmt = NULL; + const struct fimc_fmt *fmt, *def_fmt = NULL; unsigned int i; int id = 0; diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-core.h b/drivers/media/platform/samsung/exynos4-is/fimc-core.h index 261c9aac2f7f..63385152a2ff 100644 --- a/drivers/media/platform/samsung/exynos4-is/fimc-core.h +++ b/drivers/media/platform/samsung/exynos4-is/fimc-core.h @@ -257,7 +257,7 @@ struct fimc_frame { unsigned int bytesperline[VIDEO_MAX_PLANES]; struct fimc_addr addr; struct fimc_dma_offset dma_offset; - struct fimc_fmt *fmt; + const struct fimc_fmt *fmt; u8 alpha; }; @@ -617,9 +617,10 @@ void fimc_alpha_ctrl_update(struct fimc_ctx *ctx); void __fimc_get_format(const struct fimc_frame *frame, struct v4l2_format *f); void fimc_adjust_mplane_format(const struct fimc_fmt *fmt, u32 width, u32 height, struct v4l2_pix_format_mplane *pix); -struct fimc_fmt *fimc_find_format(const u32 *pixelformat, const u32 *mbus_code, - unsigned int mask, int index); -struct fimc_fmt *fimc_get_format(unsigned int index); +const struct fimc_fmt *fimc_find_format(const u32 *pixelformat, + const u32 *mbus_code, + unsigned int mask, int index); +const struct fimc_fmt *fimc_get_format(unsigned int index); int fimc_check_scaler_ratio(struct fimc_ctx *ctx, int sw, int sh, int dw, int dh, int rotation); diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-m2m.c b/drivers/media/platform/samsung/exynos4-is/fimc-m2m.c index 1918390a2469..e9023f64cfba 100644 --- a/drivers/media/platform/samsung/exynos4-is/fimc-m2m.c +++ b/drivers/media/platform/samsung/exynos4-is/fimc-m2m.c @@ -314,7 +314,8 @@ static int fimc_m2m_try_fmt_mplane(struct file *file, void *fh, return fimc_try_fmt_mplane(ctx, f); } -static void __set_frame_format(struct fimc_frame *frame, struct fimc_fmt *fmt, +static void __set_frame_format(struct fimc_frame *frame, + const struct fimc_fmt *fmt, struct v4l2_pix_format_mplane *pixm) { int i; @@ -340,7 +341,7 @@ static int fimc_m2m_s_fmt_mplane(struct file *file, void *fh, { struct fimc_ctx *ctx = fh_to_ctx(fh); struct fimc_dev *fimc = ctx->fimc_dev; - struct fimc_fmt *fmt; + const struct fimc_fmt *fmt; struct vb2_queue *vq; struct fimc_frame *frame; int ret; @@ -588,7 +589,7 @@ static int fimc_m2m_set_default_format(struct fimc_ctx *ctx) .sizeimage = 800 * 4 * 600, }, }; - struct fimc_fmt *fmt; + const struct fimc_fmt *fmt; fmt = fimc_find_format(&pixm.pixelformat, NULL, FMT_FLAGS_M2M, 0); if (!fmt) From patchwork Sun Dec 24 11:49:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 183046 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp2094287dyi; Sun, 24 Dec 2023 03:52:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IEzn3NDAXEDHx4R4Lnzd4JPvfFfFzegkUICVZrV4y/hk5OC2vSJ72G/+In6SXzPb/dBU805 X-Received: by 2002:a37:ad0b:0:b0:781:314b:bd32 with SMTP id f11-20020a37ad0b000000b00781314bbd32mr3241401qkm.135.1703418738922; Sun, 24 Dec 2023 03:52:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703418738; cv=none; d=google.com; s=arc-20160816; b=g9/ipcuq5zCTvdrAWi1saZHyGozDEP2iYQzmg0M0HDu8merbX9AekS9tWzP421e0a9 9zPJkhQ3HR5qWsK5w+XV/vgSMGj+eOnykMqJtQpnuDBDgfKna6I7RsZIIAhEEJ2i9dLw bwqMPIYnOifjxZP1gHQdijm8qrMM2RifD8Gadc3BnmLh5Jx7yFDrGpi0CZQ5FoaMCIre KKYiaC7YkGb7oTfy3XNAiFmRHT3cV3PJ2RpYSvL5M3TudCW7eZIgw1Z+MSaW8aB++rWu 81keGKaZva8KIxUlK+IWaMS97eAsLed/9up6mnxTzE6/WiEjIrsNCAidUUC+jfSbUr7n 1gOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:to:from:dkim-signature; bh=/UNgHZjW5MJWbUJfKL9ILAPKHDM87DLcYQJtFHdCq+c=; fh=FbjPzT9WWTKSglYskE+giKKmjX6PgCMhn86yvylggxU=; b=vSaeZPLPqX1da5BjR6TxQcjYnISf0hMMnFydBSp7t5LGL9t/O7GfGZG3xned01c1A8 q7oW9h6d5tl3dNiZGk38X9hXtdr3FhoKlp2stnzusenL8xjZGZ6QHiL1gkXexhpga3Uz lp0JaymWHhHuiBV7MnC3Zx4LMOZDRoid3mMceZ7bvSc2yAjrfn0Lc+CySNxJoqwkvgW8 qZY8YA2q1EnBruropES1qM/5FrXZygf0KsM1p4ejN6F7ITRqL3qOuu9v4wGWy21Vq1R6 4drJBJlVbWmrvw8IKFTlY1mLwsLgA1ssxh6FQvrrgHNDvsV+vl/teuDTu5Xxa/u0yGC1 D2qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TL0VEmtJ; spf=pass (google.com: domain of linux-kernel+bounces-10701-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10701-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id t15-20020a05620a450f00b0077f910fd6a4si8958677qkp.18.2023.12.24.03.52.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 03:52:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10701-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TL0VEmtJ; spf=pass (google.com: domain of linux-kernel+bounces-10701-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10701-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id B36381C20FDB for ; Sun, 24 Dec 2023 11:52:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CB655134CD; Sun, 24 Dec 2023 11:49:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="TL0VEmtJ" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C0999FC01 for ; Sun, 24 Dec 2023 11:49:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ed1-f42.google.com with SMTP id 4fb4d7f45d1cf-55333eb0312so2533303a12.1 for ; Sun, 24 Dec 2023 03:49:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703418570; x=1704023370; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=/UNgHZjW5MJWbUJfKL9ILAPKHDM87DLcYQJtFHdCq+c=; b=TL0VEmtJEetXuE3DFZRYNqR5MxBDNS+5EqDVYejyX5KVBAdpWLyxcfY5dlPuG/IcNB IchNHZ37be2QR9UjNGbIVpdt7dF67A1Tn7/I+huVZIk5cyFIfphLuLUnClFB7t8XCI50 f47Lu+IQCMN+hF47z7rZEWD5OgGUadEeWRWSY89mvaStTePi0SFOnxBX3jOvKYZpwBpQ mG5hL2lclOMj3CVlYX1sN8CAogsHdcmasSaBFX1PX+DjyeCIfeNOAi+Hhw7EP3c1aKwl q0UPrD8gpW1wKIqxwzL0yWkbN695/i8/UXRXIvicXKaYgx57rHRrFMhhd3wCdHpU9mXg aASA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703418570; x=1704023370; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/UNgHZjW5MJWbUJfKL9ILAPKHDM87DLcYQJtFHdCq+c=; b=rcDXsIXTDDENlpCZfz47uELqBMQpacRe63FMwzb7yjH2+YY+p6S8+D5ch0YveBOx0A Cor+NeH48kdyCUMateqExfNQlKQ9nhN+IFFVeAvofhkswnGvFvbIJJlnXu4pUOa2A4mz tyBVkGq/PFU+F6bpazwgxCh6amFP3bVurzj11OMZeiNd35sy0eNLO5idv1NNBq1hRkiu gvB2CnLAQLqU4XdiMmYeJUtwYMfNDjRyKhmZ5n/bgv2pzXyFWsD4/5DdU2p1FXeIkED5 OBzmOLUgsEX6nar3uLR8RI/fDGUDurHX/UtHX4fEk20EjYADeUl12YQeGjiMfOy+L4Gv 3MOg== X-Gm-Message-State: AOJu0Yytplb7+0T4v9OheZ0IDfBTEM/tqEj2T2zLngxyHEbMHmsQ1Xdh 8tLCaa2TAFg8OgwA5TFYemsvXosAGauf1g== X-Received: by 2002:a05:6402:20e:b0:553:4eb4:c231 with SMTP id t14-20020a056402020e00b005534eb4c231mr2492744edv.28.1703418570223; Sun, 24 Dec 2023 03:49:30 -0800 (PST) Received: from krzk-bin.. ([78.10.206.178]) by smtp.gmail.com with ESMTPSA id z23-20020aa7c657000000b0054ccac03945sm4999771edr.12.2023.12.24.03.49.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 03:49:29 -0800 (PST) From: Krzysztof Kozlowski To: Sylwester Nawrocki , Mauro Carvalho Chehab , Krzysztof Kozlowski , Alim Akhtar , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 09/12] media: fimc-is: constify pointers to v4l2_pix_format_mplane Date: Sun, 24 Dec 2023 12:49:13 +0100 Message-Id: <20231224114916.111433-9-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231224114916.111433-1-krzysztof.kozlowski@linaro.org> References: <20231224114916.111433-1-krzysztof.kozlowski@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786164007755261851 X-GMAIL-MSGID: 1786164007755261851 In few places functions do not modify pointed "struct v4l2_pix_format_mplane", thus the pointer can point to const data for additional safety and self-documenting intention of the function. Signed-off-by: Krzysztof Kozlowski --- drivers/media/platform/samsung/exynos4-is/fimc-capture.c | 2 +- drivers/media/platform/samsung/exynos4-is/fimc-isp-video.c | 2 +- drivers/media/platform/samsung/exynos4-is/fimc-m2m.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-capture.c b/drivers/media/platform/samsung/exynos4-is/fimc-capture.c index a3a677a3065f..7c2bcd5be933 100644 --- a/drivers/media/platform/samsung/exynos4-is/fimc-capture.c +++ b/drivers/media/platform/samsung/exynos4-is/fimc-capture.c @@ -1010,7 +1010,7 @@ static int __fimc_capture_set_format(struct fimc_dev *fimc, { struct fimc_vid_cap *vc = &fimc->vid_cap; struct fimc_ctx *ctx = vc->ctx; - struct v4l2_pix_format_mplane *pix = &f->fmt.pix_mp; + const struct v4l2_pix_format_mplane *pix = &f->fmt.pix_mp; struct fimc_frame *ff = &ctx->d_frame; const struct fimc_fmt *inp_fmt = NULL; int ret, i; diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-isp-video.c b/drivers/media/platform/samsung/exynos4-is/fimc-isp-video.c index 8fa26969c411..06c4352562b3 100644 --- a/drivers/media/platform/samsung/exynos4-is/fimc-isp-video.c +++ b/drivers/media/platform/samsung/exynos4-is/fimc-isp-video.c @@ -40,7 +40,7 @@ static int isp_video_capture_queue_setup(struct vb2_queue *vq, unsigned int sizes[], struct device *alloc_devs[]) { struct fimc_isp *isp = vb2_get_drv_priv(vq); - struct v4l2_pix_format_mplane *vid_fmt = &isp->video_capture.pixfmt; + const struct v4l2_pix_format_mplane *vid_fmt = &isp->video_capture.pixfmt; const struct fimc_fmt *fmt = isp->video_capture.format; unsigned int wh, i; diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-m2m.c b/drivers/media/platform/samsung/exynos4-is/fimc-m2m.c index e9023f64cfba..e5829a457f3d 100644 --- a/drivers/media/platform/samsung/exynos4-is/fimc-m2m.c +++ b/drivers/media/platform/samsung/exynos4-is/fimc-m2m.c @@ -316,7 +316,7 @@ static int fimc_m2m_try_fmt_mplane(struct file *file, void *fh, static void __set_frame_format(struct fimc_frame *frame, const struct fimc_fmt *fmt, - struct v4l2_pix_format_mplane *pixm) + const struct v4l2_pix_format_mplane *pixm) { int i; From patchwork Sun Dec 24 11:49:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 183048 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp2094433dyi; Sun, 24 Dec 2023 03:52:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IGzZ1mT82qBU0OLKCYripKIbMtzNlIApV/BP0wLmUxA0HqVbUFvQCL7qUv4QP4kYgWpEJpi X-Received: by 2002:a05:6a21:7894:b0:195:a66e:af72 with SMTP id bf20-20020a056a21789400b00195a66eaf72mr312016pzc.35.1703418776129; Sun, 24 Dec 2023 03:52:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703418776; cv=none; d=google.com; s=arc-20160816; b=TZFvWwJ/H1lEiYr+LZpdszPTT89R01oFP9GRKCFCX0Z3UtT8HvfibepvnFjyJHdyt3 ctnuFsIgrQrXoeCeQUMSms6bOm+9k0IcX2CXXQ7IblqAYmbHZsZigQ4tPkg3rxdxVb3M PdGJsFj074p0L4IXuGsao+lkLLcyhh5oTZHRmZ3UiIOIyiVWeLthFd+B4syhYZjW7VZL Frqv80dmD5B8QaZV3G8g00+rOWSW0DpYjTWMnnSdkCVXyBMxisTEou0JlV2FFoHzcxsz QonnABbMPs7x2aT3INpGLba9s04iL1Rl56XICLeO3Sb3iDBpfHoLhGlPL4lwkKJ2qcEB gqGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:to:from:dkim-signature; bh=ZqxFJT/Vp5f9kw7muiT1rKjgk7yNDMWKW8fhqHiMN7k=; fh=FbjPzT9WWTKSglYskE+giKKmjX6PgCMhn86yvylggxU=; b=ite8CiWyI9LOCg5kQi3ZeYjlR5fO/XadFrKDeDhd6QWxLJjFILC+r/zcZHc8MUAQNz ccADJfz/EDdJKVDGzMXtvoA6DqGg1bRlf8nLUUnk9A31X5rKZDr3tWJ2Lj9L85csqJ06 IgYYwq7QJ0lm6qmQPbyyFO6ESpEdeCFMh88Kf/hBMfFP6IUe4AFvN1NyH7yBTqAkdu2w qOn2U1nm+PGWgCP+aBBV7IJSQYQMMsyvX65eUu9dcCBC5NtIXzxE0CLzL4Mxwi/q2VvO 1VVFyPeyPZqA+cHA7IH4wAkftN9lW2P0HVAYKhNDOztJN/uJ80CbePWHQ7pRe36Jhrpg 7Vyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="yR/SNaCv"; spf=pass (google.com: domain of linux-kernel+bounces-10702-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10702-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id e6-20020a656486000000b005be00724141si6084388pgv.533.2023.12.24.03.52.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 03:52:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10702-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="yR/SNaCv"; spf=pass (google.com: domain of linux-kernel+bounces-10702-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10702-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 81FD4B21711 for ; Sun, 24 Dec 2023 11:52:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2D2225382; Sun, 24 Dec 2023 11:49:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="yR/SNaCv" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 100E910797 for ; Sun, 24 Dec 2023 11:49:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-55322dbabf6so3368703a12.0 for ; Sun, 24 Dec 2023 03:49:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703418571; x=1704023371; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=ZqxFJT/Vp5f9kw7muiT1rKjgk7yNDMWKW8fhqHiMN7k=; b=yR/SNaCvAI8rqaebDhMAsZXxYbx/oOD7oQIjPxhCz1jJBKRw9q74XoTsN0NTOCJ8uu c1YaNALbELql5FG3jQ4O5QaR/aOc/xMaiDB2owT2sMFglqoauK1hctv82lBi24UyXDaj oOSebY+o7HeiwV8XPYN7K68+ygMB6q7pLa2XiLdS090BIvRJVr0WqsD6mDV8EDPe5Q1L Z70B6oYV0yA/mup3QZdh1fhKkaWOxm60aSBx5SDwq4jGi/9oLBOlTXxDMUr2L4SFCVGh /+DVep8XfLG9Kr0OddAopHHnEi3pBJPWhqir0XSb70czFXnG7kfYfpLKwm1siTsFdBDZ YWjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703418571; x=1704023371; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZqxFJT/Vp5f9kw7muiT1rKjgk7yNDMWKW8fhqHiMN7k=; b=IBI3D/3X+l0OfDjRT8SvzswOb8ctSH6OV5iHizOhXQk1yAJ2/lqIGVFrc56nsW32qE knGcE83cUE1DCFCtTQtzj/8aDg/0Ag5OkqlWz2j/hI97qHBavFPT/jyfaBzzsdE+2F4N PMqngrf1vuCEKJz5i48DyKkRLlXxDJ+rERg8Grq1rWO5uIuMrLeC7+Op9dS+k6NIEd8L 4I7ILmGTrBf9FM2aqNWXQceuPvOeAn3NVPWRVm1Aoaf2RhxVm3fqxprhKMuGl9Y9gS83 e+R2UigNugJE0lhx1IR+MydjAbl8kitsaajhaI54ysBpVX9nPYl6ONwzlZm0o3EByJCT +pNQ== X-Gm-Message-State: AOJu0Yz1XuNbnKWQbvJyuAeZoy9Lq/kdtv6leQjTTHoAtsND1InFv/kC XPq99+p8YlKDJ6zTZOJUbBS3sMQQZiakrg== X-Received: by 2002:a50:8711:0:b0:551:9675:53c2 with SMTP id i17-20020a508711000000b00551967553c2mr2358523edb.49.1703418571430; Sun, 24 Dec 2023 03:49:31 -0800 (PST) Received: from krzk-bin.. ([78.10.206.178]) by smtp.gmail.com with ESMTPSA id z23-20020aa7c657000000b0054ccac03945sm4999771edr.12.2023.12.24.03.49.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 03:49:30 -0800 (PST) From: Krzysztof Kozlowski To: Sylwester Nawrocki , Mauro Carvalho Chehab , Krzysztof Kozlowski , Alim Akhtar , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 10/12] media: fimc-is: constify local pointers to fimc_dma_offset Date: Sun, 24 Dec 2023 12:49:14 +0100 Message-Id: <20231224114916.111433-10-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231224114916.111433-1-krzysztof.kozlowski@linaro.org> References: <20231224114916.111433-1-krzysztof.kozlowski@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786164047038389810 X-GMAIL-MSGID: 1786164047038389810 Constify the local variables pointing to "struct fimc_dma_offset" to annotate the function is not modifying pointed data. Signed-off-by: Krzysztof Kozlowski --- drivers/media/platform/samsung/exynos4-is/fimc-reg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-reg.c b/drivers/media/platform/samsung/exynos4-is/fimc-reg.c index dbc43b703324..0ed6e22e6c47 100644 --- a/drivers/media/platform/samsung/exynos4-is/fimc-reg.c +++ b/drivers/media/platform/samsung/exynos4-is/fimc-reg.c @@ -167,7 +167,7 @@ void fimc_hw_set_out_dma(struct fimc_ctx *ctx) { struct fimc_dev *dev = ctx->fimc_dev; struct fimc_frame *frame = &ctx->d_frame; - struct fimc_dma_offset *offset = &frame->dma_offset; + const struct fimc_dma_offset *offset = &frame->dma_offset; const struct fimc_fmt *fmt = frame->fmt; u32 cfg; @@ -421,7 +421,7 @@ void fimc_hw_set_in_dma(struct fimc_ctx *ctx) { struct fimc_dev *dev = ctx->fimc_dev; struct fimc_frame *frame = &ctx->s_frame; - struct fimc_dma_offset *offset = &frame->dma_offset; + const struct fimc_dma_offset *offset = &frame->dma_offset; u32 cfg; /* Set the pixel offsets. */ From patchwork Sun Dec 24 11:49:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 183047 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp2094404dyi; Sun, 24 Dec 2023 03:52:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IHJlawNZ/QcvsYbeJg1278kuBrNd1PRAOXopfrbE1UZjy1/A34t3T03jfpgcR5b0QYtUAOl X-Received: by 2002:a50:fa95:0:b0:553:4ec4:6980 with SMTP id w21-20020a50fa95000000b005534ec46980mr3013224edr.80.1703418767485; Sun, 24 Dec 2023 03:52:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703418767; cv=none; d=google.com; s=arc-20160816; b=s8MqMYahgEIvgG4FK50g1Y3ieds2iGys7Ww5PDmsng8uC+K9cFzqhRrOqxQT1ebGL8 L599fP0M3nTSNP5DPSVs6YJ2EP3iFQFR1p7AGlVpAnTcsQLqNGPf7Aum+yS3djqIkL1Q TjONnJqv7k+W3mu5risOWTQ0Y3qrq+t3CKMRsG1EQwqQVCQh+5N8EQ77Fe5Iwj/8EzRc PXW3j0Dhm7NL5/ojhADKmr3ooN2v3ilSS675m1G5dluP2QdAgxpAeoO5oWEhejTwESZl 0X2bdQGjepuc64IXSqml4Ft5b/I/Vebb407MbPe3/Ep1DeUooGWZWt7ABpOg8Teg4AcA WoxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:to:from:dkim-signature; bh=6CrVT5u4n/IC0zfDww/SiIGFgrbay7ubnhd7vT2k8No=; fh=FbjPzT9WWTKSglYskE+giKKmjX6PgCMhn86yvylggxU=; b=rMETS5kMXZ5fNXAoA6FWnyOAhRfBBBtQfZ+xnX3rfpFhuNpeczzoKZeptLvb7l63Fg wDM2YYXPX2QX3FHWMtjYaYjiXrn/05e+0vEbSkDf60oxxZUKukaz4G9HFO2M68oPX0HF 3DqreK0pRwBlV9xmCrEI65CRImkTYDkDWP2xS0AexC4z2F9wU1Vp5kj4Fc39JrYRAHKg iqA/Ge/xZmJieAeKL5LTur2DWtUzmCtWpGkFE9PXv5n27LN7R9Xgp5uJTTU0bHZfwCUw GgPkwYk+NtnsF/QESaSozFqc8u4Uhd4Yx3wxPk+ShIofeAQZ7MeP3uRhNvcYyxmlmTCQ OEvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="hx4/6cTm"; spf=pass (google.com: domain of linux-kernel+bounces-10703-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10703-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id f9-20020a50a6c9000000b00554a2109ff9si1043381edc.76.2023.12.24.03.52.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 03:52:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10703-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="hx4/6cTm"; spf=pass (google.com: domain of linux-kernel+bounces-10703-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10703-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id E397A1F21983 for ; Sun, 24 Dec 2023 11:52:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 38E77171A8; Sun, 24 Dec 2023 11:49:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="hx4/6cTm" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ed1-f49.google.com (mail-ed1-f49.google.com [209.85.208.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 333EE11190 for ; Sun, 24 Dec 2023 11:49:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ed1-f49.google.com with SMTP id 4fb4d7f45d1cf-554909ac877so815057a12.1 for ; Sun, 24 Dec 2023 03:49:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703418572; x=1704023372; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=6CrVT5u4n/IC0zfDww/SiIGFgrbay7ubnhd7vT2k8No=; b=hx4/6cTmyZe28lsSxcGeRVDo28RRvxBkiIMKTesJFb9KqgBQd16ericwRXpTPPTRQZ R1kGcRhUbAine9rQ5GvSWPhMUPFupt8yRUhcD48WScVTnq21tQmMte8TQenXkgnabE/e 4EUMZbPXL79Gv4KqB7PmnWhUKnoMjYqynURA3Ahf0mW3BRGUpBUgwTUMC1vVUXYSm5gl w7fjnfmgBVdCY588/v7nKR9zZRFJk9C98nNOVsBQMobWA6ADj+j3buqTEWUSoHatFSgL BpZMCGo7cdNXBoY4Nu+YXOug8XwVOVuqPIfFlGZwllMRg3RwJ1UzXmIGoLvPIA6aRjmP 9ILg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703418572; x=1704023372; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6CrVT5u4n/IC0zfDww/SiIGFgrbay7ubnhd7vT2k8No=; b=cWWJDlWBxufdFCfZKUBvlKKaiNZR0Ev0eevlQQqwAJO/jkx84Ie+N1M1rXVOlaw0ew ei1PO89pG6RWnciuHHI8khvJ0ny3QWcy+5Rl2bxyf/2gnicruzW0AWajwRn8ZWrNZZl8 DfCDOP//c/PzLxK+31fKXF1PhSUB1Dzy/V4lWh3piPeAKbPOEV05WFK8eCwlTMrVDrry BJzA08NLsfeWmhdWhBTsKWDH91/SV51bXY6XZNnur+/oEiHj7JgT0vJ9l8qqRqNmxzw6 Kk/IjQInYxktI6RN/dZXFHLac9Y3apPU7GMHz+MfAhAj756UiHc3ICjACdCFmbyU/WxF G40A== X-Gm-Message-State: AOJu0YzbMutjtKRI2EUlh5EhLmODwat1rbyuXqoJwfG2+ktqBgERc9ht XvbWj3nytNo97ir4qIERKqYBF8FNFksjMQ== X-Received: by 2002:a50:d00a:0:b0:554:7b04:f889 with SMTP id j10-20020a50d00a000000b005547b04f889mr1861601edf.18.1703418572580; Sun, 24 Dec 2023 03:49:32 -0800 (PST) Received: from krzk-bin.. ([78.10.206.178]) by smtp.gmail.com with ESMTPSA id z23-20020aa7c657000000b0054ccac03945sm4999771edr.12.2023.12.24.03.49.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 03:49:32 -0800 (PST) From: Krzysztof Kozlowski To: Sylwester Nawrocki , Mauro Carvalho Chehab , Krzysztof Kozlowski , Alim Akhtar , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 11/12] media: fimc-is: constify local pointers to fimc_vid_cap Date: Sun, 24 Dec 2023 12:49:15 +0100 Message-Id: <20231224114916.111433-11-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231224114916.111433-1-krzysztof.kozlowski@linaro.org> References: <20231224114916.111433-1-krzysztof.kozlowski@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786164037413632488 X-GMAIL-MSGID: 1786164037413632488 Constify the local variables pointing to "struct fimc_vid_cap" to annotate the function is not modifying pointed data. Signed-off-by: Krzysztof Kozlowski --- drivers/media/platform/samsung/exynos4-is/fimc-reg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-reg.c b/drivers/media/platform/samsung/exynos4-is/fimc-reg.c index 0ed6e22e6c47..edff6e5179cf 100644 --- a/drivers/media/platform/samsung/exynos4-is/fimc-reg.c +++ b/drivers/media/platform/samsung/exynos4-is/fimc-reg.c @@ -598,7 +598,7 @@ static const struct mbus_pixfmt_desc pix_desc[] = { int fimc_hw_set_camera_source(struct fimc_dev *fimc, struct fimc_source_info *source) { - struct fimc_vid_cap *vc = &fimc->vid_cap; + const struct fimc_vid_cap *vc = &fimc->vid_cap; struct fimc_frame *f = &vc->ctx->s_frame; u32 bus_width, cfg = 0; int i; @@ -670,7 +670,7 @@ void fimc_hw_set_camera_offset(struct fimc_dev *fimc, const struct fimc_frame *f int fimc_hw_set_camera_type(struct fimc_dev *fimc, const struct fimc_source_info *source) { - struct fimc_vid_cap *vid_cap = &fimc->vid_cap; + const struct fimc_vid_cap *vid_cap = &fimc->vid_cap; u32 csis_data_alignment = 32; u32 cfg, tmp; From patchwork Sun Dec 24 11:49:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 183049 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp2094450dyi; Sun, 24 Dec 2023 03:53:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IEuNVfpd72mhga+urYvG8wVNTtulTC42aD3ryEwPJHaAYTEk7r1Q9XUdtPiTOAHysGw6yyv X-Received: by 2002:a50:999d:0:b0:553:434f:d5c6 with SMTP id m29-20020a50999d000000b00553434fd5c6mr2772213edb.48.1703418781313; Sun, 24 Dec 2023 03:53:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703418781; cv=none; d=google.com; s=arc-20160816; b=C+WQiZB/suMtHBW1302TRa3NugEpxmET3fHElYf8ckk5mD8LmoaPd6PILnG5kWHhRH MloGTVw3fwo8Cbgku602W8KPQ8RFqKAmFPjIam0qr9uFLOENBXI9SsXzem6gOWRoEKEb u7A0rPB4FvlyIU/y719+WpgWNijotqa/Z0AqhlLFogQgM3kBVDAUUus6C/aNGSAjOjU6 agH4jHF5j5P8OoYqpscWdWjDvltaN6b6oRYC+Wi3MG2X7BZppwuBMOKImxVFVXIvAJ2H gukvDX6qjbqX7gU7AGKWoziXfO01QGiCK0AczFe2Y7SsKoo4QmW+IntPuwxkljjfaNPG fx0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:to:from:dkim-signature; bh=Hz+LJHTWuf+0lRGoDC5k9tAjKQBt8mGUWlE7LUoWo8w=; fh=FbjPzT9WWTKSglYskE+giKKmjX6PgCMhn86yvylggxU=; b=IMgeAj8bG8hmLjgXEdMvIkggJP2fxsYGXqmMSCYvn8z30XVOkz9kh0qio8KVL2csAX 6E2IuQcKSFSLmGQaWQeyW0STBkhA289CW02ee5S2jD7nma6RdKZccwud+xrpXG/JsDak QgJzGgXAlZPcmQZOc4SZAFp5VT6O8xfeZ2Wn7NANZTYw3AH1k42yBI41h0SLqQo0klHj IAv7Td9NevQw0IeLGDUG0vKHTIwSLX/as7gEmPcZ1TBqkCr28u8soxHOJhdvV1/LtU2F q0fS+l35MvI4XfCyi2bfq5Q57ZgoGpZMwZF1cbgXlxKvTVIrznFGLaq+/2ZMQBwJ18KG lgOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Wxpc7lWp; spf=pass (google.com: domain of linux-kernel+bounces-10704-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10704-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a4-20020a05640213c400b005549bef12b0si1079272edx.15.2023.12.24.03.53.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 03:53:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10704-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Wxpc7lWp; spf=pass (google.com: domain of linux-kernel+bounces-10704-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10704-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id C0C4B1F2196C for ; Sun, 24 Dec 2023 11:53:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EE6EE17990; Sun, 24 Dec 2023 11:49:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Wxpc7lWp" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5C1F812E58 for ; Sun, 24 Dec 2023 11:49:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ed1-f47.google.com with SMTP id 4fb4d7f45d1cf-554dbe1857dso1840a12.3 for ; Sun, 24 Dec 2023 03:49:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703418574; x=1704023374; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=Hz+LJHTWuf+0lRGoDC5k9tAjKQBt8mGUWlE7LUoWo8w=; b=Wxpc7lWpB8cZDkaWloeEyIqtJbRByWtKiwgWNsaMgmhPZZHLcbOOq1qpgNMrNblkjl mjDbjhs4C7SkbxHT///d3nZBqWFPyJ6ALH0PXCfkh3ln4vDZRhpCNp8hA+MXb/YfsfG8 B2xNJ1bhz8eibR9IVgHgAkgWxqk80bR5k++TJh24j1vcgj6UTS2x5mxVMzsOwQ/S3Vxs x99p7YHvmwngx53lvGsFy3FDEY9UxioFaJZwrE6g8HKqzHJnTa0pYOaYFy+r+igWQvpR wxY/qg1kSrLMAtJo3F7hBxaw6nnQeH0vbzXBlAkKaW1ukV7mKg22Qk5Vp5YGTSJEP6tC 0nog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703418574; x=1704023374; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Hz+LJHTWuf+0lRGoDC5k9tAjKQBt8mGUWlE7LUoWo8w=; b=Pq9XfR1c1BWYxRErABVqxnKUENr0cId+jGDjpRTqfryEgSMAdpeAaa41UQe2pQCDvB K0zCkLMOkoCVHO1SnbCZ2HwKAIFfZRecR244HFn3qEbHagM2uEzq2Y6Z077otJeDhroF AErKYyKSWP5Gthsm7ARn8QOqWBP5YP/kzAMmyWYC/VgQtKpWHEp/KPdn8lFnhqgT0wod WPo7Yc2Pri7lAtXbVQlw1mXPhbTvIEpIWMqNk4qz7NoFF3Lj0iA/s52qY2y3LdEjcebg uF9M24wQgC06fg5mM2PscKUqSsCJYtZigS5rM9K1c0bqHtFC2bwtxFhmuGNiAgJ0BSMs rpbw== X-Gm-Message-State: AOJu0YwYL26ejldExj1GmzJ1byTV7BW7YEJw117/dN7bPKbUFSi3CQmx N2xi4hQEuCCei0NykNeW3EEDmYETuYTG+w== X-Received: by 2002:a50:9b03:0:b0:554:526d:894e with SMTP id o3-20020a509b03000000b00554526d894emr2750369edi.1.1703418573789; Sun, 24 Dec 2023 03:49:33 -0800 (PST) Received: from krzk-bin.. ([78.10.206.178]) by smtp.gmail.com with ESMTPSA id z23-20020aa7c657000000b0054ccac03945sm4999771edr.12.2023.12.24.03.49.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 03:49:33 -0800 (PST) From: Krzysztof Kozlowski To: Sylwester Nawrocki , Mauro Carvalho Chehab , Krzysztof Kozlowski , Alim Akhtar , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 12/12] media: fimc-is: constify local pointers to fimc_frame Date: Sun, 24 Dec 2023 12:49:16 +0100 Message-Id: <20231224114916.111433-12-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231224114916.111433-1-krzysztof.kozlowski@linaro.org> References: <20231224114916.111433-1-krzysztof.kozlowski@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786164052400742284 X-GMAIL-MSGID: 1786164052400742284 Constify the local variables pointing to "struct fimc_frame" to annotate the function is not modifying pointed data. Signed-off-by: Krzysztof Kozlowski --- .../platform/samsung/exynos4-is/fimc-capture.c | 18 +++++++++--------- .../platform/samsung/exynos4-is/fimc-core.c | 4 ++-- .../platform/samsung/exynos4-is/fimc-m2m.c | 10 +++++----- .../platform/samsung/exynos4-is/fimc-reg.c | 18 +++++++++--------- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-capture.c b/drivers/media/platform/samsung/exynos4-is/fimc-capture.c index 7c2bcd5be933..ffa4ea21387d 100644 --- a/drivers/media/platform/samsung/exynos4-is/fimc-capture.c +++ b/drivers/media/platform/samsung/exynos4-is/fimc-capture.c @@ -180,7 +180,7 @@ void fimc_capture_irq_handler(struct fimc_dev *fimc, int deq_buf) struct fimc_vid_cap *cap = &fimc->vid_cap; struct fimc_pipeline *p = to_fimc_pipeline(cap->ve.pipe); struct v4l2_subdev *csis = p->subdevs[IDX_CSIS]; - struct fimc_frame *f = &cap->ctx->d_frame; + const struct fimc_frame *f = &cap->ctx->d_frame; struct fimc_vid_buffer *v_buf; if (test_and_clear_bit(ST_CAPT_SHUT, &fimc->state)) { @@ -342,7 +342,7 @@ static int queue_setup(struct vb2_queue *vq, unsigned int sizes[], struct device *alloc_devs[]) { struct fimc_ctx *ctx = vq->drv_priv; - struct fimc_frame *frame = &ctx->d_frame; + const struct fimc_frame *frame = &ctx->d_frame; const struct fimc_fmt *fmt = frame->fmt; unsigned long wh = frame->f_width * frame->f_height; int i; @@ -567,7 +567,7 @@ static const struct fimc_fmt *fimc_capture_try_format(struct fimc_ctx *ctx, struct fimc_dev *fimc = ctx->fimc_dev; const struct fimc_variant *var = fimc->variant; const struct fimc_pix_limit *pl = var->pix_limit; - struct fimc_frame *dst = &ctx->d_frame; + const struct fimc_frame *dst = &ctx->d_frame; u32 depth, min_w, max_w, min_h, align_h = 3; const struct fimc_fmt *ffmt; u32 mask = FMT_FLAGS_CAM; @@ -644,7 +644,7 @@ static void fimc_capture_try_selection(struct fimc_ctx *ctx, struct fimc_dev *fimc = ctx->fimc_dev; const struct fimc_variant *var = fimc->variant; const struct fimc_pix_limit *pl = var->pix_limit; - struct fimc_frame *sink = &ctx->s_frame; + const struct fimc_frame *sink = &ctx->s_frame; u32 max_w, max_h, min_w = 0, min_h = 0, min_sz; u32 align_sz = 0, align_h = 4; u32 max_sc_h, max_sc_v; @@ -1132,7 +1132,7 @@ static int fimc_pipeline_validate(struct fimc_dev *fimc) /* Don't call FIMC subdev operation to avoid nested locking */ if (sd == &vc->subdev) { - struct fimc_frame *ff = &vc->ctx->s_frame; + const struct fimc_frame *ff = &vc->ctx->s_frame; sink_fmt.format.width = ff->f_width; sink_fmt.format.height = ff->f_height; sink_fmt.format.code = ff->fmt ? ff->fmt->mbus_code : 0; @@ -1158,7 +1158,7 @@ static int fimc_pipeline_validate(struct fimc_dev *fimc) if (sd == p->subdevs[IDX_SENSOR] && fimc_user_defined_mbus_fmt(src_fmt.format.code)) { struct v4l2_plane_pix_format plane_fmt[FIMC_MAX_PLANES]; - struct fimc_frame *frame = &vc->ctx->d_frame; + const struct fimc_frame *frame = &vc->ctx->d_frame; unsigned int i; ret = fimc_get_sensor_frame_desc(sd, plane_fmt, @@ -1263,7 +1263,7 @@ static int fimc_cap_g_selection(struct file *file, void *fh, { struct fimc_dev *fimc = video_drvdata(file); struct fimc_ctx *ctx = fimc->vid_cap.ctx; - struct fimc_frame *f = &ctx->s_frame; + const struct fimc_frame *f = &ctx->s_frame; if (s->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) return -EINVAL; @@ -1475,7 +1475,7 @@ static int fimc_subdev_get_fmt(struct v4l2_subdev *sd, { struct fimc_dev *fimc = v4l2_get_subdevdata(sd); struct fimc_ctx *ctx = fimc->vid_cap.ctx; - struct fimc_frame *ff = &ctx->s_frame; + const struct fimc_frame *ff = &ctx->s_frame; struct v4l2_mbus_framefmt *mf; if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) { @@ -1582,7 +1582,7 @@ static int fimc_subdev_get_selection(struct v4l2_subdev *sd, { struct fimc_dev *fimc = v4l2_get_subdevdata(sd); struct fimc_ctx *ctx = fimc->vid_cap.ctx; - struct fimc_frame *f = &ctx->s_frame; + const struct fimc_frame *f = &ctx->s_frame; struct v4l2_rect *r = &sel->r; struct v4l2_rect *try_sel; diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-core.c b/drivers/media/platform/samsung/exynos4-is/fimc-core.c index 37f4952c7a9b..1f627f257359 100644 --- a/drivers/media/platform/samsung/exynos4-is/fimc-core.c +++ b/drivers/media/platform/samsung/exynos4-is/fimc-core.c @@ -228,8 +228,8 @@ int fimc_set_scaler_info(struct fimc_ctx *ctx) const struct fimc_variant *variant = ctx->fimc_dev->variant; struct device *dev = &ctx->fimc_dev->pdev->dev; struct fimc_scaler *sc = &ctx->scaler; - struct fimc_frame *s_frame = &ctx->s_frame; - struct fimc_frame *d_frame = &ctx->d_frame; + const struct fimc_frame *s_frame = &ctx->s_frame; + const struct fimc_frame *d_frame = &ctx->d_frame; int tx, ty, sx, sy; int ret; diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-m2m.c b/drivers/media/platform/samsung/exynos4-is/fimc-m2m.c index e5829a457f3d..199997eec1cc 100644 --- a/drivers/media/platform/samsung/exynos4-is/fimc-m2m.c +++ b/drivers/media/platform/samsung/exynos4-is/fimc-m2m.c @@ -170,7 +170,7 @@ static int fimc_queue_setup(struct vb2_queue *vq, unsigned int sizes[], struct device *alloc_devs[]) { struct fimc_ctx *ctx = vb2_get_drv_priv(vq); - struct fimc_frame *f; + const struct fimc_frame *f; int i; f = ctx_get_frame(ctx, vq->type); @@ -192,7 +192,7 @@ static int fimc_queue_setup(struct vb2_queue *vq, static int fimc_buf_prepare(struct vb2_buffer *vb) { struct fimc_ctx *ctx = vb2_get_drv_priv(vb->vb2_queue); - struct fimc_frame *frame; + const struct fimc_frame *frame; int i; frame = ctx_get_frame(ctx, vb->vb2_queue->type); @@ -252,7 +252,7 @@ static int fimc_m2m_g_fmt_mplane(struct file *file, void *fh, struct v4l2_format *f) { struct fimc_ctx *ctx = fh_to_ctx(fh); - struct fimc_frame *frame = ctx_get_frame(ctx, f->type); + const struct fimc_frame *frame = ctx_get_frame(ctx, f->type); if (IS_ERR(frame)) return PTR_ERR(frame); @@ -379,7 +379,7 @@ static int fimc_m2m_g_selection(struct file *file, void *fh, struct v4l2_selection *s) { struct fimc_ctx *ctx = fh_to_ctx(fh); - struct fimc_frame *frame; + const struct fimc_frame *frame; frame = ctx_get_frame(ctx, s->type); if (IS_ERR(frame)) @@ -429,7 +429,7 @@ static int fimc_m2m_try_selection(struct fimc_ctx *ctx, struct v4l2_selection *s) { struct fimc_dev *fimc = ctx->fimc_dev; - struct fimc_frame *f; + const struct fimc_frame *f; u32 min_size, halign, depth = 0; int i; diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-reg.c b/drivers/media/platform/samsung/exynos4-is/fimc-reg.c index edff6e5179cf..b4ee39e471e7 100644 --- a/drivers/media/platform/samsung/exynos4-is/fimc-reg.c +++ b/drivers/media/platform/samsung/exynos4-is/fimc-reg.c @@ -105,7 +105,7 @@ void fimc_hw_set_target_format(struct fimc_ctx *ctx) { u32 cfg; struct fimc_dev *dev = ctx->fimc_dev; - struct fimc_frame *frame = &ctx->d_frame; + const struct fimc_frame *frame = &ctx->d_frame; dbg("w= %d, h= %d color: %d", frame->width, frame->height, frame->fmt->color); @@ -147,7 +147,7 @@ void fimc_hw_set_target_format(struct fimc_ctx *ctx) static void fimc_hw_set_out_dma_size(struct fimc_ctx *ctx) { struct fimc_dev *dev = ctx->fimc_dev; - struct fimc_frame *frame = &ctx->d_frame; + const struct fimc_frame *frame = &ctx->d_frame; u32 cfg; cfg = (frame->f_height << 16) | frame->f_width; @@ -166,7 +166,7 @@ static void fimc_hw_set_out_dma_size(struct fimc_ctx *ctx) void fimc_hw_set_out_dma(struct fimc_ctx *ctx) { struct fimc_dev *dev = ctx->fimc_dev; - struct fimc_frame *frame = &ctx->d_frame; + const struct fimc_frame *frame = &ctx->d_frame; const struct fimc_dma_offset *offset = &frame->dma_offset; const struct fimc_fmt *fmt = frame->fmt; u32 cfg; @@ -248,8 +248,8 @@ static void fimc_hw_set_scaler(struct fimc_ctx *ctx) { struct fimc_dev *dev = ctx->fimc_dev; struct fimc_scaler *sc = &ctx->scaler; - struct fimc_frame *src_frame = &ctx->s_frame; - struct fimc_frame *dst_frame = &ctx->d_frame; + const struct fimc_frame *src_frame = &ctx->s_frame; + const struct fimc_frame *dst_frame = &ctx->d_frame; u32 cfg = readl(dev->regs + FIMC_REG_CISCCTRL); @@ -388,7 +388,7 @@ void fimc_hw_set_effect(struct fimc_ctx *ctx) void fimc_hw_set_rgb_alpha(struct fimc_ctx *ctx) { struct fimc_dev *dev = ctx->fimc_dev; - struct fimc_frame *frame = &ctx->d_frame; + const struct fimc_frame *frame = &ctx->d_frame; u32 cfg; if (!(frame->fmt->flags & FMT_HAS_ALPHA)) @@ -403,7 +403,7 @@ void fimc_hw_set_rgb_alpha(struct fimc_ctx *ctx) static void fimc_hw_set_in_dma_size(struct fimc_ctx *ctx) { struct fimc_dev *dev = ctx->fimc_dev; - struct fimc_frame *frame = &ctx->s_frame; + const struct fimc_frame *frame = &ctx->s_frame; u32 cfg_o = 0; u32 cfg_r = 0; @@ -420,7 +420,7 @@ static void fimc_hw_set_in_dma_size(struct fimc_ctx *ctx) void fimc_hw_set_in_dma(struct fimc_ctx *ctx) { struct fimc_dev *dev = ctx->fimc_dev; - struct fimc_frame *frame = &ctx->s_frame; + const struct fimc_frame *frame = &ctx->s_frame; const struct fimc_dma_offset *offset = &frame->dma_offset; u32 cfg; @@ -599,7 +599,7 @@ int fimc_hw_set_camera_source(struct fimc_dev *fimc, struct fimc_source_info *source) { const struct fimc_vid_cap *vc = &fimc->vid_cap; - struct fimc_frame *f = &vc->ctx->s_frame; + const struct fimc_frame *f = &vc->ctx->s_frame; u32 bus_width, cfg = 0; int i;