From patchwork Sun Dec 24 15:44:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 183073 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp10452dyb; Sun, 24 Dec 2023 07:45:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IFp27FJ4CpGAGkRQI7OUJZs9QPqOy0AmsBG6SMYR/cTr5EAVgaTmOeTQTw7HX9oTDNofnbk X-Received: by 2002:a17:902:e808:b0:1d4:3b60:524d with SMTP id u8-20020a170902e80800b001d43b60524dmr744978plg.5.1703432728081; Sun, 24 Dec 2023 07:45:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703432728; cv=none; d=google.com; s=arc-20160816; b=coloZXcbE3I7LVv9mzgOoW3qoK9cbtkkgc1zxl9m8nTlXewuc6clTndjcfQPF3U9FB ngNY8AlGAQ0lLZ+7+vHS3PYxbH0x13h53EdnIfTGgrTuRa3dxUrD6133gvPWPTdxG1bw iHbpvmuieNV2k+ntGlMGzrHar5diKUAu2z5yr6SVDaG589mjF6NuA+lxvCNWeEwp1vEm m7EG/kxgHOWgO6lhS+nrYul7cco6RIUFJY4uh1NP3DUSnsIxEiWmmXVKS+OE2Zg9+5WR i/PrhI01XM3mlT+dDDtXz1mOqdwq4XdUGfjQdsYT2IEPuyct7NvrcDyZYiOEEhH4CPzI ubGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=yNd+wTCLOu2wQWwqwquwYCDRzJ5XXbRrd/Bj+DUUyIM=; fh=nSSm1dUQDcfnFFwPmoq1SJ6NHxkx1o/ly8tYDPd/KV4=; b=VPYMXXKAGFYWep6cyaOHWGimNkUf+JqLpl8EMnAWqX7e2GstegxPZERlWaOY+Sn65H h/f5HcGIxpkcNJSlzul/XrXQH1Ct6emybjrIXkYC+hqrM72p/u8Rt4aL9XQ1EoMdhUxW 37kjlex6ixJs4aKRJiptoPIPNCDdOMvMZNTY1+bT91Br0rdExgP6o5+r1GTGtoIumaFf C2d/D7pYMaoSCLNajh6f1K8bakgCgaAelOmDmWUOH0bAg0qrBNOi3LsGHFvzZiEncUoq JCeA44g5hnkOix9AVYREwgF+lvNXyVhd+O6BIRLk/jQtKlSao1xPDkNVnvECu0G9rl53 B/kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NxayP9rb; spf=pass (google.com: domain of linux-kernel+bounces-10740-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10740-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 y8-20020a17090264c800b001d3ed273d70si6366134pli.579.2023.12.24.07.45.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 07:45:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10740-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=NxayP9rb; spf=pass (google.com: domain of linux-kernel+bounces-10740-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10740-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 05F4CB21340 for ; Sun, 24 Dec 2023 15:45:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 85CFADDD6; Sun, 24 Dec 2023 15:44:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="NxayP9rb" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.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 5F55D6ADB for ; Sun, 24 Dec 2023 15:44: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-ej1-f53.google.com with SMTP id a640c23a62f3a-a2331caab22so342380166b.3 for ; Sun, 24 Dec 2023 07:44:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703432670; x=1704037470; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=yNd+wTCLOu2wQWwqwquwYCDRzJ5XXbRrd/Bj+DUUyIM=; b=NxayP9rbvEBR+WetGoHIjjxxdpaEiZUkqzxt3Mata+Re7PT0pqPs3Z/qvVyowbESCY xugOHVPwrMyYOVuadYEvpuhGhvJOzK8YO/0nczpJ0TzHxhoFiDPZyYw6sl9eYSgrnfsU f5i0dCKL+YLa5HryClV2at6XBqh5ztmSn21IJXMJ6IlQeU8Pf5a7A/elBU0QQIYfBs7/ bOPlEQ01QOC5GoubExDOXQjsqzzq4IPHoXdfbBvfYUcLzY2QFhkscqboNQdkYjcKfw+M GHMislCR7nMtxWC4U4IJdeBFzWe9/wOtD6W6tYOaWqkfJaI5QcxcAW996AWTfelyFQWf E/3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703432670; x=1704037470; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yNd+wTCLOu2wQWwqwquwYCDRzJ5XXbRrd/Bj+DUUyIM=; b=EEDqSYAa4D4ZRUOTMfiJjNk7qJcHLwg4Mq6rN52r6UlBVLhOUuBRTySRBjVk76o3iS v/KqdcwRBKUaeyL0uD3oNsYgBn5rMXd06Y6Xz4HMej1m1vjpKwoeVsH3URgGpGHTLzxl TAgKw61ZoLpQFv7YIzIqRRQOxYGtZHVlZqUCBMMGOLDHwwMRI5WJAegyQJDbnBy+kK0H mgf1ok3eQJetM6PL6agrI6Nlbxd1uVwdn/vVy4qmhc4FIlZwsSrR7it18Vkc26ZcrFvw H/r0Wl8Yx7NTaUVsUsBYKBAYvov5NUaXFPFPF3kDnWsLcGN+wz7S54/sylesRBRyiGwe KY0w== X-Gm-Message-State: AOJu0Yz+dWnpKqxMQtB2+nsBLY/r8WGjrGn/PJNKgUBMnMZDxNuTz7kj GFsi+G+iwfxe9Cb1JqybbYX3scwV7hX8BA== X-Received: by 2002:a17:906:743:b0:a22:e2ea:4fb5 with SMTP id z3-20020a170906074300b00a22e2ea4fb5mr1926380ejb.19.1703432670410; Sun, 24 Dec 2023 07:44:30 -0800 (PST) Received: from [127.0.1.1] ([78.10.206.178]) by smtp.gmail.com with ESMTPSA id ge12-20020a170907908c00b00a26ac403032sm3325901ejb.65.2023.12.24.07.44.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 07:44:29 -0800 (PST) From: Krzysztof Kozlowski Date: Sun, 24 Dec 2023 16:44:00 +0100 Subject: [PATCH 01/15] media: s5p-mfc: drop unused static s5p_mfc_cmds Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20231224-n-s5p-mfc-const-v1-1-a3b246470fe4@linaro.org> References: <20231224-n-s5p-mfc-const-v1-0-a3b246470fe4@linaro.org> In-Reply-To: <20231224-n-s5p-mfc-const-v1-0-a3b246470fe4@linaro.org> To: Marek Szyprowski , Andrzej Hajda , Mauro Carvalho Chehab Cc: Aakarsh Jain , linux-fsd@tesla.coma, linux-samsung-soc@vger.kernel.org, Smitha T Murthy , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1053; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=ljCRuYvdY6fAQtZBQEraePJKn70VsL4ULdAUKh6amZc=; b=owEBfgKB/ZANAwAKAcE3ZuaGi4PXAcsmYgBliFHO3p4eunwoaLcAVxKz9/D+Tnof16hQ5siIZ 07WqzpDhHOJAkQEAAEKAC4WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZYhRzhAca3J6a0BrZXJu ZWwub3JnAAoJEME3ZuaGi4PXswkP/1SeouPDUcmwpq1k8OwdpUyxqA2rKAT8uC1bxSpCmb8tOwo UDBejhf7YSjqJdZNZ1ku5MAOaluQ3w2jZ+orHM4mFr10ys2AEQrxflPrua3NSzJA1K9phz1pMci TKvn89LFfRQ1qXBBbcmrI+YRBHALlKDke/knN3bXf7cJ1jWCnU5xTDcDX3LlMFWtcMmf1MHnego LtrrXK5Qfh36cU/RvU69xb44y/RfBYpL/wqFpBTb58DNLz4QVMVZ3pGyx3SqVrWS+dfho2juguN i8yEY11MOi0ADBfHR/hacukqLBeuFJxHdfKsnwiPgq/ha62urEJivFOQOBZlm+n1wZeMFq/R/TE 3yXag3EBmTTqAOaMbw9mdoLT8Wv84fWI0uMjc58doSohlMvvOQhlXN4twaIZ9cCM6eN++ee7cun ZyV88mts/QhYBG9h694L4/9AwAcTd0FGH7hkhlLKeUZw6Ky33NtjByPS4wmxbOHcPTmc09ENsOx 0Lh/XrzeuJMI9EjYQ/OUIpcgyF8DWNnTB7Q+0iEqr1a2zpuDdiZKyVLuF1PKVDIygrjBLNeWdxR WY5fV+gDp0dcK0Il9ck4hMTZ5J/rzFrws06JLrTYi2+DG8E1U7mDk7W5fiGJewVEAyZeUMW7CnP Fg3/CtwcWl1JxY1FnWykpk1ZEFB+rNlP9KpN0 X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786178676105651980 X-GMAIL-MSGID: 1786178676105651980 File-scope static variable "s5p_mfc_cmds" is not read after assignment, thus it can be dropped entirely. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Aakarsh Jain --- drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd.c index 774c573dc075..196d8c99647b 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd.c @@ -12,14 +12,10 @@ #include "s5p_mfc_cmd_v5.h" #include "s5p_mfc_cmd_v6.h" -static struct s5p_mfc_hw_cmds *s5p_mfc_cmds; - void s5p_mfc_init_hw_cmds(struct s5p_mfc_dev *dev) { if (IS_MFCV6_PLUS(dev)) - s5p_mfc_cmds = s5p_mfc_init_hw_cmds_v6(); + dev->mfc_cmds = s5p_mfc_init_hw_cmds_v6(); else - s5p_mfc_cmds = s5p_mfc_init_hw_cmds_v5(); - - dev->mfc_cmds = s5p_mfc_cmds; + dev->mfc_cmds = s5p_mfc_init_hw_cmds_v5(); } From patchwork Sun Dec 24 15:44:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 183072 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp10444dyb; Sun, 24 Dec 2023 07:45:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IEqY6l8OFFbT5PufPW/ds+z0C9xVoP0t4yPPZ7QhcJB8JZUUY/VS7fifGhUUEsIAX4YCbGO X-Received: by 2002:a05:6214:62a:b0:67a:ca07:cf96 with SMTP id a10-20020a056214062a00b0067aca07cf96mr6904626qvx.39.1703432726482; Sun, 24 Dec 2023 07:45:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703432726; cv=none; d=google.com; s=arc-20160816; b=NuBMPYvJNB5ySo6eqF92LGdN7U2T6/eWAMGp36q89MHLx47CRd5SIz1zW9dMKgNF0O eay2BJWYGWhttXKLlFSUl+BO6H/M9MkFnMAN2a8eM4sqphXjXY+s5fhXZC8t1kEvW0u3 5GxOC/gjVX4JOY/0cXr5IVgmM6ixAwN8nlRivNyV/jdjW1lQaYMiGyfFgswPrgdpVq5w JJxf1DiLr/pMA9VKxmosSdF8Y9I3C4ab/IDOc0vFStyBszRAospSb1qT3kiI6f7mtHqz fdOaSf5OvetZH0kocYtjweBKxxOhMX695Xp7KBU2A6kLO1BgOb3lLZAfT7OCGTWsFhal g97Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=Onwp4Wr1mUGcp5LZpvd0xonQACtJfZwXbS/++yMm9d8=; fh=nSSm1dUQDcfnFFwPmoq1SJ6NHxkx1o/ly8tYDPd/KV4=; b=X8dmjTlEkLKmLVySIiiS+OEI8kdXpHGXTkmk8u9EIhWjujtJPaWa+2P5KxObCTnoNe ioDYbSmIp6WOMP1UkJ/p67ioZMgTGg7xqNb2e92JUEBUxAIX4iMVT7iJA52q8IESdHHn d5e0nIpYv4G30jvm5+mdUwqRYlf9XHP8I4cV4FPBFt+92mLTO9sPwFgCGHVS4mmBC9Db BCNNIq32Hs4yZoyUCFSy9eRBdmrBgBeI0/MPaezCITKxAQOmn4w6orIGp6imspmR+a96 rvv8u5fZNx2pgXEHbc1Qwuad9DCyAbBT49orGoeNBVPLwRT+QsvzQxgT/0RuQihvYD// ZQvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Zwh4aTfl; spf=pass (google.com: domain of linux-kernel+bounces-10741-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10741-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 c2-20020a0cf2c2000000b0067f206711a9si7921569qvm.464.2023.12.24.07.45.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 07:45:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10741-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=Zwh4aTfl; spf=pass (google.com: domain of linux-kernel+bounces-10741-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10741-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 4618E1C20BF7 for ; Sun, 24 Dec 2023 15:45:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 759FDEED2; Sun, 24 Dec 2023 15:44:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Zwh4aTfl" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ed1-f51.google.com (mail-ed1-f51.google.com [209.85.208.51]) (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 55327747F for ; Sun, 24 Dec 2023 15:44: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-f51.google.com with SMTP id 4fb4d7f45d1cf-554ca5fac07so350149a12.2 for ; Sun, 24 Dec 2023 07:44:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703432671; x=1704037471; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Onwp4Wr1mUGcp5LZpvd0xonQACtJfZwXbS/++yMm9d8=; b=Zwh4aTflSYfFfHuo2iYfF64kG6kdsf6Ek6sR2cAF5ozBLBAnt/Q7MZ+ZoiZr6PhADs GYyRU9aKuyJGFd86tbKp6UTmAckIGesT12zQvvaghUq+xf+hxtDAr6nnY4zqAW+9e/aq wwvj7oWW/tjcJIuc7b4GOhFVQqxwMDC8KnlzeVr4Y0N8yslw1ckq6O7w4pNsXZI315mK KSy8ZrT96g8XD5UDjKwNSrwqyGWoyFxyRp5GsdfLpHR56TSKUqpwDtQgh6P13dwbhifv JljK53qAAHP6IcC17H9fF/8bpcdLPWXytzMigFLXzqFp9yCEWWStbltQpIQ04CaLLNuE LFqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703432671; x=1704037471; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Onwp4Wr1mUGcp5LZpvd0xonQACtJfZwXbS/++yMm9d8=; b=SZQ6FA3X/tW/vNxqMfNsIf64k7NMb03ZZzliUCEjOcF0kH/2ADVbCK+ZKsRPsuThyz KlKqnljnAQ3CQNenR2N4iMsI1vmVRCjHfJIrMUyrc3wEGqCwfpcQowDa66uRPj7j3pAO TO21ktPUSOOySMM/sTKoOqxBvC+nuan9Kb0OOiWye57uUKM4rmAzZ4mF8PzmTR8pLRNs F4MnFtYoE7l08zhxVkchVhwhNg+rl5zAWZnbv46EOeScxXgjMozT4aBrOhoQKSYHPL6x LSyZ+Cxm/VIKQAem1jrqUUPqbrsr0sQdzqL7+LRf1o/hBNA49Fik3Qly771TYf7C+foA igdQ== X-Gm-Message-State: AOJu0YyjfAvrIZi4pbZEtybXRjEdWq3cPfCfglRdA/wFEYffYzuSDupU am3/gU6fafYOfLIWzQ3oWqD3D7/NZFpFPw== X-Received: by 2002:a50:9316:0:b0:554:262:3115 with SMTP id m22-20020a509316000000b0055402623115mr2237467eda.61.1703432671722; Sun, 24 Dec 2023 07:44:31 -0800 (PST) Received: from [127.0.1.1] ([78.10.206.178]) by smtp.gmail.com with ESMTPSA id ge12-20020a170907908c00b00a26ac403032sm3325901ejb.65.2023.12.24.07.44.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 07:44:31 -0800 (PST) From: Krzysztof Kozlowski Date: Sun, 24 Dec 2023 16:44:01 +0100 Subject: [PATCH 02/15] media: s5p-mfc: drop unused static s5p_mfc_ops Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20231224-n-s5p-mfc-const-v1-2-a3b246470fe4@linaro.org> References: <20231224-n-s5p-mfc-const-v1-0-a3b246470fe4@linaro.org> In-Reply-To: <20231224-n-s5p-mfc-const-v1-0-a3b246470fe4@linaro.org> To: Marek Szyprowski , Andrzej Hajda , Mauro Carvalho Chehab Cc: Aakarsh Jain , linux-fsd@tesla.coma, linux-samsung-soc@vger.kernel.org, Smitha T Murthy , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1204; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=SGfvZrymg/GAF5fJD7rUJGwMU1wlhVHljcM4HZIJOUU=; b=owEBfgKB/ZANAwAKAcE3ZuaGi4PXAcsmYgBliFHPINUgnCaukbsTkqOz02P9rYU/IEHonJNio Yt89shzGsOJAkQEAAEKAC4WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZYhRzxAca3J6a0BrZXJu ZWwub3JnAAoJEME3ZuaGi4PX1e8P/R/7U5mMUd1VtV+BK7C5r2nay0DcsfSLWuO0T9OwRSvrFnp ySYSEO0r4IHt0nsjgFrw6/CRQwTc+zs7UZ+k34p+vJ87Nt0wK2DSoJ1hFnIqYnS7+0Jr+9URJIH mLrWZLfQXKPPWGaM/qHBcWfXHntXz1iziCqFQSD22V4huu14mE3MbZYDXwV0U0VMOE7gSwqlbXW Lps6BgTmwDEwQsohTjA1al47R4MtX+OaiPlO+TUmYvAIfR/i3sH9k5NptQis8n6OtVI9NnOnuge zUGacpiZR40eBdBXtgry7XADd5/PebvdBuUp42fI7clXcs9kPZo8cpX0nM2GWW9t0jjtFXXxiPY ygGJGIV/VPrXwent8N5Dj5lcvG7cVsVLyqOdReVUQcaMUrFrnIcB/ZegJkE1qp7wfzRmesuA2Ml oKQH725AMGNb/rrPYqFMTbJSLXzvCCvSfoG9hnZqi4FWAPHn/paZyqsYONVlXlS+oXz7PRM5RRY haKUpwYUI48ayV4rZ0rux4k7JjD79yFOn/qMBPhh8eu/tvkJnv9MS00IR8PCLX04zpK5HqdNXZO FVFK9DI1doPrAu5tNbtS0FgI2ZfqN6TRHZKesgTv5TsSCnhADIsUCkoepVr2MV/pOOhErGEqMG8 0D2YzNvIOmNKKb0ej3JeFXE9CzW4rE3NUINKd X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786178674617159585 X-GMAIL-MSGID: 1786178674617159585 File-scope static variable "s5p_mfc_ops" is not read after assignment, thus it can be dropped entirely. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Aakarsh Jain --- drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr.c index 673962301173..5ba791fa3676 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr.c @@ -14,18 +14,15 @@ #include "s5p_mfc_opr_v5.h" #include "s5p_mfc_opr_v6.h" -static struct s5p_mfc_hw_ops *s5p_mfc_ops; - void s5p_mfc_init_hw_ops(struct s5p_mfc_dev *dev) { if (IS_MFCV6_PLUS(dev)) { - s5p_mfc_ops = s5p_mfc_init_hw_ops_v6(); + dev->mfc_ops = s5p_mfc_init_hw_ops_v6(); dev->warn_start = S5P_FIMV_ERR_WARNINGS_START_V6; } else { - s5p_mfc_ops = s5p_mfc_init_hw_ops_v5(); + dev->mfc_ops = s5p_mfc_init_hw_ops_v5(); dev->warn_start = S5P_FIMV_ERR_WARNINGS_START; } - dev->mfc_ops = s5p_mfc_ops; } void s5p_mfc_init_regs(struct s5p_mfc_dev *dev) From patchwork Sun Dec 24 15:44:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 183074 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp10556dyb; Sun, 24 Dec 2023 07:45:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IFytFpnDxpcA5jZDFNiUrxyKJtNdWoRsucMIF4UR+t7Vmjf6gP4/jCdmrbW6WElEGGWKC16 X-Received: by 2002:a05:6a20:2512:b0:193:fd0c:a268 with SMTP id j18-20020a056a20251200b00193fd0ca268mr5000602pzd.29.1703432745994; Sun, 24 Dec 2023 07:45:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703432745; cv=none; d=google.com; s=arc-20160816; b=T5cbgJtFsDUYXxzcDgl7MglVbTORp7YmjOlXOU8PSrxI3jBO1PADuBUoAMsqfKqMsQ Jys7zcnSN8w3XSpxaV/NhTDBBlZqc2TSLw/D4uw1CYcRRfUMYv0SIv4u3kvHZ1kXyQbK 46CJDZ9DYcKUZFvA1wqC19kmgBqL+pdDdkl7HtHiFnz7GbmYVTBOEhQNmWE37GABBUWl FMSa9l1M416xLEWTRIwv9mKt6heZ52kdhUBrSWRpB2glw0evPQf8OPoDRdNm+IYVh241 mrNxdzQFZfjpy4FqmBvQONMGbQqQ08CviXydg/6bTN5kElecU5EmU3I1cBFtteLfpn6Y feRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=ifM++4CY2AN5j3GtGQa7Fr0Vq1Ud5nu9DCFmNuIoJ3U=; fh=nSSm1dUQDcfnFFwPmoq1SJ6NHxkx1o/ly8tYDPd/KV4=; b=neSpFgq9/lYbELes6PMgcCLkZPR8imKQiLEXdKdT8neD+OSDi4hTgYdLJUdeBtLTIy ZZqXQ3Yt5PPpGafY/DIjFybfNSWrCElMkXTdk06Gy3IvFmWqSGpHI86Z57kj0LfvsEgt m3KmKdYSE/tnfj8mQTmIiA23hwI89eyji/5tfq8ilkJT3Z39PaRvkuRbpIMQafcD7Fv6 HdW1AijtXW2j57PspLVwE05I4gmFUU0dKIUwRZzGX2pDbI/jEfeIVQKHtIoldNEtnSEg jj1nuKayamBj+7Lra8TskS0fl+k7teEGfQQLTwNV3oklLLp0t4LDHdS9yE7VHB6LOGFe SRNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=e3gMYgXg; spf=pass (google.com: domain of linux-kernel+bounces-10742-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10742-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 z2-20020a62d102000000b006d9ab421dc0si1922235pfg.374.2023.12.24.07.45.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 07:45:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10742-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=e3gMYgXg; spf=pass (google.com: domain of linux-kernel+bounces-10742-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10742-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 B87A0281F5D for ; Sun, 24 Dec 2023 15:45:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 174D6D27D; Sun, 24 Dec 2023 15:44:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="e3gMYgXg" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (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 D959CD26A for ; Sun, 24 Dec 2023 15:44:34 +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-wr1-f54.google.com with SMTP id ffacd0b85a97d-3368fe4dcb1so2117463f8f.1 for ; Sun, 24 Dec 2023 07:44:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703432673; x=1704037473; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=ifM++4CY2AN5j3GtGQa7Fr0Vq1Ud5nu9DCFmNuIoJ3U=; b=e3gMYgXgFLp98BqoHoMagxiQmv972B+LRdq+gRJhLpkVmBSDHIkjXlZ2fTc/q3kj/y lrjDZfeP078Ozy3vDjyl29t9siJMD6CwekThFMkvyQkMSB7+RcvBbhbkHTwZfVtu4l1/ qxbLG2Rno64b2LnvsqHTs9bnV3yJ0ZQ+jXdQIw/W8L+8CXACdEo/ks4KnBLXhikz/CRq 6yeuu5R3tVzBUFDe9Zu/2vOn+KAg3hKVOwTpoUtlMIx78L9XZHiJajLLCyo9qztbURQZ MU8uxJ9rE776/GnNKuRBNz38RlySear/Gs9y/KC54wISRBOY0x62hebXD2lsqo9GE/Nf UkZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703432673; x=1704037473; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ifM++4CY2AN5j3GtGQa7Fr0Vq1Ud5nu9DCFmNuIoJ3U=; b=ctYgtx8+J/E9oCtJIf3hQqwQcKm6dHYrRnJzx6++YPaAcN497cynPTW5Ym6IOfQXX8 noPS/cN0oC07uRNhZLqZ2kr9Xvk9XrBy/eiRq1WB0dNrYrGLl4rnwBKqXweEPZHodJS6 Uo0cCST94ZkWyFn+rHW/EVYp4JVa2xoaPsIuN2g7144gwrsO2CQXloj2+d41D32MqTkz k7671m9SvbyAIRJ/lOzPHRJKWi7qzjkpBZKjRG8zAEghXjn9l4KILqgsuIOmguXeAoaE 7rKpfkIYOZ/KSpmYhFQSNYoLC9p8EHGrO2cnrQos2KZO9+Z8TCUKYHugUenergXYQYyE V7NQ== X-Gm-Message-State: AOJu0Yz5grECldPBHgUB3CimwXEqMImW7Tr1JvG63i2tLRp0/Qzkn3Nm 66qcsUKmpl7kdPh6v52/IMMZ3QFvB7UOVw== X-Received: by 2002:adf:e487:0:b0:336:78b0:fd8f with SMTP id i7-20020adfe487000000b0033678b0fd8fmr2382956wrm.101.1703432673212; Sun, 24 Dec 2023 07:44:33 -0800 (PST) Received: from [127.0.1.1] ([78.10.206.178]) by smtp.gmail.com with ESMTPSA id ge12-20020a170907908c00b00a26ac403032sm3325901ejb.65.2023.12.24.07.44.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 07:44:32 -0800 (PST) From: Krzysztof Kozlowski Date: Sun, 24 Dec 2023 16:44:02 +0100 Subject: [PATCH 03/15] media: s5p-mfc: drop unused get_*_def_fmt declarations Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20231224-n-s5p-mfc-const-v1-3-a3b246470fe4@linaro.org> References: <20231224-n-s5p-mfc-const-v1-0-a3b246470fe4@linaro.org> In-Reply-To: <20231224-n-s5p-mfc-const-v1-0-a3b246470fe4@linaro.org> To: Marek Szyprowski , Andrzej Hajda , Mauro Carvalho Chehab Cc: Aakarsh Jain , linux-fsd@tesla.coma, linux-samsung-soc@vger.kernel.org, Smitha T Murthy , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1709; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=Bu9cKmlSyC4/w5f8uYZH7ftPdCwQqPqs5pc3w6+5vaA=; b=owEBfgKB/ZANAwAKAcE3ZuaGi4PXAcsmYgBliFHQ7Vv8mNU/Uxpc1qvHr4xaSsKIi9poePFpf f1r5W1+qCOJAkQEAAEKAC4WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZYhR0BAca3J6a0BrZXJu ZWwub3JnAAoJEME3ZuaGi4PXBS8P/0/+FdDNeDmfyhqYQhdrJRxp2qcJMuijQWYPzsQDgjPRVBO NJ8iJQ6h/pgLk+m5IZb2ntaXqvFEcLen9D5qfsVlhAe1onMQ0RddeGTbHt5MOvhvYaLjqNj8UKU J0gEzk6CPonUJx43LnK9KqXnLnidnluft8XlSDV1OglcZcz4xjWwQhNjWZCheDrj4FXi5/gE2bs SYnE9zlFNyqW2nbX41UT9mUWJ8eodpQccfCfD7k+9T3FLjfV5MSsXiGkhoG8zLFHvSO6Pg8ce0U hizPucD1vLcRdk0DaCWXMub3nEPn1g0udl00uXCQAv8VGUAx81tkIoo3ycDEJPHJYpjOG4//wia EzUpsWX9z1USZuaDteTh3SEZo1KvjnQPk5f8lTQ9Wx9kc8UDQbia7zC9//iINuEUh/6Xj/9s9D7 mv1VHCuzqrSBYJIWx1IN7y//BR+uBjqFWTHw5zrhFtK2nd8k42kEQjRNLvSFBFpLPjyl7x96nKg FEDCLxrKuB7vLuBQxDGcrBEFfd0rRfSYN/2rncGcXP1HS2ECGYPBgBPTYWStBVZ2izK4UtLCdcH 7+tWsuIrfiKuUR8iah19nLR344GWe1pv8fdJ2mez9SCCAei/0oW/g1c6HIr7dkpi2krMENbI30t o+py0zYY1w12LYWVJSn5w8ssGHgEQA/1O0RSI X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786178694772777041 X-GMAIL-MSGID: 1786178694772777041 get_dec_def_fmt() and get_enc_def_fmt() do not have definitions, so their declarations are pointless. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Aakarsh Jain --- drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.h | 1 - drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.h | 1 - 2 files changed, 2 deletions(-) diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.h b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.h index 0c52ab46cff7..d4310966a0c2 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.h +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.h @@ -12,7 +12,6 @@ const struct s5p_mfc_codec_ops *get_dec_codec_ops(void); struct vb2_ops *get_dec_queue_ops(void); const struct v4l2_ioctl_ops *get_dec_v4l2_ioctl_ops(void); -struct s5p_mfc_fmt *get_dec_def_fmt(bool src); int s5p_mfc_dec_ctrls_setup(struct s5p_mfc_ctx *ctx); void s5p_mfc_dec_ctrls_delete(struct s5p_mfc_ctx *ctx); void s5p_mfc_dec_init(struct s5p_mfc_ctx *ctx); diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.h b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.h index 3f1b1a037a4f..0cf08b8d40ff 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.h +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.h @@ -12,7 +12,6 @@ const struct s5p_mfc_codec_ops *get_enc_codec_ops(void); struct vb2_ops *get_enc_queue_ops(void); const struct v4l2_ioctl_ops *get_enc_v4l2_ioctl_ops(void); -struct s5p_mfc_fmt *get_enc_def_fmt(bool src); int s5p_mfc_enc_ctrls_setup(struct s5p_mfc_ctx *ctx); void s5p_mfc_enc_ctrls_delete(struct s5p_mfc_ctx *ctx); void s5p_mfc_enc_init(struct s5p_mfc_ctx *ctx); From patchwork Sun Dec 24 15:44:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 183075 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp10677dyb; Sun, 24 Dec 2023 07:46:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IGhHcP9BaC9BKLJSWyiQh1r/DXochFar/OArv259BktpCOC6GJ0cHYOKFchujUXnIdnKhf3 X-Received: by 2002:a05:622a:1488:b0:427:9f85:6f39 with SMTP id t8-20020a05622a148800b004279f856f39mr5188335qtx.78.1703432764871; Sun, 24 Dec 2023 07:46:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703432764; cv=none; d=google.com; s=arc-20160816; b=010ZZ/CTJXkNciZT33um2VlLZxrfZuUhui9EOJLb6a7U2Aw1IuCRIErYY4xF2SRoiH 5x6zsoaSQBWq50xoP8+yv5dm9HMjrQcuGNDvW0mwaiDsRFrzejTPSJZ9e6LE9XXjIapa d1WFlsPLbFwah3SdpfZmgvpD6IeTkhblqCNKtfGj0zaP5krQ9naYBViMe/wTKy3zEcGe AcWdf3K5GpUbmvl09HDktCMWeHo/tBaMRBSMCpFY1UzPwM0CYfIytmnC8AOCKFQ1kd4K CwBKQH6Ucd4v0tAyRGnchZyO3ajtuzYwBpRbghh8EwqNXd/rp2HcBNNH7mn4ULfdZrNM zEwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=8/bJ3x7ddMTFAEm0aZqxS1jFQ1MSMuIev3UEL4KwkkM=; fh=nSSm1dUQDcfnFFwPmoq1SJ6NHxkx1o/ly8tYDPd/KV4=; b=vHY0fu2tud3SQXavdrz+pUNmIsOj22nMdBfxB/7Cc7C6IfZ7SEoAi9OPSLciHLmu3v Mf1NCeiXn2kp9W8Yuwuud36oamc2YN2Qes3KjEyhdesPP5hMerW8NrORzU/KRYgh/rBZ mGvg5mF4p1eLmU9DDBjie0iwGIudiwr1RGHsaK0uekYzA5NPci/iIXTXC9OGKP4CoL3x RgH4Kj1u4APOcm0ryQy0l/t60NV+XSzNB0+8ltVy4Vneqny3irw4VhcRn0KKu/6P+i9A /AKSHJJno5xBd81ozwSah4Tv08U446IpqzhK0YnWNNfB6H2kERh+4QjI4Qx2Hl8XrUOh 6E+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=H8tRSTo1; spf=pass (google.com: domain of linux-kernel+bounces-10743-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10743-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 g5-20020ac85805000000b00423dccd9929si8640166qtg.495.2023.12.24.07.46.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 07:46:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10743-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=H8tRSTo1; spf=pass (google.com: domain of linux-kernel+bounces-10743-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10743-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 A692D1C21538 for ; Sun, 24 Dec 2023 15:46:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C9E9B10A11; Sun, 24 Dec 2023 15:44:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="H8tRSTo1" 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 B2E7EDF61 for ; Sun, 24 Dec 2023 15:44:36 +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-a2358a75b69so570845866b.1 for ; Sun, 24 Dec 2023 07:44:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703432675; x=1704037475; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=8/bJ3x7ddMTFAEm0aZqxS1jFQ1MSMuIev3UEL4KwkkM=; b=H8tRSTo1IHSxPKRu2n7clvIT9XNCZvWnBrfdjRyk9MV6lDYlpJjvxoPCOT1DQfVI5D 7ut33XCZ6ZJoFAnadfy+Tav2R6scOGsRQ2KT2MP9fS15PTDHpiFdmukII4UPNj9GJTlI bQKjAtxIpuLOA1decMKYKdGoIVAuwBMDeTFVIAquutquRYwh8bn5KPUKR/qBNzPlxWc2 uxpO1FB8zc6G9QNWyiS276AnlbX92+d9RYnois/sWQz5hFRf9VI0ui9tivqcpd20M18m QxxyRtqwtAw6HBcwl4oAcZpce8wTbm4i3BNcIP996JuJJxd/fYEpZjwxpcO/wS0+Kth6 UFsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703432675; x=1704037475; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8/bJ3x7ddMTFAEm0aZqxS1jFQ1MSMuIev3UEL4KwkkM=; b=VlYDYyNMzuiM/oUf20LHRhvbwjFDdeBw5NnGa2tYBd5QHL+Fzo6qiQrN5kkECshnID xi/6drIm6jWjujq35NUwaKlmmGc8zPod+9mjJT5VvHUgIt1pYAekwRCX3tCeF631CYoI m4sjrTFdQhlwGRa+cpwINtvZVE3OvhmNH8pzAyH5WQ6Jmzyo1eFyqKsx/uH5zq39dMDC VBHYGF4fegYuwBMUF6BE7+qiGyTXb0wGw2Ua5dWlpUa+oWucevsc7I8i1Dm7M0HgkL5F YPclr4ReAFsOQEIFYzhCEDNIQrC54BN4dYWCsyQkUL3NwXVv8fFKJRq3Tkf0BkbfgxUd uRJg== X-Gm-Message-State: AOJu0YzK/azQbvLgYyfpoIAeuaXnIxMWGhdcLSsLKkw7Llv0RBaSrI09 ce0Up9tfv0mwR31gvXWH5FD6LkFIRQN/Gw== X-Received: by 2002:a17:906:947:b0:a23:5939:759e with SMTP id j7-20020a170906094700b00a235939759emr4476446ejd.26.1703432674625; Sun, 24 Dec 2023 07:44:34 -0800 (PST) Received: from [127.0.1.1] ([78.10.206.178]) by smtp.gmail.com with ESMTPSA id ge12-20020a170907908c00b00a26ac403032sm3325901ejb.65.2023.12.24.07.44.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 07:44:34 -0800 (PST) From: Krzysztof Kozlowski Date: Sun, 24 Dec 2023 16:44:03 +0100 Subject: [PATCH 04/15] media: s5p-mfc: constify fw_name strings Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20231224-n-s5p-mfc-const-v1-4-a3b246470fe4@linaro.org> References: <20231224-n-s5p-mfc-const-v1-0-a3b246470fe4@linaro.org> In-Reply-To: <20231224-n-s5p-mfc-const-v1-0-a3b246470fe4@linaro.org> To: Marek Szyprowski , Andrzej Hajda , Mauro Carvalho Chehab Cc: Aakarsh Jain , linux-fsd@tesla.coma, linux-samsung-soc@vger.kernel.org, Smitha T Murthy , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=905; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=tO3hUFAQxvu9Nowg3KG0FpRXiKXEajVYfAhfC6NTrBs=; b=owEBfgKB/ZANAwAKAcE3ZuaGi4PXAcsmYgBliFHR3/m9xlHNEWUuIN7445o6ljNQikRjBXqCP jBYeuSSJCaJAkQEAAEKAC4WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZYhR0RAca3J6a0BrZXJu ZWwub3JnAAoJEME3ZuaGi4PXs34P/1LyaSaTZfYQ+m9JIOPVFI7kTxlPEOsIc6leETIFxYTpnj8 bdblNXLebn//vRhCMsFHxb6igV3W0i9r0i+eQr1w6NyW5U0oQzJkCxaVqJAGpn2UBV/P6Ic7XSG Hb/7lfUUw6eRPAjN9UHkY2rGdXgFZzo6Ukj6wabijN3QWo4csDd67xE7QSAThvdem24/ZidjeGG 90uYwu6UEwOYPPsFCh0U/rQ2NG8zg3FTPQbxjmXeV5JfKx+jzR+rMOeNW/4aKx4C2PXZmukEagZ KJIoPweguMie3wjaGdpaWJOvgqALLdQq8dT3kdVgYKWyboU5x0a6hblhwjtXpok187ccrU5HBMU 4Zcy6tywsnQwOQU50/DpnxrTsm7kQQTZRqDx14rMu+x+WfV6lqxwE8J10Qp5S2LJK2+8z47wEgh gtNqz3G5Dp8OgGpX0zLjGZlFR4jfAbWPxTpCeVcxMWGLnwqrwCOOHKQxennJMwPk1hqpeffvZLk M1Sis/KKadAPfRLSsXzmu0Grp6liuxgTtYzWgbtQlpz7VUU6z0ETCxrkKcXBfTbonbmJlsBY8Y4 EPb8K7TqBZ3V1bzzIABU12x9+MAP7ocqhC37C7Asu9NGKS4k5LnqKmr2qnS1HGocehDjWUy97or RSNfsWkUqYy8aH2yK6s4msFT7OdTvE5F/jt4b X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786178714628361225 X-GMAIL-MSGID: 1786178714628361225 Constify stored pointers to firmware names for code safety. These are not modified by the driver. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Aakarsh Jain --- drivers/media/platform/samsung/s5p-mfc/s5p_mfc_common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_common.h b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_common.h index 5304f42c8c72..f33a755327ef 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_common.h +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_common.h @@ -227,7 +227,7 @@ struct s5p_mfc_variant { unsigned int port_num; u32 version_bit; struct s5p_mfc_buf_size *buf_size; - char *fw_name[MFC_FW_MAX_VERSIONS]; + const char *fw_name[MFC_FW_MAX_VERSIONS]; const char *clk_names[MFC_MAX_CLOCKS]; int num_clocks; bool use_clock_gating; From patchwork Sun Dec 24 15:44:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 183077 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp10905dyb; Sun, 24 Dec 2023 07:46:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IE8Zar7sxd6yQRw6QryFH7480OZyAP7ATLzFk4/AacFsx7oMGp/JjUR/H+ZNwCkQEhaeAzA X-Received: by 2002:a17:906:c8:b0:a26:9346:9e1e with SMTP id 8-20020a17090600c800b00a2693469e1emr1292938eji.24.1703432811638; Sun, 24 Dec 2023 07:46:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703432811; cv=none; d=google.com; s=arc-20160816; b=sZyzAkbcNfSlzE9qdDD9BM2KKF7wI7GijZ01X4/wJDIL/RLVW1tTnHrEaaqnM48PMA 5l4AYuwJOY+wZ1M/7mcri98JatwEDFG57E2AtQ26lVc6yHjiBy+Ff8XFvI4D/ZgyJW47 Omtuhrms3hVwfSTy+GomdREDopytvQjPvU2WiIYFhhe1pLxY7KXymtqRD0w24J1iTRlX YM7yiyRXZ80ikgXzAWwkTGXAlZZomaN/mnCVfYJ+JXKJNAuuGcBuCiL0EiE+wgZI+m7o nPmoD1sx1WOGIMy5HYLu6IfY+YLjyKUo6PGNcR5K9W2P9Ya+D0Rru5UrSL1cHtZkAder zV+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=r4Q2nADKSJJyFLuoBm9qbZWxhgG3+quvPMfEmFUIhGU=; fh=nSSm1dUQDcfnFFwPmoq1SJ6NHxkx1o/ly8tYDPd/KV4=; b=GHB1aUMFBBUhUajtbNzLFhR60c5OzlwB4Xm8lvrtxohHhX9KR5IyuCXEE3+fsuUNKq dgX5yGmqR1u/RF4BybKK4pnVeelrWt37H7ikBO99NKWZP0Cq8OE0xSVagAPMmfQesfhP T76De3vISvTPluOpmYuvLSTrUJR7e9IxiPowYJlQodbKvP9+04fcWi3jgyJY7R083f8M c9X6L7TLw0CIVv/Ak8MY8Z3ynFOjGVlm5+ikKixRzfFlcXlq78g3aqTN0gOdApVJfaUN Fm/HIq9P568wIhAfP1vXQd5Wb44Cd0A2eHhU6IozuO8ZWRrrITLSiqI2hwtDkW1rS86P Xa7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CwhKnTQM; spf=pass (google.com: domain of linux-kernel+bounces-10745-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10745-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 p2-20020a17090628c200b00a2357304ed4si3708964ejd.923.2023.12.24.07.46.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 07:46:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10745-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=CwhKnTQM; spf=pass (google.com: domain of linux-kernel+bounces-10745-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10745-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 18CC81F21971 for ; Sun, 24 Dec 2023 15:46:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 92C38156E3; Sun, 24 Dec 2023 15:44:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="CwhKnTQM" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) (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 AB08ADDC1 for ; Sun, 24 Dec 2023 15:44:37 +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-f44.google.com with SMTP id a640c23a62f3a-a23566e91d5so379377366b.0 for ; Sun, 24 Dec 2023 07:44:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703432676; x=1704037476; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=r4Q2nADKSJJyFLuoBm9qbZWxhgG3+quvPMfEmFUIhGU=; b=CwhKnTQMIPKjADZsNIol9aidFK4VyMBkKQT9ldwhersPeiZrBV4N66hoBdLGhFA4u0 eunlEtrxBx10aQYSRPEqjBIoa+FStpw0xsUPcYlTQf1ueVvYxvJSUtl6Dt2bDxcdPeoY 2bOQ/w0tqIYp5alv3gleYnaxg6pGNavESjrDbKcpofYjIk/y+M7Flr5KPq6n/otbXWEl O886siu/iiqCWJJOXWsEHdw3UeQNOsj65tQ05aFkEiG+rnLr4bWpz98H5JDNwmMILZlt hjrU3CIWqI2Ue4wWJ4uqjzhLKnvaG0TQQLolqjEQahnh/tC1sVThpEQkm1RB2Ci0rPMR G/iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703432676; x=1704037476; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=r4Q2nADKSJJyFLuoBm9qbZWxhgG3+quvPMfEmFUIhGU=; b=HOVaspUglVwtseFDxZTY4axfOWgcRlPpSjGTgslc4KLlh74+7ifa801JbcztRTgGR6 FuQt6RoRNcxU0WDQ/nAeVJvJpHhVHxAXO3By5dQ/VZrfjIyW2W+ZSI/uhWbhVMjnpQxD thrmUN7G5d/8m+6KXRmkRH+KpiykgQnDA0dkhK0oTB5e5o805nrtzuHybYsDAh253hE3 hGBE7EwiwfuwbnGNPwbAeU3HSFcbmqFBEevfN+nTWdFEwQQEIM6gzEdE7kNnDQmnts22 gIO9+9KeyTj4TE76j4kBSTc/0qbPqlonYIjABz3x2KslNmduwp8l2keE1kBbp2gZKZxD qUwQ== X-Gm-Message-State: AOJu0Yy6Cbrjbwcm68vBoqgMwnoiU3ysLrbLOLzN7+skrDohP26MsCJN 8sIcpdDHasp+1M5wMhNZNXr5iWNOOpxZvQ== X-Received: by 2002:a17:906:bc44:b0:a23:4e3a:4356 with SMTP id s4-20020a170906bc4400b00a234e3a4356mr1399437ejv.182.1703432676050; Sun, 24 Dec 2023 07:44:36 -0800 (PST) Received: from [127.0.1.1] ([78.10.206.178]) by smtp.gmail.com with ESMTPSA id ge12-20020a170907908c00b00a26ac403032sm3325901ejb.65.2023.12.24.07.44.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 07:44:35 -0800 (PST) From: Krzysztof Kozlowski Date: Sun, 24 Dec 2023 16:44:04 +0100 Subject: [PATCH 05/15] media: s5p-mfc: constify s5p_mfc_buf_size structures Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20231224-n-s5p-mfc-const-v1-5-a3b246470fe4@linaro.org> References: <20231224-n-s5p-mfc-const-v1-0-a3b246470fe4@linaro.org> In-Reply-To: <20231224-n-s5p-mfc-const-v1-0-a3b246470fe4@linaro.org> To: Marek Szyprowski , Andrzej Hajda , Mauro Carvalho Chehab Cc: Aakarsh Jain , linux-fsd@tesla.coma, linux-samsung-soc@vger.kernel.org, Smitha T Murthy , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=9432; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=N6YS/7mRLJwdEcbOlRqHEpaRJFaZ8M8KXMSmDWzRy2k=; b=owEBfgKB/ZANAwAKAcE3ZuaGi4PXAcsmYgBliFHSU2k4b4bucLF39Jb/ovQuLzzq+ll9IVFTm VelIugiQw2JAkQEAAEKAC4WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZYhR0hAca3J6a0BrZXJu ZWwub3JnAAoJEME3ZuaGi4PXhuoP/ibqJwx0ApEBEn5x2nzP4RF7lBVQU0L5gLI1WntrJuW0m9U ssehL7xsFOxBpb142d9Kacz9B2rKO+yamsVFkhnMsk9Rv56OlCU5ylNN82Y+eyT8mt8rrQVytD3 OhxHn9xlBJZda5jmMZJADQCND7A+8utd7ifxv0rB1U1quXGnbdAYcDRwiVu66xztpp4Z5BOfToY omd9C3h7tQgS2R2nA3yQmi0ce1ykBRLRLDg8uOPUr2lPjIvxyPSaVF11seTeoOYFVIizTbd4QsO 0l9TkgzRMszaDOJPM0qbeGs+owINNOg8BICoIOGJi33pph/Jk8dBVmhI9SpMDCIabg0RxwTsUDq t7DDaUEYlMZYlvxIzMPY3iJZohh8h29fIU12Ao3jzdgPNpfDZxVRFt9Qyhgw9OOQ/h3ZGmdnJNt MCHpEHPIGPTXmAycjtsqEyHO5RtVajQ9Tz3WFFyrUNaES8sQ59s6wHUU5zlhpWdxcPABeUw53Tv D2g7QWSXVNMqvOTGKSm3mtP5E5tbo0j8PlY23xhAQOd/upsLS/5AxD8OwltlvKSwua0MZi4YeiO jQXsZnCodpu+L2TaNfJX2OLUU6t6pxp7t1GLSX1xklvna+KJzO4dAdSqqzhdkAhgMLj+3VOIc6q u3sDfAj12q1NSBOxsnwj0S+pHwaOV7GEKzBzv X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786178764191153405 X-GMAIL-MSGID: 1786178764191153405 Static "s5p_mfc_buf_size*" structures are not modified by the driver, so they can be made const for code safety. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Aakarsh Jain --- drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c | 20 ++++++++++---------- .../media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c | 2 +- .../media/platform/samsung/s5p-mfc/s5p_mfc_common.h | 4 ++-- drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.c | 2 +- .../media/platform/samsung/s5p-mfc/s5p_mfc_opr_v5.c | 6 +++--- .../media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c | 6 +++--- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c index e30e54935d79..6af7b812c5df 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c @@ -1516,14 +1516,14 @@ static const struct dev_pm_ops s5p_mfc_pm_ops = { SET_SYSTEM_SLEEP_PM_OPS(s5p_mfc_suspend, s5p_mfc_resume) }; -static struct s5p_mfc_buf_size_v5 mfc_buf_size_v5 = { +static const struct s5p_mfc_buf_size_v5 mfc_buf_size_v5 = { .h264_ctx = MFC_H264_CTX_BUF_SIZE, .non_h264_ctx = MFC_CTX_BUF_SIZE, .dsc = DESC_BUF_SIZE, .shm = SHARED_BUF_SIZE, }; -static struct s5p_mfc_buf_size buf_size_v5 = { +static const struct s5p_mfc_buf_size buf_size_v5 = { .fw = MAX_FW_SIZE, .cpb = MAX_CPB_SIZE, .priv = &mfc_buf_size_v5, @@ -1540,7 +1540,7 @@ static struct s5p_mfc_variant mfc_drvdata_v5 = { .use_clock_gating = true, }; -static struct s5p_mfc_buf_size_v6 mfc_buf_size_v6 = { +static const struct s5p_mfc_buf_size_v6 mfc_buf_size_v6 = { .dev_ctx = MFC_CTX_BUF_SIZE_V6, .h264_dec_ctx = MFC_H264_DEC_CTX_BUF_SIZE_V6, .other_dec_ctx = MFC_OTHER_DEC_CTX_BUF_SIZE_V6, @@ -1548,7 +1548,7 @@ static struct s5p_mfc_buf_size_v6 mfc_buf_size_v6 = { .other_enc_ctx = MFC_OTHER_ENC_CTX_BUF_SIZE_V6, }; -static struct s5p_mfc_buf_size buf_size_v6 = { +static const struct s5p_mfc_buf_size buf_size_v6 = { .fw = MAX_FW_SIZE_V6, .cpb = MAX_CPB_SIZE_V6, .priv = &mfc_buf_size_v6, @@ -1569,7 +1569,7 @@ static struct s5p_mfc_variant mfc_drvdata_v6 = { .num_clocks = 1, }; -static struct s5p_mfc_buf_size_v6 mfc_buf_size_v7 = { +static const struct s5p_mfc_buf_size_v6 mfc_buf_size_v7 = { .dev_ctx = MFC_CTX_BUF_SIZE_V7, .h264_dec_ctx = MFC_H264_DEC_CTX_BUF_SIZE_V7, .other_dec_ctx = MFC_OTHER_DEC_CTX_BUF_SIZE_V7, @@ -1577,7 +1577,7 @@ static struct s5p_mfc_buf_size_v6 mfc_buf_size_v7 = { .other_enc_ctx = MFC_OTHER_ENC_CTX_BUF_SIZE_V7, }; -static struct s5p_mfc_buf_size buf_size_v7 = { +static const struct s5p_mfc_buf_size buf_size_v7 = { .fw = MAX_FW_SIZE_V7, .cpb = MAX_CPB_SIZE_V7, .priv = &mfc_buf_size_v7, @@ -1603,7 +1603,7 @@ static struct s5p_mfc_variant mfc_drvdata_v7_3250 = { .num_clocks = 2, }; -static struct s5p_mfc_buf_size_v6 mfc_buf_size_v8 = { +static const struct s5p_mfc_buf_size_v6 mfc_buf_size_v8 = { .dev_ctx = MFC_CTX_BUF_SIZE_V8, .h264_dec_ctx = MFC_H264_DEC_CTX_BUF_SIZE_V8, .other_dec_ctx = MFC_OTHER_DEC_CTX_BUF_SIZE_V8, @@ -1611,7 +1611,7 @@ static struct s5p_mfc_buf_size_v6 mfc_buf_size_v8 = { .other_enc_ctx = MFC_OTHER_ENC_CTX_BUF_SIZE_V8, }; -static struct s5p_mfc_buf_size buf_size_v8 = { +static const struct s5p_mfc_buf_size buf_size_v8 = { .fw = MAX_FW_SIZE_V8, .cpb = MAX_CPB_SIZE_V8, .priv = &mfc_buf_size_v8, @@ -1637,7 +1637,7 @@ static struct s5p_mfc_variant mfc_drvdata_v8_5433 = { .num_clocks = 3, }; -static struct s5p_mfc_buf_size_v6 mfc_buf_size_v10 = { +static const struct s5p_mfc_buf_size_v6 mfc_buf_size_v10 = { .dev_ctx = MFC_CTX_BUF_SIZE_V10, .h264_dec_ctx = MFC_H264_DEC_CTX_BUF_SIZE_V10, .other_dec_ctx = MFC_OTHER_DEC_CTX_BUF_SIZE_V10, @@ -1646,7 +1646,7 @@ static struct s5p_mfc_buf_size_v6 mfc_buf_size_v10 = { .other_enc_ctx = MFC_OTHER_ENC_CTX_BUF_SIZE_V10, }; -static struct s5p_mfc_buf_size buf_size_v10 = { +static const struct s5p_mfc_buf_size buf_size_v10 = { .fw = MAX_FW_SIZE_V10, .cpb = MAX_CPB_SIZE_V10, .priv = &mfc_buf_size_v10, diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c index f8588e52dfc8..25c4719a5dd0 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c @@ -32,7 +32,7 @@ static int s5p_mfc_cmd_host2risc_v6(struct s5p_mfc_dev *dev, int cmd, static int s5p_mfc_sys_init_cmd_v6(struct s5p_mfc_dev *dev) { struct s5p_mfc_cmd_args h2r_args; - struct s5p_mfc_buf_size_v6 *buf_size = dev->variant->buf_size->priv; + const struct s5p_mfc_buf_size_v6 *buf_size = dev->variant->buf_size->priv; int ret; ret = s5p_mfc_hw_call(dev->mfc_ops, alloc_dev_context_buffer, dev); diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_common.h b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_common.h index f33a755327ef..6a47f3434c60 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_common.h +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_common.h @@ -219,14 +219,14 @@ struct s5p_mfc_buf_size_v6 { struct s5p_mfc_buf_size { unsigned int fw; unsigned int cpb; - void *priv; + const void *priv; }; struct s5p_mfc_variant { unsigned int version; unsigned int port_num; u32 version_bit; - struct s5p_mfc_buf_size *buf_size; + const struct s5p_mfc_buf_size *buf_size; const char *fw_name[MFC_FW_MAX_VERSIONS]; const char *clk_names[MFC_MAX_CLOCKS]; int num_clocks; diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.c index 268ffe4da53c..4dbe8792ac3d 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.c @@ -426,7 +426,7 @@ static int vidioc_s_fmt(struct file *file, void *priv, struct v4l2_format *f) struct s5p_mfc_ctx *ctx = fh_to_ctx(priv); int ret = 0; struct v4l2_pix_format_mplane *pix_mp; - struct s5p_mfc_buf_size *buf_size = dev->variant->buf_size; + const struct s5p_mfc_buf_size *buf_size = dev->variant->buf_size; mfc_debug_enter(); ret = vidioc_try_fmt(file, priv, f); diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v5.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v5.c index 28a06dc343fd..13a3ff55e547 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v5.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v5.c @@ -34,7 +34,7 @@ static int s5p_mfc_alloc_dec_temp_buffers_v5(struct s5p_mfc_ctx *ctx) { struct s5p_mfc_dev *dev = ctx->dev; - struct s5p_mfc_buf_size_v5 *buf_size = dev->variant->buf_size->priv; + const struct s5p_mfc_buf_size_v5 *buf_size = dev->variant->buf_size->priv; int ret; ctx->dsc.size = buf_size->dsc; @@ -200,7 +200,7 @@ static void s5p_mfc_release_codec_buffers_v5(struct s5p_mfc_ctx *ctx) static int s5p_mfc_alloc_instance_buffer_v5(struct s5p_mfc_ctx *ctx) { struct s5p_mfc_dev *dev = ctx->dev; - struct s5p_mfc_buf_size_v5 *buf_size = dev->variant->buf_size->priv; + const struct s5p_mfc_buf_size_v5 *buf_size = dev->variant->buf_size->priv; int ret; if (ctx->codec_mode == S5P_MFC_CODEC_H264_DEC || @@ -345,7 +345,7 @@ static void s5p_mfc_enc_calc_src_size_v5(struct s5p_mfc_ctx *ctx) static void s5p_mfc_set_dec_desc_buffer(struct s5p_mfc_ctx *ctx) { struct s5p_mfc_dev *dev = ctx->dev; - struct s5p_mfc_buf_size_v5 *buf_size = dev->variant->buf_size->priv; + const struct s5p_mfc_buf_size_v5 *buf_size = dev->variant->buf_size->priv; mfc_write(dev, OFFSETA(ctx->dsc.dma), S5P_FIMV_SI_CH0_DESC_ADR); mfc_write(dev, buf_size->dsc, S5P_FIMV_SI_CH0_DESC_SIZE); diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c index c0df5ac9fcff..70a62400908e 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c @@ -333,7 +333,7 @@ static void s5p_mfc_release_codec_buffers_v6(struct s5p_mfc_ctx *ctx) static int s5p_mfc_alloc_instance_buffer_v6(struct s5p_mfc_ctx *ctx) { struct s5p_mfc_dev *dev = ctx->dev; - struct s5p_mfc_buf_size_v6 *buf_size = dev->variant->buf_size->priv; + const struct s5p_mfc_buf_size_v6 *buf_size = dev->variant->buf_size->priv; int ret; mfc_debug_enter(); @@ -393,7 +393,7 @@ static void s5p_mfc_release_instance_buffer_v6(struct s5p_mfc_ctx *ctx) /* Allocate context buffers for SYS_INIT */ static int s5p_mfc_alloc_dev_context_buffer_v6(struct s5p_mfc_dev *dev) { - struct s5p_mfc_buf_size_v6 *buf_size = dev->variant->buf_size->priv; + const struct s5p_mfc_buf_size_v6 *buf_size = dev->variant->buf_size->priv; int ret; mfc_debug_enter(); @@ -493,7 +493,7 @@ static int s5p_mfc_set_dec_stream_buffer_v6(struct s5p_mfc_ctx *ctx, { struct s5p_mfc_dev *dev = ctx->dev; const struct s5p_mfc_regs *mfc_regs = dev->mfc_regs; - struct s5p_mfc_buf_size *buf_size = dev->variant->buf_size; + const struct s5p_mfc_buf_size *buf_size = dev->variant->buf_size; mfc_debug_enter(); mfc_debug(2, "inst_no: %d, buf_addr: 0x%08x,\n" From patchwork Sun Dec 24 15:44: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: 183076 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp10803dyb; Sun, 24 Dec 2023 07:46:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IHKNBOkKKMXklYs25FbeUOo8Je+DR9H2uwU0BAdhI1S9HdZtqTM1tFAmaWpy904kBXrjzTi X-Received: by 2002:ae9:f00f:0:b0:77e:fba3:a23a with SMTP id l15-20020ae9f00f000000b0077efba3a23amr4947449qkg.148.1703432794745; Sun, 24 Dec 2023 07:46:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703432794; cv=none; d=google.com; s=arc-20160816; b=dO969K3b2w+uJCnhp7uXpqV5YAvqdNlTGt5YjsjUA7Jk0pSsVb6zcTlDNCsQNLWEaO pN1PeiJvO6Ud1UVM6mYwTb8TswztIA0Q9BL7tgwEb1moyLiPeRN7KYF2zOebIpClU/p5 C8f9lCi00jyBi8MzGfH3AqhoseDkM321JuSTkYlR+OO19so0qFc+2UzXICH/PW0rpUcA GKMM57KNx0NmKWw/HAvXuSRIHo2cC1847hEQzqWsGXHZ60B28ZJQVQ1TbW/hHzgeSt/D aDcbUhd4hgINUjmbeIMYpQ9xo/6vJgm8c6+uwPmsc5riQ5eAdfV61RGJZB2VPnxHk8LU /6FQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=x1jw5Pl/l7koZ4WxO994EDqCfyQrw/Sp0GtB+qrS8sM=; fh=nSSm1dUQDcfnFFwPmoq1SJ6NHxkx1o/ly8tYDPd/KV4=; b=vBhiSsxxRxXeIGLvRUDdxfEU5bogKp8PCxfM/sHF6oMEqaAZ4cFSimNsmqmlFdGr7l XSw2ErFo+Ayq+1K88NdaCYtO5Axbc+6iNwhJkt2LmJMpeXEmpXl7wAZ7LkrtEhrCe2b6 DS4EdQ9OGuRGAu95q0tROo6LgDYaqRGtiKaaI9vHnb4V949PII0SLbK6jOV0yMRwbmck EWhEZBASnX77flC3r7U6wMFFKpD8tCloan/loAF3UUoa7Ixdmsn+JVmWsngYtX9DfJHR ZuGDGyGrGSNJZcY3Tnk+6ttM0cOLQArDPiv0ged/ZxKPcTcRFt0vjoPZPOrUgqbmliua PbbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WO0jspmp; spf=pass (google.com: domain of linux-kernel+bounces-10744-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10744-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 h22-20020ae9ec16000000b0077f10ed7a98si8005350qkg.489.2023.12.24.07.46.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 07:46:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10744-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=WO0jspmp; spf=pass (google.com: domain of linux-kernel+bounces-10744-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10744-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 7BC0E1C20A19 for ; Sun, 24 Dec 2023 15:46:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C0625107BF; Sun, 24 Dec 2023 15:44:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="WO0jspmp" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) (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 B0F9DFC1C for ; Sun, 24 Dec 2023 15:44:38 +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-f45.google.com with SMTP id a640c23a62f3a-a22f59c6ae6so396342566b.1 for ; Sun, 24 Dec 2023 07:44:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703432677; x=1704037477; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=x1jw5Pl/l7koZ4WxO994EDqCfyQrw/Sp0GtB+qrS8sM=; b=WO0jspmpLfxm+jEXSp467n3LbnZfs1OHxM6X4Q6Ut5KjmEQE96WNgX8I26RiNxT9z5 R9f7rcjdhaI26bMV7uNilYgXYYxixVA0EDZmpz55cn/PPa1zEjPt9394G35wvoeb1Uqv 1lFvZe4fF+tqZDygZlBHgAD7WSa8U/BVw82tBOjeyutdKIfdVWr8ZpOeVzKtO91po32R fthuLMrfjNmmmOg3V3rnL6LOf5o8t1X9C0YMRT2RS7ntyblaYWwwkI0t95GO8CMsihMc e9WdRgZzgsFartNQX8LPuTw7LRc+eGFbzkADOoovfFMG6cHJvkPNAFISEZCfJUsA9InL vtGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703432677; x=1704037477; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=x1jw5Pl/l7koZ4WxO994EDqCfyQrw/Sp0GtB+qrS8sM=; b=IpPDqnNn9g2cu+YqF0GEznnazg9G0HQv989uidSxTEvoA2NZKoQtph3wJP5h2zA3aB HPq9O00ZLmR6tsa+BDpfgVhx0xRPauQdsnqcHMtzpbmUBAMJcysspxx8MdWdg9/DvpEg KUlAngspDVhEZWQe1+7y/8iqGJ9kUh5R3u0gN4OSS04RW5sa3J9zqnZfXjvOY/06Mxcq dJ79bA5xOjdHWif1koD5XAhSmlGcA5RgoDu5zbX83rTwIgWrO3JAXnV+f/Zd9T/a28Qm w6SAg9ykTqF/wJNsab7y6rgt8K//lBpRTUw7Fc6oOHLe1S40+O3paTpdBgdg43+OyXzl qYpQ== X-Gm-Message-State: AOJu0Yy5/TI5KZP+jHKxWf3dM6q802aC6LHIXefL7aI/6HmZnx13PBxf kXsbakhFWi7dsEQKHk1WtjxKSGKG9uaiZg== X-Received: by 2002:a17:906:704:b0:a23:7175:30b4 with SMTP id y4-20020a170906070400b00a23717530b4mr1066672ejb.99.1703432677136; Sun, 24 Dec 2023 07:44:37 -0800 (PST) Received: from [127.0.1.1] ([78.10.206.178]) by smtp.gmail.com with ESMTPSA id ge12-20020a170907908c00b00a26ac403032sm3325901ejb.65.2023.12.24.07.44.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 07:44:36 -0800 (PST) From: Krzysztof Kozlowski Date: Sun, 24 Dec 2023 16:44:05 +0100 Subject: [PATCH 06/15] media: s5p-mfc: constify s5p_mfc_variant structures Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20231224-n-s5p-mfc-const-v1-6-a3b246470fe4@linaro.org> References: <20231224-n-s5p-mfc-const-v1-0-a3b246470fe4@linaro.org> In-Reply-To: <20231224-n-s5p-mfc-const-v1-0-a3b246470fe4@linaro.org> To: Marek Szyprowski , Andrzej Hajda , Mauro Carvalho Chehab Cc: Aakarsh Jain , linux-fsd@tesla.coma, linux-samsung-soc@vger.kernel.org, Smitha T Murthy , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=2821; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=VD48s/FZBGnruY4hNL+cZT1tYdqrtcBQSYEZMzctcmA=; b=owEBfgKB/ZANAwAKAcE3ZuaGi4PXAcsmYgBliFHTpKrlORLm6EMBe/5Niv6kNveFGfvGQVija oIoiG3SlTSJAkQEAAEKAC4WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZYhR0xAca3J6a0BrZXJu ZWwub3JnAAoJEME3ZuaGi4PXqQoQAINBCZEQEkwebideTGctzDGqaI0X/nEm94f2eYrj2ZMHOKw Nm+IkB2SIMPr8GLFBXgAsNA3bGe2uxkrp6yxcZY8xGadPODmLJzcDJwlrJhSC0Br3rDk1X+BOd0 srAugnCJZF7WtoQY23TGJKebKDQF/AKWLtKGFCNuXyDvQRL9Ortqi2EjCsnjKHRHxAd0HcAo1V+ Wdzcjv+94JITLoJqI+OD5HisRDvtrprzp5EJfZslyKugnCjBGQmqhG3H+qVLMGiq3gQamrVWgXd ygKAdd2+L+IHZpyf7EAdtxp+pjq3YqMW8++KMjqzwmbaW1lLUiz/84QC+zxTI8GIomF6SOUWzqR UVFU+EedkeTszKxWpEXmPZ3WWP+/c3CaxTHPODI9M+MY3HO2CnpjbFLIZWZIWfnUS688WS/3vZ1 jvvma+Exnwi1jrNznhuBLDVPJj1fRmNMhjQjbqXzyrR08PKNNpAkFagTHxxSAdJ81yOyq6HUbFB h6crBEuA2wtSS0zfZKHD9v5I0c4LAMRXuk5dAW73q0jHyYM16G+CtZMwjop/2ZF6+IBCJD6yUiq +hP9f2ZTbDUbQqdmueVl7d47ouXuYRCP98ZBftK5tUrxqDJydlWGorYqeDgOT0dfK7lw/4gNOdH uTAlmZuEH0AVv4rWC3A23PcvwNP4SVrHFyQBk X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786178746443887347 X-GMAIL-MSGID: 1786178746443887347 Static "s5p_mfc_variant" structures are not modified by the driver, so they can be made const for code safety. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Aakarsh Jain --- drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c index 6af7b812c5df..5d10c1cb8b92 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c @@ -1529,7 +1529,7 @@ static const struct s5p_mfc_buf_size buf_size_v5 = { .priv = &mfc_buf_size_v5, }; -static struct s5p_mfc_variant mfc_drvdata_v5 = { +static const struct s5p_mfc_variant mfc_drvdata_v5 = { .version = MFC_VERSION, .version_bit = MFC_V5_BIT, .port_num = MFC_NUM_PORTS, @@ -1554,7 +1554,7 @@ static const struct s5p_mfc_buf_size buf_size_v6 = { .priv = &mfc_buf_size_v6, }; -static struct s5p_mfc_variant mfc_drvdata_v6 = { +static const struct s5p_mfc_variant mfc_drvdata_v6 = { .version = MFC_VERSION_V6, .version_bit = MFC_V6_BIT, .port_num = MFC_NUM_PORTS_V6, @@ -1583,7 +1583,7 @@ static const struct s5p_mfc_buf_size buf_size_v7 = { .priv = &mfc_buf_size_v7, }; -static struct s5p_mfc_variant mfc_drvdata_v7 = { +static const struct s5p_mfc_variant mfc_drvdata_v7 = { .version = MFC_VERSION_V7, .version_bit = MFC_V7_BIT, .port_num = MFC_NUM_PORTS_V7, @@ -1593,7 +1593,7 @@ static struct s5p_mfc_variant mfc_drvdata_v7 = { .num_clocks = 1, }; -static struct s5p_mfc_variant mfc_drvdata_v7_3250 = { +static const struct s5p_mfc_variant mfc_drvdata_v7_3250 = { .version = MFC_VERSION_V7, .version_bit = MFC_V7_BIT, .port_num = MFC_NUM_PORTS_V7, @@ -1617,7 +1617,7 @@ static const struct s5p_mfc_buf_size buf_size_v8 = { .priv = &mfc_buf_size_v8, }; -static struct s5p_mfc_variant mfc_drvdata_v8 = { +static const struct s5p_mfc_variant mfc_drvdata_v8 = { .version = MFC_VERSION_V8, .version_bit = MFC_V8_BIT, .port_num = MFC_NUM_PORTS_V8, @@ -1627,7 +1627,7 @@ static struct s5p_mfc_variant mfc_drvdata_v8 = { .num_clocks = 1, }; -static struct s5p_mfc_variant mfc_drvdata_v8_5433 = { +static const struct s5p_mfc_variant mfc_drvdata_v8_5433 = { .version = MFC_VERSION_V8, .version_bit = MFC_V8_BIT, .port_num = MFC_NUM_PORTS_V8, @@ -1652,7 +1652,7 @@ static const struct s5p_mfc_buf_size buf_size_v10 = { .priv = &mfc_buf_size_v10, }; -static struct s5p_mfc_variant mfc_drvdata_v10 = { +static const struct s5p_mfc_variant mfc_drvdata_v10 = { .version = MFC_VERSION_V10, .version_bit = MFC_V10_BIT, .port_num = MFC_NUM_PORTS_V10, From patchwork Sun Dec 24 15:44: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: 183078 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp10971dyb; Sun, 24 Dec 2023 07:47:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IG7XAUnf1oSIgV9x77i4dsbTlV/y4WOVJYyL82Ig5l9xbuJrOFX672cEDQe6FuyK8CTw0ZF X-Received: by 2002:a17:906:a892:b0:a26:e485:93d9 with SMTP id ha18-20020a170906a89200b00a26e48593d9mr498926ejb.76.1703432822200; Sun, 24 Dec 2023 07:47:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703432822; cv=none; d=google.com; s=arc-20160816; b=08E9l752V+EMkBw6TreFhJobZhIsQWyHEpcYDq2Cm3W2HgQ+hsgNex3ib3ZCVdn5YH 0sssYg+Db7zDRVL0nvxqthtOQYONambEAvkZLrl72N+4MikfSP84dsdGX0N2B+3IxRlH BTSJE0Y47nbWvX3iKiMPAiH3y1CxIBmWEaVYNRMlcH4GrbRZBqhMSGhHk5Lvg8U0hd88 S9Yq2mkyoQKuYv4Pg6L6PXvDFpYwtKQwCzxQdYFZjhTIn4yPbKlZH28dLZAvX2IONGU5 TR7X6jRtwBwZmOYkeV2o0G/8MYQX59OomLdR/FSKoCgXorDtR6eCT3fURRYxMrfmLpZ/ d6aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=axh4aYmZJTMFAWOcFz7z6cVx1m8iVzvw4JafOlokaF4=; fh=nSSm1dUQDcfnFFwPmoq1SJ6NHxkx1o/ly8tYDPd/KV4=; b=I4vmBRZ0pBztUxqL1RgXXrB/PvDdDl1Jxlz5Y1Y5xTHjllNzmkUGTcyOHjn09omV0h Y3sR00YOHlW7hha04oFi74fgnmeLO+zgZh0+g0TlWhfMGks7PcWAAutwH9ZpaggkdbJ/ WM97RxMDdrOYTYoJRYB0+NH0qYoaxpdZvA8hWJGTMgJwU+h1MYwojkXsNfKB2YCo8+// r1cApPFWmr+scjXldhFDkHpt3F2j8z98DLNHY3dxPueLLOxw0YIo9IfV1nN7DYYmyVE9 /bVQg5AE71n/77wjZjCC6+9lEWL/HEDxJLq8jvHykH1BlERM+UEv+mZEpy6LsNhhYnFk X8Dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BBADRzrX; spf=pass (google.com: domain of linux-kernel+bounces-10746-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10746-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 h20-20020a17090619d400b00a233dcaf953si3762421ejd.731.2023.12.24.07.47.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 07:47:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10746-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=BBADRzrX; spf=pass (google.com: domain of linux-kernel+bounces-10746-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10746-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 A55141F21732 for ; Sun, 24 Dec 2023 15:47:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4A42F134CD; Sun, 24 Dec 2023 15:44:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="BBADRzrX" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.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 254B4107BB for ; Sun, 24 Dec 2023 15:44:39 +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-f48.google.com with SMTP id a640c23a62f3a-a1fae88e66eso372454866b.3 for ; Sun, 24 Dec 2023 07:44:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703432678; x=1704037478; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=axh4aYmZJTMFAWOcFz7z6cVx1m8iVzvw4JafOlokaF4=; b=BBADRzrXxGQZKSTbbBtxbIO9h1IWCuYJgkqoOUzCX/yV9gxOKo/sejn/7KWR+yHIvg /ji5fZGYHMtxH4M8yeM06M9PWi6QJaHYWdpgSxce6KMlywAXaHZSTz5tXNWX69ygSaWH SNcOzjQRCu8UudUj3imppSjptXwbgrCRQhSCKjrjGB6tADceUaNVmXD+hw3H/ldEjm1q cWmW6edT2PIvZHWWo442Oq5chXq+rqmbz33X9RrzXuT0a4BRgzwgOwsGPwJ93sjgzydl mO9Ghr+DGXFBIzVIkgFeuIKzZRMxPrx/WVvTlGlwd/UhvqE8VoisUo2g1Yucs47YHJZY cDOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703432678; x=1704037478; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=axh4aYmZJTMFAWOcFz7z6cVx1m8iVzvw4JafOlokaF4=; b=QK1x2M076P9HkkPjx+CqTnrsF7qiX1f1UjggUTfiDEFb2N2AAgxQfneYgYnvkr2Izi m/aaQSFj/2FLLn4yhDeFDO6PMaplirgGo/Y0YpWaWCFR1z9WLyKRyeQIID4WC3/MCX+f KvPJlpvrq9U/JXwtZNEHVNO1UIXfcRBEiJmjj4S9QeUZtyV3FdxDLGO9IvawdydJRRZx 1l1cZTFwNzHjLe4IfUnLw6gUeetSqpbaXQ04JxvgAZZmKP2vcNymRpxCy9mAw8zygK0D QEV2AESfqo+16DTyFLdV3y0jN2ZSbo3nnQy0XFbp1LT0S3LDW6i725wUy8apGYCgKd8w T9fQ== X-Gm-Message-State: AOJu0YyfIUZ7EejwF8raN9VsMZZWm2yD5BGX7oynUL2GXWUdq/+SaxlP YVbp7Izf6os4JxsgsXcOdV/yNPHmo8z/Zw== X-Received: by 2002:a17:906:1088:b0:a1f:a03d:2fdb with SMTP id u8-20020a170906108800b00a1fa03d2fdbmr1929515eju.14.1703432678399; Sun, 24 Dec 2023 07:44:38 -0800 (PST) Received: from [127.0.1.1] ([78.10.206.178]) by smtp.gmail.com with ESMTPSA id ge12-20020a170907908c00b00a26ac403032sm3325901ejb.65.2023.12.24.07.44.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 07:44:37 -0800 (PST) From: Krzysztof Kozlowski Date: Sun, 24 Dec 2023 16:44:06 +0100 Subject: [PATCH 07/15] media: s5p-mfc: constify s5p_mfc_hw_cmds structures Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20231224-n-s5p-mfc-const-v1-7-a3b246470fe4@linaro.org> References: <20231224-n-s5p-mfc-const-v1-0-a3b246470fe4@linaro.org> In-Reply-To: <20231224-n-s5p-mfc-const-v1-0-a3b246470fe4@linaro.org> To: Marek Szyprowski , Andrzej Hajda , Mauro Carvalho Chehab Cc: Aakarsh Jain , linux-fsd@tesla.coma, linux-samsung-soc@vger.kernel.org, Smitha T Murthy , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=4103; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=vm3UP9CqmFjf//LP0scO2VoaX48o+Ww6ScCgclJ4Q5A=; b=owEBfgKB/ZANAwAKAcE3ZuaGi4PXAcsmYgBliFHUT28rkpw42lL25ukkglr2QdvydQzfLFvJQ rBoA3r1k7KJAkQEAAEKAC4WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZYhR1BAca3J6a0BrZXJu ZWwub3JnAAoJEME3ZuaGi4PX1SEP/0DQic8fj0+AyI5fa8gr8cXAwYtNAugvSO0yKiYjUKz3HyU pDjaupHcIlf8mkGhy6ZDLZcddPHiUkofOvnFIGA3lTj3m+u5LQ0NHgd+wRthkeg2lOSRJBZ0kn0 649/eqNP5xxu0gYD89fFAVDkXwA0F5RiAo57YjDJooYTlkUFzVJI9dLnmPPk4nA2g9N9UN66Tpq 2NRAVxJnlxKl8eMBSxKaCg16a+nzSg8szMJvK0YBCBV8hxd7cZOq6yu+ryOdFHU9b5PoHsFV0/c UyUqMa2Q1JYwX7bsyi+ef+DIAp0ZupteXVyexu78QwrPzXeFtsJDl+/tQj8Hv+DG9TCuj7cwjv2 aoksIAph3NSVHSucP/usWSaAruPMRJXHjGYPBV6tabJDt1xxF08ZvyDCz2N0HZxsRJR++9wlg36 I07EOvpaWJ1WSFG3Es9m8DkTIRcSl+gJaLGa4uvpLRBbWtXsbl0YPiLvh4a2Fz4E/Ghunwlzm1E lhux6b7Rhd/Jh4eA+vSVy8gtvV3HwV8sACiKli6QlmjfboN66nNYRNkYr6GIqkmukFKMSTbdjkk kCeaof37c10+iBbkn1yW91tRvW4wAnRPNmQqCgQ776CLZKwLYienFTd2W3/5Guh3EP3dfa/ihtT hKtzWvNell5K1UG0mTXOamSuck6k1qPLpomVX X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786178774523913710 X-GMAIL-MSGID: 1786178774523913710 Static "s5p_mfc_hw_cmds" structures are not modified by the driver, so they can be made const for code safety. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Aakarsh Jain --- drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v5.c | 4 ++-- drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v5.h | 2 +- drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c | 4 ++-- drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.h | 2 +- drivers/media/platform/samsung/s5p-mfc/s5p_mfc_common.h | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v5.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v5.c index 327e54e70611..1fbf7ed5d4cc 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v5.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v5.c @@ -148,7 +148,7 @@ static int s5p_mfc_close_inst_cmd_v5(struct s5p_mfc_ctx *ctx) } /* Initialize cmd function pointers for MFC v5 */ -static struct s5p_mfc_hw_cmds s5p_mfc_cmds_v5 = { +static const struct s5p_mfc_hw_cmds s5p_mfc_cmds_v5 = { .cmd_host2risc = s5p_mfc_cmd_host2risc_v5, .sys_init_cmd = s5p_mfc_sys_init_cmd_v5, .sleep_cmd = s5p_mfc_sleep_cmd_v5, @@ -157,7 +157,7 @@ static struct s5p_mfc_hw_cmds s5p_mfc_cmds_v5 = { .close_inst_cmd = s5p_mfc_close_inst_cmd_v5, }; -struct s5p_mfc_hw_cmds *s5p_mfc_init_hw_cmds_v5(void) +const struct s5p_mfc_hw_cmds *s5p_mfc_init_hw_cmds_v5(void) { return &s5p_mfc_cmds_v5; } diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v5.h b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v5.h index 6eafa514aebc..c626376053c4 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v5.h +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v5.h @@ -11,6 +11,6 @@ #include "s5p_mfc_common.h" -struct s5p_mfc_hw_cmds *s5p_mfc_init_hw_cmds_v5(void); +const struct s5p_mfc_hw_cmds *s5p_mfc_init_hw_cmds_v5(void); #endif /* S5P_MFC_CMD_H_ */ diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c index 25c4719a5dd0..740aa4dfae57 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c @@ -154,7 +154,7 @@ static int s5p_mfc_close_inst_cmd_v6(struct s5p_mfc_ctx *ctx) } /* Initialize cmd function pointers for MFC v6 */ -static struct s5p_mfc_hw_cmds s5p_mfc_cmds_v6 = { +static const struct s5p_mfc_hw_cmds s5p_mfc_cmds_v6 = { .cmd_host2risc = s5p_mfc_cmd_host2risc_v6, .sys_init_cmd = s5p_mfc_sys_init_cmd_v6, .sleep_cmd = s5p_mfc_sleep_cmd_v6, @@ -163,7 +163,7 @@ static struct s5p_mfc_hw_cmds s5p_mfc_cmds_v6 = { .close_inst_cmd = s5p_mfc_close_inst_cmd_v6, }; -struct s5p_mfc_hw_cmds *s5p_mfc_init_hw_cmds_v6(void) +const struct s5p_mfc_hw_cmds *s5p_mfc_init_hw_cmds_v6(void) { return &s5p_mfc_cmds_v6; } diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.h b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.h index 9dc44460cc38..29083436f517 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.h +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.h @@ -11,6 +11,6 @@ #include "s5p_mfc_common.h" -struct s5p_mfc_hw_cmds *s5p_mfc_init_hw_cmds_v6(void); +const struct s5p_mfc_hw_cmds *s5p_mfc_init_hw_cmds_v6(void); #endif /* S5P_MFC_CMD_H_ */ diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_common.h b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_common.h index 6a47f3434c60..9278ed537e9c 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_common.h +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_common.h @@ -339,7 +339,7 @@ struct s5p_mfc_dev { struct s5p_mfc_priv_buf ctx_buf; int warn_start; struct s5p_mfc_hw_ops *mfc_ops; - struct s5p_mfc_hw_cmds *mfc_cmds; + const struct s5p_mfc_hw_cmds *mfc_cmds; const struct s5p_mfc_regs *mfc_regs; enum s5p_mfc_fw_ver fw_ver; bool fw_get_done; From patchwork Sun Dec 24 15:44: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: 183079 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp11040dyb; Sun, 24 Dec 2023 07:47:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IE91r22xzkkAmbRxlhRzyIkksbyVRHcPjFykIbGHg6x4Ke+nVQclqUULRVrl8ae/T42r6Z8 X-Received: by 2002:a05:620a:cce:b0:781:2bb5:4a7e with SMTP id b14-20020a05620a0cce00b007812bb54a7emr5032151qkj.9.1703432834467; Sun, 24 Dec 2023 07:47:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703432834; cv=none; d=google.com; s=arc-20160816; b=0tZoWe6EoQN83QC/0j7ErbFjmV20NDrR2Q+WDdYP+n06LEoloKVkbdssa+TqTEP9Wg 3hr9QFyuw7I06GJz805mD+FvLLUNgFKBbghoIBt7o43ww4IReBL+cFfkUGL5HCBHP1iC Ohtp0uKgJot1phGJcKMwy5eaLtUXGmPatMICZWfUi0Ww9RyAFMPY1CoLwDPy4Dgz5jus GF56O8Q8+4NqvLPJW9LpITCr1wumj/9ajkoLSGwWLC0bRTRNsUE1kkYkiGDcheYQus7x mPZGsKHVzMze1nZP9QaP/MsQzfrW5cSH/SSN0nhIVhMGbnhgTHy7z9F+RasKbanm15xX nZ5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=bB5P1aRSNpWIuuX+zo5w+ihjvQ+Oy95yE9zNnTm6uhU=; fh=nSSm1dUQDcfnFFwPmoq1SJ6NHxkx1o/ly8tYDPd/KV4=; b=YO/unYCe7cG/XWd4rYMC5jCPS1u7mNFWIsuUWDYv6qT3P7CRkeuu8DNxfozUZzAhF6 QKIp39I3HPYQJtwvYfu7wRE8qC4LA2Zfz8nmxCPCoNgr49GxxbQZlQCeqqaf+9IPJxBT SlB+KGj6h2PJp9Zo0onDKNUuTf+65LP5F1cxonpwLkvLfxML144dlMzBRR3s5mXnkjt7 gjgZSw2N6UPN/wqZmPjMXW3/nVUt/odBCzNZl7r561oA7Ej80N77cB/k70tF+ncoRybp 3KkD/ABmXGjCjcHLzl9ZlG7ZOA6GEyIkebN1ycde24uqtjEIIYYvxD1SwpgTrXN5wIRL cXgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PqzgX+HO; spf=pass (google.com: domain of linux-kernel+bounces-10747-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10747-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 5-20020a05620a040500b0077d7491f3dcsi8689713qkp.490.2023.12.24.07.47.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 07:47:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10747-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=PqzgX+HO; spf=pass (google.com: domain of linux-kernel+bounces-10747-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10747-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 33E851C20CAB for ; Sun, 24 Dec 2023 15:47:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3F6811774F; Sun, 24 Dec 2023 15:44:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="PqzgX+HO" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) (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 1243210A01 for ; Sun, 24 Dec 2023 15:44:40 +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-f45.google.com with SMTP id a640c23a62f3a-a26f133a527so11184566b.1 for ; Sun, 24 Dec 2023 07:44:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703432679; x=1704037479; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=bB5P1aRSNpWIuuX+zo5w+ihjvQ+Oy95yE9zNnTm6uhU=; b=PqzgX+HOMbm4RrJ1JbVLALs/0o0Jfdd8cIVSaTmNSfXOC5DkBNEi50cnTpPYL76hLF YoZ56CTipo21wWX7Ssdvrzu2HIKtUikaL3L4egvPx2cJxazrAmWI/ydntiRntlPKoyLy HLFc/y9jemvC9lf41oeyqk7F1kW1S5fwCXcJKhvq+SGXOY9XOhp5S08z6Wqsap3fUo95 whUNb40Rmxj7dLoUGTsgzwjN8np3LcEknf3LkbBXhLZrrbFdYOc5FYm6v3txvmr01JtC 7xjKYS9GIug1x9VdCnoMVpjWddgOoIvNNFRaDARWYQC0eVwUXD42uXxLSF3iGyDrJxEu MMhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703432679; x=1704037479; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bB5P1aRSNpWIuuX+zo5w+ihjvQ+Oy95yE9zNnTm6uhU=; b=o6sTJkgL/7JjlOgUt4+7fWlmbeL83soo3DdLDrqciGoBfcki8+0XfpC40b0RtXvuBI Jrk6RWV9fMWNelVVBDOQWNIWw2wF55w7zhz9EcsPkARRTG4kwGlw05utIjh8jVPyoI/w jIJNJmU5T+P9QJg0O64aeY2lPxgqo5nTfGe9ZBukz6Sc9ON4VJsHkgumnxwML/px40B4 r/r/Ck1SvXqE88ZqS6cc6+7cBrEQhLQ2BLRuPkBlB7iHaSgN2nwXJ15lFqJrQqKPnyDZ kwY0qnzvuK6kCOMKz9NekhuF+bWwPhyegUMiXxH8LufkpnaMT67Veq3mcP6Gmw+x0Qfg PC4A== X-Gm-Message-State: AOJu0YygR96qcD3RVWdwXDw7f+yvI0vRuUik6FBjBR9OmW4IvIdctK5l E7C1ibu+TsR5/vwBkPIpkHdXTR2FspSywg== X-Received: by 2002:a17:906:57c4:b0:a1f:9f48:6cbf with SMTP id u4-20020a17090657c400b00a1f9f486cbfmr1463631ejr.92.1703432679492; Sun, 24 Dec 2023 07:44:39 -0800 (PST) Received: from [127.0.1.1] ([78.10.206.178]) by smtp.gmail.com with ESMTPSA id ge12-20020a170907908c00b00a26ac403032sm3325901ejb.65.2023.12.24.07.44.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 07:44:39 -0800 (PST) From: Krzysztof Kozlowski Date: Sun, 24 Dec 2023 16:44:07 +0100 Subject: [PATCH 08/15] media: s5p-mfc: constify s5p_mfc_hw_ops structures Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20231224-n-s5p-mfc-const-v1-8-a3b246470fe4@linaro.org> References: <20231224-n-s5p-mfc-const-v1-0-a3b246470fe4@linaro.org> In-Reply-To: <20231224-n-s5p-mfc-const-v1-0-a3b246470fe4@linaro.org> To: Marek Szyprowski , Andrzej Hajda , Mauro Carvalho Chehab Cc: Aakarsh Jain , linux-fsd@tesla.coma, linux-samsung-soc@vger.kernel.org, Smitha T Murthy , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=4347; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=uQAmb+g3KeDVt3o+p0dQ4AcE1+B7a7naXcwp4q77ZiI=; b=owEBfgKB/ZANAwAKAcE3ZuaGi4PXAcsmYgBliFHV91xKfyDQA9sClD71SzcHsxzDNAIYBudkm +0DIyGSqyeJAkQEAAEKAC4WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZYhR1RAca3J6a0BrZXJu ZWwub3JnAAoJEME3ZuaGi4PXd9cP/1SDMWxyTBuAREfIFlmkGANgJHIYzaNHJS0J5D6d9RfDw+Z Y3ceG+f40jcX1saTlotfqGOInLzDj6Y17RTAJm4fQx/04L12lwkmhry36/uxp7Iv68vSl1HIcXP v68PJC9ohYAYR8BgyPm7yqPwpXbFBXDhK/hqUdQiKm983bOq10OhHgCDGjx1Rcdew+apjIH0Fjv kk5isY3KguAErZ7wGYp8CTYE+dGMG2GcoKFJBE2qt1hCpJ2XyvCn95mNepzyq6b814hKfWHCC4F 99Qi+4mWkgjLddJXTPoJYqW/aPbMndSLr56LWbX3geABeAKQbmiRsDQY2YfpK28sEZJMrVI0Tga 0TZXQ9dCbJuceTXXPdZgXdnMRNIopG1v+ozrFDjn+uwZ43KaQlQ9dolOrrmWqS+3lP8owQDxEcT aOsh5gX7y7zf8/pF8irEe3hOHlY3WZ4L9+3ayfLwH9ZP6rLMgGctKgtTGDxSN2HeHJlAsDO7RN1 hepSphE2TX/Oz7E9VE3jZcPIrXOaVsNtRGM6pA/71AbOTSY9fz/qlyCSbT4IN4GRs7Ey2Em4Buo gvnQ/xVrGhNptjqJR9tOI3wrWpmJE82uUQUo3lbdpR+VcQOaxoB2nsdrLZXUDYLA+YpOdreu0Rz zLop3HG0lnGKaDrRpvUeX9JZk8+BAUprp9QLk X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786178787452783613 X-GMAIL-MSGID: 1786178787452783613 Static "s5p_mfc_hw_ops" structures are not modified by the driver, so they can be made const for code safety. Signed-off-by: Krzysztof Kozlowski --- drivers/media/platform/samsung/s5p-mfc/s5p_mfc_common.h | 2 +- drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v5.c | 4 ++-- drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v5.h | 2 +- drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c | 4 ++-- drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.h | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_common.h b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_common.h index 9278ed537e9c..fa556f27fa06 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_common.h +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_common.h @@ -338,7 +338,7 @@ struct s5p_mfc_dev { struct s5p_mfc_priv_buf ctx_buf; int warn_start; - struct s5p_mfc_hw_ops *mfc_ops; + const struct s5p_mfc_hw_ops *mfc_ops; const struct s5p_mfc_hw_cmds *mfc_cmds; const struct s5p_mfc_regs *mfc_regs; enum s5p_mfc_fw_ver fw_ver; diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v5.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v5.c index 13a3ff55e547..2a0fb78e8e82 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v5.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v5.c @@ -1591,7 +1591,7 @@ static unsigned int s5p_mfc_get_crop_info_v_v5(struct s5p_mfc_ctx *ctx) } /* Initialize opr function pointers for MFC v5 */ -static struct s5p_mfc_hw_ops s5p_mfc_ops_v5 = { +static const struct s5p_mfc_hw_ops s5p_mfc_ops_v5 = { .alloc_dec_temp_buffers = s5p_mfc_alloc_dec_temp_buffers_v5, .release_dec_desc_buffer = s5p_mfc_release_dec_desc_buffer_v5, .alloc_codec_buffers = s5p_mfc_alloc_codec_buffers_v5, @@ -1631,7 +1631,7 @@ static struct s5p_mfc_hw_ops s5p_mfc_ops_v5 = { .get_crop_info_v = s5p_mfc_get_crop_info_v_v5, }; -struct s5p_mfc_hw_ops *s5p_mfc_init_hw_ops_v5(void) +const struct s5p_mfc_hw_ops *s5p_mfc_init_hw_ops_v5(void) { return &s5p_mfc_ops_v5; } diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v5.h b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v5.h index b53d376ead60..0b98c619676e 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v5.h +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v5.h @@ -78,5 +78,5 @@ enum MFC_SHM_OFS { FRAME_PACK_SEI_INFO = 0x17c, /* E */ }; -struct s5p_mfc_hw_ops *s5p_mfc_init_hw_ops_v5(void); +const struct s5p_mfc_hw_ops *s5p_mfc_init_hw_ops_v5(void); #endif /* S5P_MFC_OPR_H_ */ diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c index 70a62400908e..6157c5f97707 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c @@ -2484,7 +2484,7 @@ const struct s5p_mfc_regs *s5p_mfc_init_regs_v6_plus(struct s5p_mfc_dev *dev) } /* Initialize opr function pointers for MFC v6 */ -static struct s5p_mfc_hw_ops s5p_mfc_ops_v6 = { +static const struct s5p_mfc_hw_ops s5p_mfc_ops_v6 = { .alloc_dec_temp_buffers = s5p_mfc_alloc_dec_temp_buffers_v6, .release_dec_desc_buffer = s5p_mfc_release_dec_desc_buffer_v6, .alloc_codec_buffers = s5p_mfc_alloc_codec_buffers_v6, @@ -2528,7 +2528,7 @@ static struct s5p_mfc_hw_ops s5p_mfc_ops_v6 = { .get_e_min_scratch_buf_size = s5p_mfc_get_e_min_scratch_buf_size, }; -struct s5p_mfc_hw_ops *s5p_mfc_init_hw_ops_v6(void) +const struct s5p_mfc_hw_ops *s5p_mfc_init_hw_ops_v6(void) { return &s5p_mfc_ops_v6; } diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.h b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.h index e4dd03c5454c..e4b651a8d590 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.h +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.h @@ -52,6 +52,6 @@ #define FRAME_DELTA_DEFAULT 1 -struct s5p_mfc_hw_ops *s5p_mfc_init_hw_ops_v6(void); +const struct s5p_mfc_hw_ops *s5p_mfc_init_hw_ops_v6(void); const struct s5p_mfc_regs *s5p_mfc_init_regs_v6_plus(struct s5p_mfc_dev *dev); #endif /* S5P_MFC_OPR_V6_H_ */ From patchwork Sun Dec 24 15:44: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: 183080 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp11106dyb; Sun, 24 Dec 2023 07:47:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IHZLxryyi930S/ysCzooniyePXVWLJbMEcylyI6lAjjtr5RH2mDETIsVlFqnzFu14Gb2Jfe X-Received: by 2002:a05:6214:d4f:b0:67f:47a8:84cd with SMTP id 15-20020a0562140d4f00b0067f47a884cdmr8539132qvr.36.1703432849386; Sun, 24 Dec 2023 07:47:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703432849; cv=none; d=google.com; s=arc-20160816; b=l5I5AASSPyqc4Sy6yy1rH9VxlPUj+IldwrK+AQLU4txvp/IALpvoG/n5skaizw+XYH eVM0SGMOpYtaTX0RSVNDU2IaoGVQ7eDNp3S9vBw0W6tqkYltkDeZZjcp09eH0tJ0kTvS bqQtr753ne+YOQBwdKdQQvpmreAZdM/Rrun3bWt+wXIlQ5J81NlNHSgEV0HWDU1MKhNf B6RJ8DH1EoO5p/6qDJ9eV+EAYpSEzY6v5jmUpqg3cT3Ony6unNXRYDLH86nnubHrUOio HQyC/hYxy9bzgH8j8MNpQPeL5eFHCcb4CHny+o0B/+zhdJWMbHW/bIA/Wvf3JytlbO5B QMGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=gi2Xm/eE2/ZQOvGSk2NfHanEe6jP94JeNwcl+2gllIE=; fh=nSSm1dUQDcfnFFwPmoq1SJ6NHxkx1o/ly8tYDPd/KV4=; b=Mvu9AXMpUYHgLz24YgmOCc15zAZnDv3nfvDfPV++f6sD/jYMJnt+8T2pfc9N4mNi+V PlWoc886y2OT8mr1tC6s1G5kL7ia0o1G0KHT9T0Wh58QUg/PjTPEN1mbAFW4l+24mxJL emuNZaKe2qiW3/geQfXf9cMLpPgOw65fBiFc3icOFAi5ve1VNdKKzCBWK/EgYVfQtPK8 gfdehoRouw5f6BYu6xoiNBgbvmLswmCqio5YSnWwVN0nuWnY1N7LFtgXdyFrKM9ynOy4 oPOaNyuqYjBY6dQDLgyrNf9D2+KhEYcffTR2oglKFSoRBcaqxb8u479Dstp1xHlgcTB8 SJYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XxJNvvlT; spf=pass (google.com: domain of linux-kernel+bounces-10748-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10748-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 r2-20020a0ce282000000b0067f603604d8si8455814qvl.369.2023.12.24.07.47.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 07:47:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10748-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=XxJNvvlT; spf=pass (google.com: domain of linux-kernel+bounces-10748-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10748-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 EB1391C20C47 for ; Sun, 24 Dec 2023 15:47:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AF80918030; Sun, 24 Dec 2023 15:44:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="XxJNvvlT" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.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 8478F12E50 for ; Sun, 24 Dec 2023 15:44:42 +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-f52.google.com with SMTP id a640c23a62f3a-a234dc0984fso341701666b.0 for ; Sun, 24 Dec 2023 07:44:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703432681; x=1704037481; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=gi2Xm/eE2/ZQOvGSk2NfHanEe6jP94JeNwcl+2gllIE=; b=XxJNvvlTznUEIbyvVDeCvueWRC5rDTAWOSstNej5x/ZlVTfBfq2MAW6EwCH0VidEZH xYfRoR/6DDjEAyJ1KgSDmggAWu5RAT8P2zVxfXfHnhhQo2u2/3qvICKe4fDA3nn7Y6+a 9f36z1k1Xs4p1Q3HvEM0P1EP1PE7cpQMemvoDEX8TSf0ysKb4zT6uVddD56dn1gPoiLM uBbwMUx0J/rjfbvkGWb0Ji7cFiMRMxKDzGJPKastXtleJcAXrjAnlGUUAppyy+OtllYO f6FEHiEgVbjjo5pe0Bd1uFe4S8tQQu5skoAnYKOUDAvmVtlhUyec/khRocBged/vcFHq M51Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703432681; x=1704037481; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gi2Xm/eE2/ZQOvGSk2NfHanEe6jP94JeNwcl+2gllIE=; b=XkDjl4x8B12YXE5o562RlUF3PkmAl+ISdNrWvJDvpYKTS4dEPJcajCydEV63hDHXs+ eyfKx1U4D3SlE+EGgIvrj6zzOpf5O8bqqS4Pyl9g/MajGEkTa2t8RgsO9Q6uJeNXrCYc 8ntwP47YlBQtEiBhn0ct/iST4UQk9tN/UVW0c3pI2A5H7tY1cfOjKAHxJ0z2AyB7VQuJ AQ9Rr8/1FeIiJOqd7y7F5afXoha0v3El6XpArNh8xq5zk6C8CkmLDmnB3mnMdVRS6xyW ysRABecTIQ1GlZqtZ8fjP67CZdWiatiz2gS6PMJPiI9E+IoH2H+S5WILNod/My8uQVCX R7Wg== X-Gm-Message-State: AOJu0YyWquEeKNH8mpM4WIy+sZx+5jzjo5nKBWd4M63bq6k2/UZLy+lx 8fkHgJGqPX9S9W6Ew+flY7WTx6HlQWx8yQ== X-Received: by 2002:a17:906:2086:b0:a26:a877:56d3 with SMTP id 6-20020a170906208600b00a26a87756d3mr2137218ejq.97.1703432680961; Sun, 24 Dec 2023 07:44:40 -0800 (PST) Received: from [127.0.1.1] ([78.10.206.178]) by smtp.gmail.com with ESMTPSA id ge12-20020a170907908c00b00a26ac403032sm3325901ejb.65.2023.12.24.07.44.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 07:44:40 -0800 (PST) From: Krzysztof Kozlowski Date: Sun, 24 Dec 2023 16:44:08 +0100 Subject: [PATCH 09/15] media: s5p-mfc: constify s5p_mfc_fmt structures Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20231224-n-s5p-mfc-const-v1-9-a3b246470fe4@linaro.org> References: <20231224-n-s5p-mfc-const-v1-0-a3b246470fe4@linaro.org> In-Reply-To: <20231224-n-s5p-mfc-const-v1-0-a3b246470fe4@linaro.org> To: Marek Szyprowski , Andrzej Hajda , Mauro Carvalho Chehab Cc: Aakarsh Jain , linux-fsd@tesla.coma, linux-samsung-soc@vger.kernel.org, Smitha T Murthy , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=3940; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=tB2ac04nPKzrFa9IRHC0cXKAVzSO8LhOTzEBJ8HJcxg=; b=owEBfgKB/ZANAwAKAcE3ZuaGi4PXAcsmYgBliFHVATVXyMu07594D9rqQjKQnrcEStL4LxrAw iMoXF5v3SyJAkQEAAEKAC4WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZYhR1RAca3J6a0BrZXJu ZWwub3JnAAoJEME3ZuaGi4PX8yAP/1imoS7jQDgNuj4O93hilddy2HnZT8ESS0zJk90vwAgMs/R 43B7OA7tQDVeYZ4LRZ2RI/jzReEAy6U6+pC9TObMzkMMNCAbQogZ59fG6VIv+cCFBQYVj1jLr5J PrVx0Ww+mpnKcvmvlzhb+Ns8Ir4LkM8RlirMC4Z2bHpbFtmXDzwP7D3EETEIsG0p58lpXRPRz34 XWHpDJFeFNZTEiKXsBm2CQJh+WrQ7vxvCY5X2cPz5HNfsWYaXmHKaYKZgoNL4rK2DXbGx0Uta69 tdT7oJB7CAtID6b7DxwcjXeYZUEA4cE9UnIbD4INDktJPzlSfND0Z/xtCFNrjqUXDXcZufk4WZv k10OrfxXkRweFTiicdJleOfTCNLL7uRA+ahBYLlgzIwfaHBqFtKPdglRO6S51E+6DXkBt9BRfq9 Zuz1ATUxGWR1qyr/JHoaVXy0wRqv+JoECurS+yh75rZHKn3Q0gRAO2+y7HPN2/H2bJekIXKI9pW gCCJsbcd6qupIZZShoVNCDZ+0aRgA3gSUKlFvwXul8doirZIXJbV70Il5IdKmEZnAibc02rNvH3 HZgdaOqD9G6yqQNxcyFdE6B3GKcGh9uSyNRBacw0CByvrXZ21t7HP7A0a5LC8RnuyrEWrCpvIlB 0EypxJRUFcDpUDxNjlBg3Ur1n2lj03ERS/H9n X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786178803240390977 X-GMAIL-MSGID: 1786178803240390977 Static "s5p_mfc_fmt" structures are not modified by the driver, so they can be made const for code safety. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Aakarsh Jain --- drivers/media/platform/samsung/s5p-mfc/s5p_mfc_common.h | 4 ++-- drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.c | 6 +++--- drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_common.h b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_common.h index fa556f27fa06..e9283020070e 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_common.h +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_common.h @@ -633,8 +633,8 @@ struct s5p_mfc_ctx { unsigned int int_err; wait_queue_head_t queue; - struct s5p_mfc_fmt *src_fmt; - struct s5p_mfc_fmt *dst_fmt; + const struct s5p_mfc_fmt *src_fmt; + const struct s5p_mfc_fmt *dst_fmt; struct vb2_queue vq_src; struct vb2_queue vq_dst; diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.c index 4dbe8792ac3d..2f664c7e9e4c 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.c @@ -27,7 +27,7 @@ #include "s5p_mfc_opr.h" #include "s5p_mfc_pm.h" -static struct s5p_mfc_fmt formats[] = { +static const struct s5p_mfc_fmt formats[] = { { .fourcc = V4L2_PIX_FMT_NV12MT_16X16, .codec_mode = S5P_MFC_CODEC_NONE, @@ -163,7 +163,7 @@ static struct s5p_mfc_fmt formats[] = { #define NUM_FORMATS ARRAY_SIZE(formats) /* Find selected format description */ -static struct s5p_mfc_fmt *find_format(struct v4l2_format *f, unsigned int t) +static const struct s5p_mfc_fmt *find_format(struct v4l2_format *f, unsigned int t) { unsigned int i; @@ -387,7 +387,7 @@ static int vidioc_g_fmt(struct file *file, void *priv, struct v4l2_format *f) static int vidioc_try_fmt(struct file *file, void *priv, struct v4l2_format *f) { struct s5p_mfc_dev *dev = video_drvdata(file); - struct s5p_mfc_fmt *fmt; + const struct s5p_mfc_fmt *fmt; mfc_debug(2, "Type is %d\n", f->type); if (f->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c index 4b4c129c09e7..d6a4b9c701eb 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c @@ -30,7 +30,7 @@ #define DEF_SRC_FMT_ENC V4L2_PIX_FMT_NV12M #define DEF_DST_FMT_ENC V4L2_PIX_FMT_H264 -static struct s5p_mfc_fmt formats[] = { +static const struct s5p_mfc_fmt formats[] = { { .fourcc = V4L2_PIX_FMT_NV12MT_16X16, .codec_mode = S5P_MFC_CODEC_NONE, @@ -97,7 +97,7 @@ static struct s5p_mfc_fmt formats[] = { }; #define NUM_FORMATS ARRAY_SIZE(formats) -static struct s5p_mfc_fmt *find_format(struct v4l2_format *f, unsigned int t) +static const struct s5p_mfc_fmt *find_format(struct v4l2_format *f, unsigned int t) { unsigned int i; @@ -1394,7 +1394,7 @@ static int vidioc_g_fmt(struct file *file, void *priv, struct v4l2_format *f) static int vidioc_try_fmt(struct file *file, void *priv, struct v4l2_format *f) { struct s5p_mfc_dev *dev = video_drvdata(file); - struct s5p_mfc_fmt *fmt; + const struct s5p_mfc_fmt *fmt; struct v4l2_pix_format_mplane *pix_fmt_mp = &f->fmt.pix_mp; if (f->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { @@ -2355,7 +2355,7 @@ static const struct v4l2_ioctl_ops s5p_mfc_enc_ioctl_ops = { .vidioc_unsubscribe_event = v4l2_event_unsubscribe, }; -static int check_vb_with_fmt(struct s5p_mfc_fmt *fmt, struct vb2_buffer *vb) +static int check_vb_with_fmt(const struct s5p_mfc_fmt *fmt, struct vb2_buffer *vb) { int i; From patchwork Sun Dec 24 15:44: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: 183081 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp11222dyb; Sun, 24 Dec 2023 07:47:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IHWIPDsGqyxJfzofy3/g8ugfpxgtpXL/fnPj0FLX0CV5zk1QE4cF8XcaJEGTXTjGZ4BDgeI X-Received: by 2002:a05:620a:1004:b0:77e:fba3:a241 with SMTP id z4-20020a05620a100400b0077efba3a241mr4888669qkj.155.1703432875518; Sun, 24 Dec 2023 07:47:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703432875; cv=none; d=google.com; s=arc-20160816; b=ksMC3n0cYy15HqNhNicvPy2FvvSTrqPiFVY8HKiCNsVw9dErTkgK4JN6k/kJO0idXH UPqKEsAnLnesJF0F9624DCwlsthplLzqMwRmPw9Fs5zknmzldn5QEg9O3GOPmzeVjwiT Ipago+hOsQ8LUISoDtM3OG/L/OsOEj9anOg6dfFN35rPbItsnKBQMH1T2GeY8EMHTYcg Xvm2q//WAf2zHMdQWtP4rRoB3LjVBouXTXRw/vv4J5OykrYJoIaK2X19Vdy/uZXgbadw nnMpVOgP9Hgo4tQzKtCvKhaJByvBmUBluQE+940vQULRXXlLLZEUuncJTdDxABRCf3iP QJyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=uPtI8bSt3Ez5hLHZMbq8TpWSSmR71jwLZo0bXfxiX3Q=; fh=nSSm1dUQDcfnFFwPmoq1SJ6NHxkx1o/ly8tYDPd/KV4=; b=shNpGPk3nEbT/Nr+e1OQ5GaOwY335LSUjIF51oL2QRd/MAx6ZHGJJyN6cDEPIkx0p6 Ekn3Eo6hrE9nhjrBCibjiXxGMgE+RMmfJWFM1yucnVk/31hwVaEu3YnhOwHOgPguigLv b9d8/XN7SrB9wbit9nn40T2w3M4B3X0wUNRAzqsAz/L77FdY3MbHVdmp/ENhIUCHvYam Mo1NegkxzTN8n0Uy/zDBxAMMSuLBl2OVRjXpcuI8uffeEMqM/bhU/VAijE2Js4dUaCYB c8CuhnjETUSm9VyRqH+hZIkoDeIoZnY1h7j+12wdgCnGcBA05nf3CtbUXW+DInAnBKOK twYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ShzPTsie; spf=pass (google.com: domain of linux-kernel+bounces-10749-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10749-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 c2-20020a05620a268200b007811a0db26bsi8964215qkp.95.2023.12.24.07.47.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 07:47:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10749-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=ShzPTsie; spf=pass (google.com: domain of linux-kernel+bounces-10749-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10749-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 449DF1C21542 for ; Sun, 24 Dec 2023 15:47:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E1B2318C24; Sun, 24 Dec 2023 15:44:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ShzPTsie" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com [209.85.208.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AB37015AEF for ; Sun, 24 Dec 2023 15:44:43 +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-f50.google.com with SMTP id 4fb4d7f45d1cf-554d06bfd83so300777a12.1 for ; Sun, 24 Dec 2023 07:44:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703432682; x=1704037482; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=uPtI8bSt3Ez5hLHZMbq8TpWSSmR71jwLZo0bXfxiX3Q=; b=ShzPTsieDIfeyjehymx8cx3VilB6a06PyoeSmPabwhmu41t/uAue+2rmNxQ+xmO5X3 75j2gTtutMOvoh9zTl/lJOF0lxZ452+ypybcrZQXQLuZOeoOOLYJs+AxstCdw47kGjor UuEoY00tE0+H4+kFYNJ33223OY7+jtW6Pkp7Ddp5hjAqz9KRQcNCbEywUDQWNMDy/iPP wmaQzMc3GATmTRQEYYEB82K4Hk6PE4HYXbQspMK/n40JWqnvmcBN6e/h7x+sexWpiKAH Z/Gy5C9u1AtwxyCtrj3WmRuC6kWbGmOEjgjkomdmvTMQ8ESUiEa0B1bSCdlUfqX5QAug tGjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703432682; x=1704037482; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uPtI8bSt3Ez5hLHZMbq8TpWSSmR71jwLZo0bXfxiX3Q=; b=eweN0b1Mcn20ps2Rk7+4SynfrYLZPBNJ0HBITBZfVIWrCYZn1G6hEOh5+XrIEMEgTW 075TOY1nsLQ9H8k0Sh0UrWiz5rkDKfh2z2163d7IQKATKLfKO6XG0H1pJzW3U64vj2h3 wLcC1nxFDntsrKxhuBMK7him0Y+ExLWS/2L7TmtWWiMN+yUtpejFvw5eRNEo2ejgLqYD bczxkcq2XhslPgyK60duJSx28tZFMhZoxljSs28P2kkGkKyYdvv65UWkPtyXkyvyRtX9 UfnVeky0ZAmJc0ppd5Sm41b7/w0/PJaNhOiU66QWRvXzoKATfV4MYenVu9i11y+zmfZJ MbKA== X-Gm-Message-State: AOJu0Yyyh2OFmAD4WUHXtdJzEkMrP2p3f7LWMB3Ll2iQEsBNgBLlHzza ufn/1IFuxk8yOqL5T6NpY3qLZORrglF5NA== X-Received: by 2002:a50:a40f:0:b0:553:ffea:d0a7 with SMTP id u15-20020a50a40f000000b00553ffead0a7mr2818729edb.32.1703432682196; Sun, 24 Dec 2023 07:44:42 -0800 (PST) Received: from [127.0.1.1] ([78.10.206.178]) by smtp.gmail.com with ESMTPSA id ge12-20020a170907908c00b00a26ac403032sm3325901ejb.65.2023.12.24.07.44.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 07:44:41 -0800 (PST) From: Krzysztof Kozlowski Date: Sun, 24 Dec 2023 16:44:09 +0100 Subject: [PATCH 10/15] media: s5p-mfc: constify struct structures Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20231224-n-s5p-mfc-const-v1-10-a3b246470fe4@linaro.org> References: <20231224-n-s5p-mfc-const-v1-0-a3b246470fe4@linaro.org> In-Reply-To: <20231224-n-s5p-mfc-const-v1-0-a3b246470fe4@linaro.org> To: Marek Szyprowski , Andrzej Hajda , Mauro Carvalho Chehab Cc: Aakarsh Jain , linux-fsd@tesla.coma, linux-samsung-soc@vger.kernel.org, Smitha T Murthy , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=3562; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=7eLA73/Lxy5Yo9MdLmPuVAn1gTKGvPSmfN1gvCYYUnY=; b=owEBfgKB/ZANAwAKAcE3ZuaGi4PXAcsmYgBliFHW4EG4R+SMVxMqgocTB7ioHMGzVI6kRjC2A uLDE5DR6naJAkQEAAEKAC4WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZYhR1hAca3J6a0BrZXJu ZWwub3JnAAoJEME3ZuaGi4PXOlQP/jKjDthPJX0wo8OYeoBSWUosWomRncDBw+86aGCEFofZ1uv 1o4QQyQxQDNhXp82RVFP+6Bebq92iZx1GWeBGrmSLM4j772K4qn68mcVUBDlO25PqggkuoH0Zem gLu6laqCpqTNqD66qzkwOEmk4MrnAwgD29uSun+qznKrLyijwBfTywZ7ikTqjkb0aIZ4KbbtgRL MiZgm7Vk1FqxutaINdUs/16wyHY+GaoXId0udkhxPioi/8rpoW8yvWdCS1klvubi+EXQQs0QfsF nnKKqfjotnW0bkHMHpocTpaYzPVEBYYP4LozUGW7xgxhbqHtCLlQf4T4z7E9X+qs+ePOy6UhScX /S6temNSp7roQXy2nfQKV4NLf3sWaJcA1NBIxvQdWDsD+GmCeLqTDFHRgsvxNKBfKeDVZaswMRZ +mj9Qr9vOf04wy01lhYzN8mKuo0fGRSiH5PEMcRHc1jRyKb8v78QgAiaOtSnA7KvYZbiE2VuzZh 4tDVKkPugU8AHrsqRuTzANXgzq0PORzQQtVs3R3+r74xjPabAzC77RhEfJD+x2KAp+0vm3of4sS e4bZtLNe5HQYg6fKxoX1mFjk8kJTuzpWX+h3qHxyxJGK4a+LWcTPzM0j2t2BwXkrarjsnTXRoc9 Yji5Ay6x7yReo2GZTm9ZQsiK0vc+1JdNTvq4m X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786178830402900361 X-GMAIL-MSGID: 1786178830402900361 Static "struct" structures are not modified by the driver, so they can be made const for code safety. Signed-off-by: Krzysztof Kozlowski --- drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.c | 4 ++-- drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.h | 2 +- drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c | 4 ++-- drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.h | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.c index 2f664c7e9e4c..eef26d4e02cf 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.c @@ -1117,7 +1117,7 @@ static void s5p_mfc_buf_queue(struct vb2_buffer *vb) s5p_mfc_hw_call(dev->mfc_ops, try_run, dev); } -static struct vb2_ops s5p_mfc_dec_qops = { +static const struct vb2_ops s5p_mfc_dec_qops = { .queue_setup = s5p_mfc_queue_setup, .wait_prepare = vb2_ops_wait_prepare, .wait_finish = vb2_ops_wait_finish, @@ -1132,7 +1132,7 @@ const struct s5p_mfc_codec_ops *get_dec_codec_ops(void) return &decoder_codec_ops; } -struct vb2_ops *get_dec_queue_ops(void) +const struct vb2_ops *get_dec_queue_ops(void) { return &s5p_mfc_dec_qops; } diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.h b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.h index d4310966a0c2..47a6eb9a8fc0 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.h +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.h @@ -10,7 +10,7 @@ #define S5P_MFC_DEC_H_ const struct s5p_mfc_codec_ops *get_dec_codec_ops(void); -struct vb2_ops *get_dec_queue_ops(void); +const struct vb2_ops *get_dec_queue_ops(void); const struct v4l2_ioctl_ops *get_dec_v4l2_ioctl_ops(void); int s5p_mfc_dec_ctrls_setup(struct s5p_mfc_ctx *ctx); void s5p_mfc_dec_ctrls_delete(struct s5p_mfc_ctx *ctx); diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c index d6a4b9c701eb..537c6e603cd5 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c @@ -2594,7 +2594,7 @@ static void s5p_mfc_buf_queue(struct vb2_buffer *vb) s5p_mfc_hw_call(dev->mfc_ops, try_run, dev); } -static struct vb2_ops s5p_mfc_enc_qops = { +static const struct vb2_ops s5p_mfc_enc_qops = { .queue_setup = s5p_mfc_queue_setup, .wait_prepare = vb2_ops_wait_prepare, .wait_finish = vb2_ops_wait_finish, @@ -2610,7 +2610,7 @@ const struct s5p_mfc_codec_ops *get_enc_codec_ops(void) return &encoder_codec_ops; } -struct vb2_ops *get_enc_queue_ops(void) +const struct vb2_ops *get_enc_queue_ops(void) { return &s5p_mfc_enc_qops; } diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.h b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.h index 0cf08b8d40ff..62d6db67fd91 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.h +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.h @@ -10,7 +10,7 @@ #define S5P_MFC_ENC_H_ const struct s5p_mfc_codec_ops *get_enc_codec_ops(void); -struct vb2_ops *get_enc_queue_ops(void); +const struct vb2_ops *get_enc_queue_ops(void); const struct v4l2_ioctl_ops *get_enc_v4l2_ioctl_ops(void); int s5p_mfc_enc_ctrls_setup(struct s5p_mfc_ctx *ctx); void s5p_mfc_enc_ctrls_delete(struct s5p_mfc_ctx *ctx); From patchwork Sun Dec 24 15:44: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: 183082 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp11315dyb; Sun, 24 Dec 2023 07:48:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IHd/yYPpB6sKYKFiOrT5Dom1y0aY22TZF7ZeyozyJ68AHqy8OC0TpRWDGLR7ps3LrJgwyHu X-Received: by 2002:a50:ab0f:0:b0:554:a41b:237 with SMTP id s15-20020a50ab0f000000b00554a41b0237mr1151817edc.41.1703432895377; Sun, 24 Dec 2023 07:48:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703432895; cv=none; d=google.com; s=arc-20160816; b=kUJ3UbrmWjNrcH9c/UlRs09fB/2p35KYJoXb07PIP2fLP/GdbPd9kYflcSgOteDHic hkLx/Q/qSRippL1YSCkvwomUnIb5n6pWO+pJpfCXq/Ni08ta19V52V4W8HyKGVkx+soY NVznRmqxjxwGSaYCkg/v/c9ReZltnAvJ4lYz62R6vSMPJw72qd7NA03el2fiKuZ9FAVV WHCEjR06MHh4qGovjlKxPBS0NijCvwjRJqXi6KD7SGMXoviT0jwcDt7mtFyv7kFAnO9J J/EPU+vK5dZKG19fnMa9kMA7ZASULZ7282+jIbG+GHADuPOIb3414MQNSi9Vypd5+DmQ 2A/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=IYWVVwNT2dCuI83RazEsoLGBNSqJFygjoBJweO/IYP8=; fh=nSSm1dUQDcfnFFwPmoq1SJ6NHxkx1o/ly8tYDPd/KV4=; b=HXkCa2y7s8LPVzfel0CZLNhJln9OQA4O3+mz/+eYcgyE432nx3uN88THRKkBVQJ4al VUViSObW98lBSeT1MP1ahsumbiT5/yRLVsa2+Ryh4OHn2mE/gA013mGck5OjoUpR8gh0 hGOEyvm2gHXIEPED5lwNBBsAqpniVhiMqsHJfZEbqlOitGXVSH92YGyrRn7fe9V8q4bq 6e3PZJ/lnyneszImeaNbyK3bpORkb3+isQQD5TUzDFfjxVwOlJ3g5bI798m/niLUoG9G GyiJGojtVHtCJgza9MzTx+eATtkl1hyTLRh5z90TfGC80+8RpujRGAgN1ObOLymrqreE cwrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iDhJ491Z; spf=pass (google.com: domain of linux-kernel+bounces-10750-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10750-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 r15-20020a056402234f00b0055411d3d790si3766469eda.168.2023.12.24.07.48.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 07:48:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10750-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=iDhJ491Z; spf=pass (google.com: domain of linux-kernel+bounces-10750-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10750-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 0724A1F216E3 for ; Sun, 24 Dec 2023 15:48:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 37EC418EC0; Sun, 24 Dec 2023 15:44:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="iDhJ491Z" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) (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 5AE7D12E58 for ; Sun, 24 Dec 2023 15:44:45 +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-f41.google.com with SMTP id a640c23a62f3a-a23566e91d5so379382366b.0 for ; Sun, 24 Dec 2023 07:44:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703432684; x=1704037484; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=IYWVVwNT2dCuI83RazEsoLGBNSqJFygjoBJweO/IYP8=; b=iDhJ491Z+QFapHKK/HplwJ8N4NHndEpV1XwGGgidVG9Pykfi8vLn4J0yNRSqusZasG ip9y9HNqj4lsuv2bSzgSzrhGpnbn4eTr6AOGWHzbB9SG1ukEfg7MMuPLCdpKZbkKjd7e ZIyhE5BtHwchjDX8KFkyS0ya6bd53VL+VDWiAcUhZvGGuQRHo2NZA6Wfa4CpUAgCk/io 9tCXP4rS1wwN6sGUOuKp7YTO4iIa5CvUQXZPQfLCDB16lM0I4G8w6Bqv4chL0Lat1o7u G6s7uXWXtMtR9p3H6GKHkkArmUKAmDGFK7W6co3Z/bR3g2W9IWMyEDGY2U3EP7HejeaM RuAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703432684; x=1704037484; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IYWVVwNT2dCuI83RazEsoLGBNSqJFygjoBJweO/IYP8=; b=OAtNavS+NJlaogNljRpQRu47u88B67sWdOWwAOBkCTPFInSgFMkwb1JpoBvHqoL37a bpWBgbbeV0491t8K1+6pCZEorsbHhS1NomU7yP1yODVuVS35zg+CTuXSwTVvKd6XdKD3 FUwl096lZ8rew22DCcy4SXg9D9aqCZzA30FqvjlR16izKobU6XLn3cLnt8LM9jJWYF3i 0aUh6NyM0Pg+e/L2DDbtnEpC1+ZCBjb8ZcGMUthQ+O7giTYhWu61vtXMQNKFJepnkjGj iKqYG7X5umg+elhN5hf0zqdGx6Z3dRS03nNgC0XKrEjenD9js1Ng0p23jKAhS+7JhT4d QTTA== X-Gm-Message-State: AOJu0YyHvoPzyZEuzsegUwlTModcVXquXoPWyQ0rlPwysnyWopuqFfeD Z3KEmq4nUCi70udqicCZLwWfAkGB416pXA== X-Received: by 2002:a17:906:295:b0:a26:9642:ab54 with SMTP id 21-20020a170906029500b00a269642ab54mr1220682ejf.117.1703432683825; Sun, 24 Dec 2023 07:44:43 -0800 (PST) Received: from [127.0.1.1] ([78.10.206.178]) by smtp.gmail.com with ESMTPSA id ge12-20020a170907908c00b00a26ac403032sm3325901ejb.65.2023.12.24.07.44.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 07:44:43 -0800 (PST) From: Krzysztof Kozlowski Date: Sun, 24 Dec 2023 16:44:10 +0100 Subject: [PATCH 11/15] media: s5p-mfc: constify pointers to s5p_mfc_cmd_args Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20231224-n-s5p-mfc-const-v1-11-a3b246470fe4@linaro.org> References: <20231224-n-s5p-mfc-const-v1-0-a3b246470fe4@linaro.org> In-Reply-To: <20231224-n-s5p-mfc-const-v1-0-a3b246470fe4@linaro.org> To: Marek Szyprowski , Andrzej Hajda , Mauro Carvalho Chehab Cc: Aakarsh Jain , linux-fsd@tesla.coma, linux-samsung-soc@vger.kernel.org, Smitha T Murthy , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=2307; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=MTZFZLeg0VW864VwU7y3amI727wpiwg5E3bmaHSv6cE=; b=owEBfgKB/ZANAwAKAcE3ZuaGi4PXAcsmYgBliFHXEAOncCMIsdC1VaVpZt1JfMturxIK/tTBm wFo7Fau2ruJAkQEAAEKAC4WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZYhR1xAca3J6a0BrZXJu ZWwub3JnAAoJEME3ZuaGi4PX+wIP/2fT5qxZh4FG5nYcP8WZW+1P0kJCJc5MhL36+cZ393geepj Sh6KJ1Zt44VvNfUOltoydyIVjvgXcFeIsubUzoZsDvRBn8PIIyoqGR3Q8FPViPu3sC98bEpvVsT gSfOkV6oEPX3LDYYH7IvdmfL1xZfoUTtffGuMZTukoDcpI5+4RHzpuucIgpu18nKWDNmTxmrU7A AGRFre5ZRQsQ9650mRbBCs4MN7MpZWOrFYmw+AdqD/m8aYCBzB9vYTdg+MZyXUK459OuZ8qeQph 4DSo9FuiDpHWeqlx9AzNWEnj5wy3NZnlDCQ5CtpQpIlHSYJZhdvZPBfSvB1IL8GaiXKOSoqXhGb yDJMsqM3HRJo/k+WmWWxXK7fA+wqd2OdS2bInwyMgggHxiBC1C45/Vx+oNhVrfqsBAw41AqVztj e5s4aTcA3Qzfu1sWmVP30LrdB8UkZjnwaTRgUIe+CWyFjilboh/4ryugE2BuOJiylV8Wr0uGoFI Qnvn6vVU+VSg5/q2dsc0HPq64EILzkawT10T8IPQa1atX2lq2hUyEwzQDAZYjXGs0kkijXYtC+h drvW1+UCb8GzZbtbBexORSxoYeFjR1OoDncK40IyH/8bLq68/EHyqh3t2whJQBxGfyvGhSSw0AA eBG6qyKHKzMN+QCwv7kUGwPBYZ2HvysTHc6vM X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786178851645270044 X-GMAIL-MSGID: 1786178851645270044 In few places functions do not modify pointed "struct s5p_mfc_cmd_args", 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/s5p-mfc/s5p_mfc_cmd.h | 2 +- drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v5.c | 2 +- drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd.h b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd.h index 945d12fdceb7..172c5a63b58e 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd.h +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd.h @@ -19,7 +19,7 @@ struct s5p_mfc_cmd_args { struct s5p_mfc_hw_cmds { int (*cmd_host2risc)(struct s5p_mfc_dev *dev, int cmd, - struct s5p_mfc_cmd_args *args); + const struct s5p_mfc_cmd_args *args); int (*sys_init_cmd)(struct s5p_mfc_dev *dev); int (*sleep_cmd)(struct s5p_mfc_dev *dev); int (*wakeup_cmd)(struct s5p_mfc_dev *dev); diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v5.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v5.c index 1fbf7ed5d4cc..82ee6d300c73 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v5.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v5.c @@ -14,7 +14,7 @@ /* This function is used to send a command to the MFC */ static int s5p_mfc_cmd_host2risc_v5(struct s5p_mfc_dev *dev, int cmd, - struct s5p_mfc_cmd_args *args) + const struct s5p_mfc_cmd_args *args) { int cur_cmd; unsigned long timeout; diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c index 740aa4dfae57..47bc3014b5d8 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c @@ -15,7 +15,7 @@ #include "s5p_mfc_cmd_v6.h" static int s5p_mfc_cmd_host2risc_v6(struct s5p_mfc_dev *dev, int cmd, - struct s5p_mfc_cmd_args *args) + const struct s5p_mfc_cmd_args *args) { mfc_debug(2, "Issue the command: %d\n", cmd); From patchwork Sun Dec 24 15:44: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: 183083 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp11364dyb; Sun, 24 Dec 2023 07:48:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IFFuRZk2q98b5Kre4A8Fm+8ktbc1CSFpi1StEnJByw22J0Z/Ne+o/k0hrjrrg58h8TeFjnX X-Received: by 2002:a05:6214:769:b0:67f:74df:8e64 with SMTP id f9-20020a056214076900b0067f74df8e64mr7684248qvz.45.1703432904846; Sun, 24 Dec 2023 07:48:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703432904; cv=none; d=google.com; s=arc-20160816; b=QretOON0ZwYfwQUaMmhBOz9krKwLw/7ibK25z8EiwurcoTbUX4pwc2YLIo59WYuB4K coOlVKtAS5e31XbjHrLw8nO4ak+qxSAtd1XvDlC52hLMqTlwPU2dHllfDEPz6G9Yefhr X89+SepLVzpWCVugJB5ek2Kr8HPegpQ6h5i45U4+eCwh/W03AzoQEP65R8b9EBpwBG0S OeTjr9/tILPaT3adVczxFsx45K2DghDa6Rertd0GjCZlFCcWZYU04KxffiMJbzBUKGvQ 8dZBvUga3/3gHO9kQ+zQtAHIqWpsDD4x0d8gAtah6XGwPD/sZ29IMobwTJlMaou/om0J Yezw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=J+PqwhjS/mLmgDZ1FNMLs9KmhmVK/DvYHDWz6xCaG9k=; fh=nSSm1dUQDcfnFFwPmoq1SJ6NHxkx1o/ly8tYDPd/KV4=; b=AMOiG+9mOTD7tbXD+L26jPX5VIlzF/P785YIUwJKSE/NIvtWMgGYPm4VJhqiNXKrCJ c61XoKXrkWHmzdLFB0R+sm2QdzaDb8r134fyeSzw50WLqnQCHTFZ6P87BfokPFAX7Dqh yxzfly/v9EbQA4Geqdz1Fi8Nug/V7f9KErBzHqptysYZO6AGyd9vbvU4tOc+4NHc6ueH I6rQ9wiShA5Jkss5yPtf0ajM07WTsStrXDX2vAFiMGBjP6SqFw2wo7B2mEPiTvjjjM6p BVB73GP5Eefp2DQvq93fwgp8L/+adFzu8BxQ4g8KW5Ic3WCs5SuOPGK5k9lvwKzSsRvY d4nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PhEUKsgK; spf=pass (google.com: domain of linux-kernel+bounces-10751-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10751-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 r2-20020a0ce282000000b0067f603604d8si8455814qvl.369.2023.12.24.07.48.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 07:48:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10751-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=PhEUKsgK; spf=pass (google.com: domain of linux-kernel+bounces-10751-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10751-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 951E21C20C95 for ; Sun, 24 Dec 2023 15:48:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E2CE519449; Sun, 24 Dec 2023 15:44:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="PhEUKsgK" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (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 C34F318034 for ; Sun, 24 Dec 2023 15:44:46 +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-wm1-f44.google.com with SMTP id 5b1f17b1804b1-40d4ee4cbbcso15638415e9.2 for ; Sun, 24 Dec 2023 07:44:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703432685; x=1704037485; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=J+PqwhjS/mLmgDZ1FNMLs9KmhmVK/DvYHDWz6xCaG9k=; b=PhEUKsgKLYxfIsgx6EBP5jlB18se7KxfTNb2RgjMFeZ34J7MO7Ule5Ru7NvQ4wQzP0 r+73uVppNKSeIL2kX5NMhU2U/GeO8NZQqNCBcQaBYIJlmo9c2ACs55aPgJkx/22DG6yk I6Bl6qJkencMlu//RaLnBvd5R/tJonydF+6GQ9CleVYtBiBdD+t3ISPqsEj/qUUWDJmr 4L4d+qVF2vjuAgd89Xg2nELn26lUr2oTtzQ8K3xWnFp5BCxfaAJOzDS08z7tAJWx7eE9 sZoPaLpfsb0OMYQT70FAPw24YLBk4z/K0bSJh5GWFnzL7ivsdzGGyvGcslHjvc34je7b OEOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703432685; x=1704037485; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=J+PqwhjS/mLmgDZ1FNMLs9KmhmVK/DvYHDWz6xCaG9k=; b=OZOENfmOgCCGvhIxWEIfKWuRTUNtUZqOtC1/wj4lFwtj/6OZqDzw+JNZ1mYF2W/ZU2 0syPOJyrfopoPuxMvCMDoRxxrHno/HLbsl9TufqarwZjOVI+leysPG46gLKw8zRXLkO+ J+q59k6DOXt/vd8gX+OsqMCNaiMnBK+eZOITR2/9a7ObG1uc7Xqk5f2fs4cp0rbxJjLV 8xzzNjtH0O5dA7kSxVdCpSjKyFPH9mU+PnHz4lK7gtPGMAPi0WqApcVL2UhVTITlk2Dc 7+PCl+b2h0tmImRejnbUIRrXZ/qyTGgo3Q8+aOVElwzTqcFxeeFJDK2h7P/nAalUdEbh Zx2w== X-Gm-Message-State: AOJu0Yx/GOGATeuDjQnoPKvylvr50RuEjvZlmibTxvtR8cY53pcaw+4N GgldUlYD+qywsV4Cad93BMziwyb6+t69ig== X-Received: by 2002:a05:600c:4ed2:b0:40d:5319:4f89 with SMTP id g18-20020a05600c4ed200b0040d53194f89mr1014756wmq.177.1703432685231; Sun, 24 Dec 2023 07:44:45 -0800 (PST) Received: from [127.0.1.1] ([78.10.206.178]) by smtp.gmail.com with ESMTPSA id ge12-20020a170907908c00b00a26ac403032sm3325901ejb.65.2023.12.24.07.44.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 07:44:44 -0800 (PST) From: Krzysztof Kozlowski Date: Sun, 24 Dec 2023 16:44:11 +0100 Subject: [PATCH 12/15] media: s5p-mfc: constify local pointers to s5p_mfc_enc_params Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20231224-n-s5p-mfc-const-v1-12-a3b246470fe4@linaro.org> References: <20231224-n-s5p-mfc-const-v1-0-a3b246470fe4@linaro.org> In-Reply-To: <20231224-n-s5p-mfc-const-v1-0-a3b246470fe4@linaro.org> To: Marek Szyprowski , Andrzej Hajda , Mauro Carvalho Chehab Cc: Aakarsh Jain , linux-fsd@tesla.coma, linux-samsung-soc@vger.kernel.org, Smitha T Murthy , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=5075; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=MyjbnMtRY4pnTAtRZmc7TqzfbEZN91NOwcZsaBA9CSc=; b=owEBfgKB/ZANAwAKAcE3ZuaGi4PXAcsmYgBliFHY3Qe+OEd6XMbY4Xs+O0ln3OAH8/hcDWsSY UvK8SNc3T6JAkQEAAEKAC4WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZYhR2BAca3J6a0BrZXJu ZWwub3JnAAoJEME3ZuaGi4PXfC4P/0lweb+ijrsP6Ae78B2EkRIlDKNMFd6RmLLDTrhU/qJdFXS Zu9CAto7F1C/d1ZOOyeJQnRpOdnu4jkdglkcBKJNVsX6XRdq7N7X4nvfaQmyJfHwcZJkKaUVXrb pMGxl0n4QTRsoeRqzQmn1lQAu1WU9qrAa6w7FGrmqeNa40wNRrGVwcNU6/b+lcHR9SgwZlyi/Hw GEuK8Ka30XhGN4YssiDuWUy4w9/X/Y/Cs4tXALh74oDFHMNy/ZcTIJbuGzqdZ7ylTvPr/rN43hT lIRxj7QlinGuWmpPCYbHbXDuyGme5uNAlUD6Irm6qFNCWdG6e3I1MZG//E48O5c5QF+E3yFQ2Il 6yf3K2H06qadoIqMOws3HCHGs4wJFxZ+ywtd8+KN1JgDgbUDXBmbe9pgiLGZo+A4UZNtJCBZotQ Rwe4YYpBCCfY0tjqV5eMlt1dOc434tYzobZnJdYPRPBJDLxXhx7PinDyup384ru+t7xUN8OjUHS ZnydqBJ9W1IsPa8fVnAw9NYBFzMAq/893T/WvD/AsfknacRW2wHQ8B97/FO690X4kdhn09fLTuE I98q6i2pkTK1mmt3YMtfknWBMtOJ+fAsjQfIJ2oonEKrU7OKtE+j+JdGdwsyBPE805UHOqyVVgW Cu06PMM4bkarU5jOLI9Znk0WK7Fz2FkYKuh7Q X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786178861946539190 X-GMAIL-MSGID: 1786178861946539190 Constify the local variables pointing to "struct s5p_mfc_enc_params" and other encoding params to annotate the function is not modifying pointed data. Signed-off-by: Krzysztof Kozlowski --- .../media/platform/samsung/s5p-mfc/s5p_mfc_opr_v5.c | 14 +++++++------- .../media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c | 18 +++++++++--------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v5.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v5.c index 2a0fb78e8e82..ba22c6a3219a 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v5.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v5.c @@ -674,7 +674,7 @@ static int s5p_mfc_set_enc_ref_buffer_v5(struct s5p_mfc_ctx *ctx) static int s5p_mfc_set_enc_params(struct s5p_mfc_ctx *ctx) { struct s5p_mfc_dev *dev = ctx->dev; - struct s5p_mfc_enc_params *p = &ctx->enc_params; + const struct s5p_mfc_enc_params *p = &ctx->enc_params; unsigned int reg; unsigned int shm; @@ -757,8 +757,8 @@ static int s5p_mfc_set_enc_params(struct s5p_mfc_ctx *ctx) static int s5p_mfc_set_enc_params_h264(struct s5p_mfc_ctx *ctx) { struct s5p_mfc_dev *dev = ctx->dev; - struct s5p_mfc_enc_params *p = &ctx->enc_params; - struct s5p_mfc_h264_enc_params *p_264 = &p->codec.h264; + const struct s5p_mfc_enc_params *p = &ctx->enc_params; + const struct s5p_mfc_h264_enc_params *p_264 = &p->codec.h264; unsigned int reg; unsigned int shm; @@ -914,8 +914,8 @@ static int s5p_mfc_set_enc_params_h264(struct s5p_mfc_ctx *ctx) static int s5p_mfc_set_enc_params_mpeg4(struct s5p_mfc_ctx *ctx) { struct s5p_mfc_dev *dev = ctx->dev; - struct s5p_mfc_enc_params *p = &ctx->enc_params; - struct s5p_mfc_mpeg4_enc_params *p_mpeg4 = &p->codec.mpeg4; + const struct s5p_mfc_enc_params *p = &ctx->enc_params; + const struct s5p_mfc_mpeg4_enc_params *p_mpeg4 = &p->codec.mpeg4; unsigned int reg; unsigned int shm; unsigned int framerate; @@ -993,8 +993,8 @@ static int s5p_mfc_set_enc_params_mpeg4(struct s5p_mfc_ctx *ctx) static int s5p_mfc_set_enc_params_h263(struct s5p_mfc_ctx *ctx) { struct s5p_mfc_dev *dev = ctx->dev; - struct s5p_mfc_enc_params *p = &ctx->enc_params; - struct s5p_mfc_mpeg4_enc_params *p_h263 = &p->codec.mpeg4; + const struct s5p_mfc_enc_params *p = &ctx->enc_params; + const struct s5p_mfc_mpeg4_enc_params *p_h263 = &p->codec.mpeg4; unsigned int reg; unsigned int shm; diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c index 6157c5f97707..08545213caa9 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c @@ -750,7 +750,7 @@ static int s5p_mfc_set_enc_params(struct s5p_mfc_ctx *ctx) { struct s5p_mfc_dev *dev = ctx->dev; const struct s5p_mfc_regs *mfc_regs = dev->mfc_regs; - struct s5p_mfc_enc_params *p = &ctx->enc_params; + const struct s5p_mfc_enc_params *p = &ctx->enc_params; unsigned int reg = 0; mfc_debug_enter(); @@ -1196,8 +1196,8 @@ static int s5p_mfc_set_enc_params_mpeg4(struct s5p_mfc_ctx *ctx) { struct s5p_mfc_dev *dev = ctx->dev; const struct s5p_mfc_regs *mfc_regs = dev->mfc_regs; - struct s5p_mfc_enc_params *p = &ctx->enc_params; - struct s5p_mfc_mpeg4_enc_params *p_mpeg4 = &p->codec.mpeg4; + const struct s5p_mfc_enc_params *p = &ctx->enc_params; + const struct s5p_mfc_mpeg4_enc_params *p_mpeg4 = &p->codec.mpeg4; unsigned int reg = 0; mfc_debug_enter(); @@ -1278,8 +1278,8 @@ static int s5p_mfc_set_enc_params_h263(struct s5p_mfc_ctx *ctx) { struct s5p_mfc_dev *dev = ctx->dev; const struct s5p_mfc_regs *mfc_regs = dev->mfc_regs; - struct s5p_mfc_enc_params *p = &ctx->enc_params; - struct s5p_mfc_mpeg4_enc_params *p_h263 = &p->codec.mpeg4; + const struct s5p_mfc_enc_params *p = &ctx->enc_params; + const struct s5p_mfc_mpeg4_enc_params *p_h263 = &p->codec.mpeg4; unsigned int reg = 0; mfc_debug_enter(); @@ -1348,8 +1348,8 @@ static int s5p_mfc_set_enc_params_vp8(struct s5p_mfc_ctx *ctx) { struct s5p_mfc_dev *dev = ctx->dev; const struct s5p_mfc_regs *mfc_regs = dev->mfc_regs; - struct s5p_mfc_enc_params *p = &ctx->enc_params; - struct s5p_mfc_vp8_enc_params *p_vp8 = &p->codec.vp8; + const struct s5p_mfc_enc_params *p = &ctx->enc_params; + const struct s5p_mfc_vp8_enc_params *p_vp8 = &p->codec.vp8; unsigned int reg = 0; unsigned int val = 0; @@ -1737,8 +1737,8 @@ static int s5p_mfc_h264_set_aso_slice_order_v6(struct s5p_mfc_ctx *ctx) { struct s5p_mfc_dev *dev = ctx->dev; const struct s5p_mfc_regs *mfc_regs = dev->mfc_regs; - struct s5p_mfc_enc_params *p = &ctx->enc_params; - struct s5p_mfc_h264_enc_params *p_h264 = &p->codec.h264; + const struct s5p_mfc_enc_params *p = &ctx->enc_params; + const struct s5p_mfc_h264_enc_params *p_h264 = &p->codec.h264; int i; if (p_h264->aso) { From patchwork Sun Dec 24 15:44: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: 183084 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp11481dyb; Sun, 24 Dec 2023 07:48:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IFv4vIoiFoy/bhIKl7bqKfjFxAW8EC+//PaOkbcBOC8HjhvttTRksv6Yhfm3I3aB+65Lpve X-Received: by 2002:a50:d55a:0:b0:54c:5e18:50e6 with SMTP id f26-20020a50d55a000000b0054c5e1850e6mr2850461edj.42.1703432925486; Sun, 24 Dec 2023 07:48:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703432925; cv=none; d=google.com; s=arc-20160816; b=ODEuNJEhbRonRF00DrVr32ClODR9ucqxsdbRpzMJ7tifu4l7mrWbIMmt/SrZJKlPNg eXq5U78j6EylJSVEGuEyV9s3oMkjtAmbgejTbi80N2NeVtOAbIFTeRFwUPzP/4+SfDWu Dn6tzx8Zo6ABCiP/6P19lYVoCPmRw7YK2UKluLMWeeV/tZaeC0dVdUOGLYXDb2EDggeg yR6LeZXevX456Oy5al080REuzj+vYM7vJbAZcl/OevyeIj+CZDWFMA3TIKv225AlCGbA dVOwzs1QxFx/RtGzzAqgC9wXSalCPHutx8aqo331qTSGRFkpPhyMdRy+/TxHQ+oRjvU7 cpCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=XVcN5riSMTARMq06POG7vm/444G+7336L8LSfQaXxBs=; fh=nSSm1dUQDcfnFFwPmoq1SJ6NHxkx1o/ly8tYDPd/KV4=; b=HtQ4u2KjHeOWi9kI8rxX5qag5Z/smsM+hluxnMOcnEGOaVgeXCr129Cx+RX80KyTNt K95iMfC/Qp5fIhM5y1BocpeefSOrVEhICJw3kFRhDHb9E6xxfVXVo3X3Zo5CJoK25u/6 lpROm+WssZuPsL37r/jy2bB0XefpxR4DYh00i5EU8GRtPgx6fctixhbGbbjrFSdnuT8z xi6D0LGNHQhYC2k61RZ8q8U2kgsmu6I1FzZCqSuzTjh9VCi0E0wM/yRdncomseVJeHMH EbzOtAVlRLAphul0nKjiou5MNZKtyhdTEQ7Be/eRDVsO5KgZLB4Eud31UVC5uOSN0PIU vn/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pMgj1Mat; spf=pass (google.com: domain of linux-kernel+bounces-10752-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10752-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 w24-20020a50d798000000b00554e134aafesi22494edi.209.2023.12.24.07.48.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 07:48:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10752-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=pMgj1Mat; spf=pass (google.com: domain of linux-kernel+bounces-10752-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10752-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 20CED1F217F5 for ; Sun, 24 Dec 2023 15:48:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7FC361A27C; Sun, 24 Dec 2023 15:44:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="pMgj1Mat" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6472B18B19 for ; Sun, 24 Dec 2023 15:44:48 +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-wr1-f50.google.com with SMTP id ffacd0b85a97d-3367f8f8cb0so3299451f8f.2 for ; Sun, 24 Dec 2023 07:44:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703432686; x=1704037486; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=XVcN5riSMTARMq06POG7vm/444G+7336L8LSfQaXxBs=; b=pMgj1MatdDBS7FaCUwbPlaJSZXY3Yf7XmkbItFF4YdEtyXt1Fale+WRFdTx8foweuk 1J7RfavkhOIEOnaMHyeP0alXPiygGe3LXPUz4QhiguVq/5q48p95sNlH6JoiFIxh4GAu 29E5tdL07fcSfajKZCAIvmu+PkqVQ39lnI49pvMvc93KrXDQriHqVcMfMEWoZdsLki0P jfam0QmRemHgHzkT3iwBd4e7ZmgosF9Q0VrJVwcqjcFTPM/Wwhi7kx0h6ZDr9POQqBA5 zeyiF0Js+ubqwhiMc2zbleE5J6LWHMuWcBh06HkyhlYusCC/9NNl4fEUs9yfSbpnsnAh G/CQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703432686; x=1704037486; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XVcN5riSMTARMq06POG7vm/444G+7336L8LSfQaXxBs=; b=MHn/qYAJGwKftlWUUNv5so4F5QAfwckRcEUipLK/TX/g8HK9DOUJ9N98hJXCNpXCXb wnLMJhQIN7kOOCDAbTqVOgd2QeYTbJbE7z4CLLeMT1pAv1ZpVteLbSnSXoaACsLjo/Nt XRoxztaCOfAFlpA4Fd5pAhDctLbKlL5JLK3h4gvHibsV8ctAmUUn/nBgttRGTkLb71Yf leCY7UUDNZFf/QI6N2yXsjQcjRD3Xy5URr86cRu6eRhav33m3whUcncqVi8Dlmo9kxUg mJCnjtWwSP6AC1kB1f6YcB1EX/FepXDjsrFU0KxBfEPrsecBQ3jCvXtJ6IXhDxbk6vH+ ngZQ== X-Gm-Message-State: AOJu0Yzq+XMONjb9TbkdCxzIMk10xJKaVZbgcLhamsriXl2QCVcohlGb RfB4O4Z37jOn1KloOf4srfOTB9/FDr5JwLZW4+bLciBqhgw= X-Received: by 2002:a05:600c:4496:b0:40d:41d4:d29e with SMTP id e22-20020a05600c449600b0040d41d4d29emr2618415wmo.187.1703432686812; Sun, 24 Dec 2023 07:44:46 -0800 (PST) Received: from [127.0.1.1] ([78.10.206.178]) by smtp.gmail.com with ESMTPSA id ge12-20020a170907908c00b00a26ac403032sm3325901ejb.65.2023.12.24.07.44.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 07:44:46 -0800 (PST) From: Krzysztof Kozlowski Date: Sun, 24 Dec 2023 16:44:12 +0100 Subject: [PATCH 13/15] media: s5p-mfc: drop useless clock refcnt debugging Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20231224-n-s5p-mfc-const-v1-13-a3b246470fe4@linaro.org> References: <20231224-n-s5p-mfc-const-v1-0-a3b246470fe4@linaro.org> In-Reply-To: <20231224-n-s5p-mfc-const-v1-0-a3b246470fe4@linaro.org> To: Marek Szyprowski , Andrzej Hajda , Mauro Carvalho Chehab Cc: Aakarsh Jain , linux-fsd@tesla.coma, linux-samsung-soc@vger.kernel.org, Smitha T Murthy , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1302; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=WE1Snd5GEyT+9XFiQa4xPreMZitJzLHNQF3ijMXJQDw=; b=owEBfgKB/ZANAwAKAcE3ZuaGi4PXAcsmYgBliFHZZIG+8mKy9SmVpztKQCav0xncqNdDwVKka nqH6E+6DI+JAkQEAAEKAC4WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZYhR2RAca3J6a0BrZXJu ZWwub3JnAAoJEME3ZuaGi4PXNAUP/Rvi+CzJ5xJAn/VinOjXGWkpHX6R9kHn/YesDFHeL9Sp832 ZzFNQrW2n5n/n8XQ2TqyP+OulqlzA2pBs1Mj+jBJ3VnXIk3QxKh5TF4QcjBmfnVI8RPH/jz6czf M6TrGe/nxEZk/IwFRJkJZ7PEkom483qGVgokD6+WJ+TbP0D70NctCxvCcwQeZ3quTPbKJKUm68m xHtsrXIpMV6U7KrZCKIwifvHJDxCMh4RaBf9bDcuCE69zVARU7I509pLdPOzCi/mJ7z2ome72a6 nTgL1nWo9bOVSuzKrqaa3cSOnOYs3mmi55y+YSekj8XrswA3HtEfZGN2qRm8lT0fCpGnx5IHWKg vaXEs5huJER3uR9RAmyqchL6G6KGIbCVpSD8QiNt6Zmv3hYuDhnkeiMWiEU+XKE5DZkrXdkfpfn ULQtvTd/HOnZ6cHgN1Krw3SYT69G65YHsnHlZ1uvSDO8qhEJBRMTtpIA6TNiggdUI72kyD1OxbA D6UQm4D2Mq0e+fSmU3LqSSA8X3SjhYfC03HjofEeMcZbWVj0tmsuQh8WgQUDspvr94N/yNsX1Zt f8wSyU6xB6FIxuHPVwIZaN/oTaxYutPFt9UmQq8ShIDLgyemFAXvgZbAUFbcJo6jm/xUypZ0Lio +hyuqisZk805huiYqOMV0HtVS04GjKnA2f1kM X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786178883292796083 X-GMAIL-MSGID: 1786178883292796083 Drop useless debugging of clock enabl/disable counts, because core handles this much better. Signed-off-by: Krzysztof Kozlowski --- drivers/media/platform/samsung/s5p-mfc/s5p_mfc_pm.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_pm.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_pm.c index 187849841a28..29b141d4a7a7 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_pm.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_pm.c @@ -16,7 +16,6 @@ static struct s5p_mfc_pm *pm; static struct s5p_mfc_dev *p_dev; -static atomic_t clk_ref; int s5p_mfc_init_pm(struct s5p_mfc_dev *dev) { @@ -49,7 +48,6 @@ int s5p_mfc_init_pm(struct s5p_mfc_dev *dev) pm->clock_gate = pm->clocks[0]; pm_runtime_enable(pm->device); - atomic_set(&clk_ref, 0); return 0; } @@ -60,17 +58,11 @@ void s5p_mfc_final_pm(struct s5p_mfc_dev *dev) int s5p_mfc_clock_on(void) { - atomic_inc(&clk_ref); - mfc_debug(3, "+ %d\n", atomic_read(&clk_ref)); - return clk_enable(pm->clock_gate); } void s5p_mfc_clock_off(void) { - atomic_dec(&clk_ref); - mfc_debug(3, "- %d\n", atomic_read(&clk_ref)); - clk_disable(pm->clock_gate); } From patchwork Sun Dec 24 15:44: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: 183085 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp11523dyb; Sun, 24 Dec 2023 07:48:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IHEAU5aQpPqUFMNAUpmk/nDkkopo5zdKt+5w46AE8mbsxyPgKNuKGmusOvvRy6/rEAHGMl7 X-Received: by 2002:a05:6808:3999:b0:3b9:d5e3:8f28 with SMTP id gq25-20020a056808399900b003b9d5e38f28mr7611559oib.57.1703432936200; Sun, 24 Dec 2023 07:48:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703432936; cv=none; d=google.com; s=arc-20160816; b=wrE0MPChBqGnOuRJvVP6475i4OAYJ80IgIX8DRCV0KeJk6X9geXzxCspB+srdJsB+Z JLfHnjGs0gUQxXgdg5Q+DP4MYW0GJqNa3n5i82+qKQj0Z1I3QSEFjH+Qw67sbM61R5PR XZY0oECglzo62zjtA3L4pBKo1DKcpzRRo4Jc/xjxxL+JO9/v7uB+ZiGt0p2fwKHmfW2F wOLXKTybFtn3cNB8JgLDzqOYL+R8dH7SWbX2mvbrBp9T/xZbkHtCbZ5+NHJE9nJWsf0w QVUCvabsPy+sazmBF6Rm+v7l8ByfL3o1LwhNh2azSGITG0Sb1XzU9akFaESniUo5fpgo Tbog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=NDWXSVz2KCM79MpUKy9CV++h5zIlk2lSIe/fyWdkp3E=; fh=nSSm1dUQDcfnFFwPmoq1SJ6NHxkx1o/ly8tYDPd/KV4=; b=RDSi9As0ITie2CFwWB7L3N4gPZQkmu1kORgdvmc17L//hWqJNQ7lrkrw26pv67g1CP ChT0p4g4a5oXOtuIYI6jmOdavLcDixGGK2vG/phQmwTuyOY41yyvp5z33KmEIPoUf+y7 ZVi7gwDUl04g2IJE2iBnRyBjAmYkM171ov9MRET3lP2PvXM+GvqmV6/wdgvs49mc58WW 6kyrW88bD7xFpBr3yryhOdfGxwcX/9xva40ixHqYGaLb0qarj78UfAXhQW8AS4msXaPV NQtdy4FlQAl89Aoz/TeLPzna8E9G11IO8rkIEg8xqITjHZj9XuZU2Vpz7Lz6HLEF5grP 4SAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eXUHames; spf=pass (google.com: domain of linux-kernel+bounces-10753-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10753-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 h17-20020a63f911000000b005c66368cfb2si6453325pgi.451.2023.12.24.07.48.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 07:48:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10753-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=eXUHames; spf=pass (google.com: domain of linux-kernel+bounces-10753-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10753-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 EED60282172 for ; Sun, 24 Dec 2023 15:48:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9AC541A706; Sun, 24 Dec 2023 15:44:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="eXUHames" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 8DE3C18EA8 for ; Sun, 24 Dec 2023 15:44:49 +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-wm1-f41.google.com with SMTP id 5b1f17b1804b1-40c48d7a7a7so30354785e9.3 for ; Sun, 24 Dec 2023 07:44:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703432688; x=1704037488; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=NDWXSVz2KCM79MpUKy9CV++h5zIlk2lSIe/fyWdkp3E=; b=eXUHamesL1A/d5w794XdZzORxWbmHKraSE6CmDNq/ofpwMLMT74NkXNA/2AJxkCzxT zZuZxTNMk9Cmmhu2SsfNSjiyp55LIFQdSmp/hqajhaV2i3eEac1n0cEdM3Og+8drgMBi +5loAGNtexCshlV01dinvydcIZKhlHDuAf+aWF+lPJDKADztYHwBlj03RXC/hj9Gm1h7 QwUDWfjLO9JcolIp/OmM6gQmFEMLOsV3MAszErk89BFvo1KNt0156HDewtxK1LqIonsz nqHz+PrOixhBK2pOjBZHcGHg7VUQBB9riHQBc2SGq02M9mLvuJ8Kp6AWBYogib7sTtDH 5ScA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703432688; x=1704037488; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NDWXSVz2KCM79MpUKy9CV++h5zIlk2lSIe/fyWdkp3E=; b=BK1RQLSn1gOEL8aDBlbV9IMP5R4O/3+wbY9sjVN6VdPW2k+6rD1UrZC56cyzRNXVzj VkwvGTZvxkrRMINctrD0LShF0PxHauUHSKDy2FF5riOADhZBXLBP8d3fxP3b9AYZr83i 3/Tw18hvqAcAgsfwcD4a/ZELtyfbdAVUC1r8HtilQDdia3cF0gXqxxpkyCwWZiA5ihfk Y05OWa+dTXkW9vYIRGwb81JgHPFhWpivsv4S8+Fte0iZ8ZNXt442AIdVaDY4h3dLOggR o0RE3hwoeT0oDC+qoXGfSxn4FxJG8hisKg0Q50xGLQhcGpcAbayXN4RMdPYiLc2UkOUy 2LPg== X-Gm-Message-State: AOJu0YwnU933mDOdczjVAa0mA4tT/GQxaiZEboad/5PcGrthmgBqqDPq feOVyidiqq38+fOQf46l+EECVfGYTeh3KQ== X-Received: by 2002:a05:600c:6010:b0:40d:4a22:2628 with SMTP id az16-20020a05600c601000b0040d4a222628mr2192791wmb.41.1703432687952; Sun, 24 Dec 2023 07:44:47 -0800 (PST) Received: from [127.0.1.1] ([78.10.206.178]) by smtp.gmail.com with ESMTPSA id ge12-20020a170907908c00b00a26ac403032sm3325901ejb.65.2023.12.24.07.44.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 07:44:47 -0800 (PST) From: Krzysztof Kozlowski Date: Sun, 24 Dec 2023 16:44:13 +0100 Subject: [PATCH 14/15] media: s5p-mfc: drop useless static s5p_mfc_dev in s5p_mfc_pm.c Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20231224-n-s5p-mfc-const-v1-14-a3b246470fe4@linaro.org> References: <20231224-n-s5p-mfc-const-v1-0-a3b246470fe4@linaro.org> In-Reply-To: <20231224-n-s5p-mfc-const-v1-0-a3b246470fe4@linaro.org> To: Marek Szyprowski , Andrzej Hajda , Mauro Carvalho Chehab Cc: Aakarsh Jain , linux-fsd@tesla.coma, linux-samsung-soc@vger.kernel.org, Smitha T Murthy , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=900; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=Fa0Mi6emzcHWlV3HqGPkNIGFTFGr3syiwm86et4G/MQ=; b=owEBfgKB/ZANAwAKAcE3ZuaGi4PXAcsmYgBliFHakB4/85S8Dq/xnyUAP9r3ll9Vk3PEZrgw3 YLe2PK+BaSJAkQEAAEKAC4WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZYhR2hAca3J6a0BrZXJu ZWwub3JnAAoJEME3ZuaGi4PX5cMP/2n4Kw5KHfACgSOfmcfQArYZIb+skcaVjpV8F7FNt9M7ME4 Y8yjpVUVDiWhhq91AfEMMkHVuotmu7QmSvd/O/vqyT/ViG1i5CkKKaNUEEsodVzeyJsnuKliwbM KOZV6ENgQhUMON6zfBQzzpnIWH15dfw7Ji3amRhzKokepHfd4AZQVzNwp6hZ0XM+pVCcfQWyr96 2hrEP7utbe0DKa69xmVM1AgRK8n6npoDn6zT5YSPYCwLaqJGDa1xJRd9ZNJ8rDcm7dK468s87ZB t2c29BxhfPLlp3CbEJK+HGZ77fxpMMzbRYoNH429EcbkYr0xEf4YnCynXljt6/6+N5FooRiwThA ZN2WGMs/ZCCGs5FiTGDUPwmN3tXmnhM4uxiRK5YLl88QlRXfgh1kABh1HDRjUxr0t0buSl06ru+ LHfhj3eUygC2p9fFeKrrkxblD7x3VxFamc6M0ycluZGDSlOqwjgjQlGt/7EEE8qgSkgfNNgFKwX 2bCCvkq/+cG0ecWzegql68O52CRZK6lMcB0e4BFNSr2n0rutChRK/k3+leK1IGUJhRPWVW3G1nj 090RINJD1iprvTJoDbcMsBoxyJFAdnj95c889/klSMpx91lR+2+Y9yPqp3OXCDsLRF9ZD2IwuVo R3dgcW7CoxXVJYJ9jQb8r7Wh0W/dpJe+4x4c8 X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786178894409005261 X-GMAIL-MSGID: 1786178894409005261 Pointer "struct s5p_mfc_dev" is stored in s5p_mfc_pm.c once and never used again. Signed-off-by: Krzysztof Kozlowski --- drivers/media/platform/samsung/s5p-mfc/s5p_mfc_pm.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_pm.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_pm.c index 29b141d4a7a7..ecb3065c33c9 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_pm.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_pm.c @@ -15,15 +15,12 @@ #include "s5p_mfc_pm.h" static struct s5p_mfc_pm *pm; -static struct s5p_mfc_dev *p_dev; int s5p_mfc_init_pm(struct s5p_mfc_dev *dev) { int i; pm = &dev->pm; - p_dev = dev; - pm->num_clocks = dev->variant->num_clocks; pm->clk_names = dev->variant->clk_names; pm->device = &dev->plat_dev->dev; From patchwork Sun Dec 24 15:44: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: 183086 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp11590dyb; Sun, 24 Dec 2023 07:49:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IFCE2bDQqmlUBZsNFkwYyD7cSG0JE/vYlIySJ4+lkM5tOeUIi3hPx0zpK1KJe2MP9SXfpiN X-Received: by 2002:a05:6214:769:b0:67f:67e0:f5db with SMTP id f9-20020a056214076900b0067f67e0f5dbmr8641970qvz.42.1703432951041; Sun, 24 Dec 2023 07:49:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703432951; cv=none; d=google.com; s=arc-20160816; b=R4+MPp7kHWPf26C4+uI/gPpSp0E0maUi2eA93n877AODTt6JNz4aaC2VbDZFbOzw4m fIXbCO1vSGFZYTKdx7lJsmZtmql4IoL/TpRCne+UJYLau9SbrX/P2m37Tx5++Y0cUQXn YcJUO58vs+y2/i8cjrUb9ZR0zsKdztB0K7VscOobyK1Txl5sLUK7M+0HY0SMdJNojLYV lwIDh2K4xVb1nmhGrWb4E8Vb8iEbxZfhm0qXMbY45hvnXSeIXSWm0/5Jjwc8XM8jfWrn IK3GTDt3qtL81QyjI1cWOwSbaqsJQDpFPT+Gw3feCPrrQbUmrKtBWa6W+Uw/BQcvOdFE +5dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=9fVNG4Y8BtKOiiWYZzA5tpbOxA0mNOHdL3iVKTq8o3c=; fh=nSSm1dUQDcfnFFwPmoq1SJ6NHxkx1o/ly8tYDPd/KV4=; b=QeelCO9/Brd2F4K00r1vxjEolcg97nUykVHTTTdtcksYFvPeDZo3Pq9ftgOi9O3MNS VoJ/++AWrVZhgzAhohPFDq1ZMzS9Azo6cpLjC4VUWx0g1BdtFg/NBY22ABfbhu3mQ3w9 xAS2LeZ49PfUPxQrDergOgVh3/RNbg0K1MpInWAT33Yc5KOsUYM66vsE1c0hpafOhsJP 3jZg37SiVzZlr56LD/DQZSGY+AQO4yQFhD2R95sCuPPNd88zrAqLoTLpiJMvnudFITJJ Q8zGS+dhWRD+iJG3BG66nhhtMuKwCmzxAopm9vfzYVV27KTKMfBn1Lg4zmkj6IDSBDwm hQCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iPrQvliA; spf=pass (google.com: domain of linux-kernel+bounces-10754-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10754-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 r2-20020a0ce282000000b0067f603604d8si8455814qvl.369.2023.12.24.07.49.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 07:49:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10754-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=iPrQvliA; spf=pass (google.com: domain of linux-kernel+bounces-10754-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10754-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 BC5651C21694 for ; Sun, 24 Dec 2023 15:49:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4E2711C2A8; Sun, 24 Dec 2023 15:44:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="iPrQvliA" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.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 C50B218EDD for ; Sun, 24 Dec 2023 15:44:50 +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-f48.google.com with SMTP id a640c23a62f3a-a2698eae0a9so378941566b.3 for ; Sun, 24 Dec 2023 07:44:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703432689; x=1704037489; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=9fVNG4Y8BtKOiiWYZzA5tpbOxA0mNOHdL3iVKTq8o3c=; b=iPrQvliAaOxW7nbmBOVOeBfxHCUv+I2dNqyDkA3VZfHv7XQMhwxJBU0I3c81+l15G2 TEa3dRt89vlO4okt/lpbUPzo+ijRE/dTpCB53Ccga+ndw1QmwkbreiOFxe1Tn9gisgfE ww0TqMOIx8uMg/BSHDWdc6a2HbaP/ioXTiJtvoUMA5aHe+ANxHB1I15nm540u9pgMqp6 FbRx7QTfY+SVvLeXxtK/x6/mAcX67/VZ5MB5BGCbCHloaxGzBMhQSnqTrLejkLF06Vsz 1R7l4Y184NjgJeNZrOsiKoCnGluSg98zqOBTyYBDCh2wavu08PkdNP71bDsCZYdaWSGJ PbdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703432689; x=1704037489; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9fVNG4Y8BtKOiiWYZzA5tpbOxA0mNOHdL3iVKTq8o3c=; b=pMBqlRtl5aHWL6ZsxEJR1quZjRUmtqIIVsUIOprToysSdtu9mWu65LvyT6K2BzVg5E eLaI+UCbaKmyEbPxDOaPKBRV0iP/zDwPwsBk1npg0VFExcN4gS3T2lwZOBw1CICIPPmz iPGmy+JtieTiRGRMpBiL2TjO37aPLGi4qJxQ/kqq3H5Yk8VOhwy71DtYVE0lb3Te6f6J RPvmMQyhySium40munyhYDzOdAwtorL/uPKWujfsBxeN3/aqPRYInla4MpYaRdSNhvbc UL2ZVnqevfHhsF9r66qUArBP7oF6uqU475AtJWQLcuwaAO9mz8zcv0yjE5ECci/rlDcG lsdw== X-Gm-Message-State: AOJu0YwUy29WhgzC1dhK47CrM96yUrvKUOsUgLFYrfjFlYrH1NSFxal3 3uN/m8NjGgwjdoucnJQVZactNt8k7HfXkw== X-Received: by 2002:a17:906:549:b0:a23:6258:bcc9 with SMTP id k9-20020a170906054900b00a236258bcc9mr2005321eja.64.1703432689199; Sun, 24 Dec 2023 07:44:49 -0800 (PST) Received: from [127.0.1.1] ([78.10.206.178]) by smtp.gmail.com with ESMTPSA id ge12-20020a170907908c00b00a26ac403032sm3325901ejb.65.2023.12.24.07.44.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 07:44:48 -0800 (PST) From: Krzysztof Kozlowski Date: Sun, 24 Dec 2023 16:44:14 +0100 Subject: [PATCH 15/15] media: s5p-mfc: drop static device variable in s5p_mfc_pm.c Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20231224-n-s5p-mfc-const-v1-15-a3b246470fe4@linaro.org> References: <20231224-n-s5p-mfc-const-v1-0-a3b246470fe4@linaro.org> In-Reply-To: <20231224-n-s5p-mfc-const-v1-0-a3b246470fe4@linaro.org> To: Marek Szyprowski , Andrzej Hajda , Mauro Carvalho Chehab Cc: Aakarsh Jain , linux-fsd@tesla.coma, linux-samsung-soc@vger.kernel.org, Smitha T Murthy , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=16454; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=hxNRpET1TD7wWdvfDUE12WprGqdoNFx+n/H4LB7+u3U=; b=owEBfgKB/ZANAwAKAcE3ZuaGi4PXAcsmYgBliFHbN0m9OIqeTiRrH6SZ36lxQUr5mM+jMmy/w vmnzQcPf2aJAkQEAAEKAC4WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZYhR2xAca3J6a0BrZXJu ZWwub3JnAAoJEME3ZuaGi4PXm4wP/2kAVl3TGxBeMbzCR4c5E3CpbdGAG+iAprZBp+xXhv2ndG4 xW9+dg/vrnASrfFQJEXd/QtmgVe9+joCGv9ULMcVc9e5NroL9XsFago9t89gzBc348N+EgiwK33 xbuQcnpAjnyLXgJlTVYphb9Tvu6dpsa93SUhFdEWMhEFbbIud5Y5upjVJxq+KsPkZCHIjVAom0q 8H9ly5MNARySKhAlsHLXMy/Ib7muzp6uEW8r6llcpYw9spLBPsLdbDegcJpmN++KdfkbfCBb1L3 PP2tW4C4NoQBJr1NkN+cYnqUTKji+FGzEhQrL7+RBH+QJDgoJPjMEHUMx8Ft3e359FYKAvIfPAZ LISmEPE5cXRvTFt6NAWBZ92aeyqrxXcA8a+hjt64aq/2pfD6XJV5iyD0Fcb/Dy1Obr116yJ4ob0 oBRYQaxT2dn1ehmh6Aht4Hr3BT3M0PdmbBtbp1lr15T+z12ogkR3GUepLz8iJJpMp0OyxKRpRdg Jj+kbaS2ajLSJiYOjoxqNMi8z1LUuFPNdIJ1IQXUSGjKvboWYrK7ck/ejmSPo8ftePaSrDXKbcX PLiHf1g/p+4MssPi5ti/1opbASfr7sZnIJTUEsKJm/iVbz5y+mkplIWrfyoxhnn6bxbiNk+gYw3 T7GPS3AN9HHzSupqh2HTnzYk5B28PGZGPvIZc X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786178910189421008 X-GMAIL-MSGID: 1786178910189421008 Change the interface of power management functions in s5p_mfc_pm.c to accept the pointer to S5P MFC device structure. instead of relying on file-scope static variable. This makes code easier to read and modify in case more devices are added. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Aakarsh Jain --- drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c | 42 +++++++++++----------- .../media/platform/samsung/s5p-mfc/s5p_mfc_ctrl.c | 26 +++++++------- .../media/platform/samsung/s5p-mfc/s5p_mfc_dec.c | 8 ++--- .../platform/samsung/s5p-mfc/s5p_mfc_opr_v5.c | 4 +-- .../platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c | 8 ++--- .../media/platform/samsung/s5p-mfc/s5p_mfc_pm.c | 40 ++++++++++----------- .../media/platform/samsung/s5p-mfc/s5p_mfc_pm.h | 8 ++--- 7 files changed, 67 insertions(+), 69 deletions(-) diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c index 5d10c1cb8b92..f0bda2f7f1c2 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c @@ -183,7 +183,7 @@ static void s5p_mfc_watchdog_worker(struct work_struct *work) mfc_err("Error: some instance may be closing/opening\n"); spin_lock_irqsave(&dev->irqlock, flags); - s5p_mfc_clock_off(); + s5p_mfc_clock_off(dev); for (i = 0; i < MFC_NUM_CONTEXTS; i++) { ctx = dev->ctx[i]; @@ -211,9 +211,9 @@ static void s5p_mfc_watchdog_worker(struct work_struct *work) mfc_err("Failed to reload FW\n"); goto unlock; } - s5p_mfc_clock_on(); + s5p_mfc_clock_on(dev); ret = s5p_mfc_init_hw(dev); - s5p_mfc_clock_off(); + s5p_mfc_clock_off(dev); if (ret) mfc_err("Failed to reinit FW\n"); } @@ -393,7 +393,7 @@ static void s5p_mfc_handle_frame(struct s5p_mfc_ctx *ctx, s5p_mfc_hw_call(dev->mfc_ops, clear_int_flags, dev); wake_up_ctx(ctx, reason, err); WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0); - s5p_mfc_clock_off(); + s5p_mfc_clock_off(dev); s5p_mfc_hw_call(dev->mfc_ops, try_run, dev); return; } @@ -465,7 +465,7 @@ static void s5p_mfc_handle_frame(struct s5p_mfc_ctx *ctx, s5p_mfc_hw_call(dev->mfc_ops, clear_int_flags, dev); wake_up_ctx(ctx, reason, err); WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0); - s5p_mfc_clock_off(); + s5p_mfc_clock_off(dev); /* if suspending, wake up device and do not try_run again*/ if (test_bit(0, &dev->enter_suspend)) wake_up_dev(dev, reason, err); @@ -509,7 +509,7 @@ static void s5p_mfc_handle_error(struct s5p_mfc_dev *dev, } WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0); s5p_mfc_hw_call(dev->mfc_ops, clear_int_flags, dev); - s5p_mfc_clock_off(); + s5p_mfc_clock_off(dev); wake_up_dev(dev, reason, err); } @@ -565,7 +565,7 @@ static void s5p_mfc_handle_seq_done(struct s5p_mfc_ctx *ctx, s5p_mfc_hw_call(dev->mfc_ops, clear_int_flags, dev); clear_work_bit(ctx); WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0); - s5p_mfc_clock_off(); + s5p_mfc_clock_off(dev); s5p_mfc_hw_call(dev->mfc_ops, try_run, dev); wake_up_ctx(ctx, reason, err); } @@ -601,14 +601,14 @@ static void s5p_mfc_handle_init_buffers(struct s5p_mfc_ctx *ctx, } WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0); - s5p_mfc_clock_off(); + s5p_mfc_clock_off(dev); wake_up(&ctx->queue); s5p_mfc_hw_call(dev->mfc_ops, try_run, dev); } else { WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0); - s5p_mfc_clock_off(); + s5p_mfc_clock_off(dev); wake_up(&ctx->queue); } @@ -636,7 +636,7 @@ static void s5p_mfc_handle_stream_complete(struct s5p_mfc_ctx *ctx) WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0); - s5p_mfc_clock_off(); + s5p_mfc_clock_off(dev); wake_up(&ctx->queue); s5p_mfc_hw_call(dev->mfc_ops, try_run, dev); } @@ -688,7 +688,7 @@ static irqreturn_t s5p_mfc_irq(int irq, void *priv) } s5p_mfc_hw_call(dev->mfc_ops, clear_int_flags, dev); WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0); - s5p_mfc_clock_off(); + s5p_mfc_clock_off(dev); wake_up_ctx(ctx, reason, err); s5p_mfc_hw_call(dev->mfc_ops, try_run, dev); } else { @@ -752,7 +752,7 @@ static irqreturn_t s5p_mfc_irq(int irq, void *priv) if (test_and_clear_bit(0, &dev->hw_lock) == 0) mfc_err("Failed to unlock hw\n"); - s5p_mfc_clock_off(); + s5p_mfc_clock_off(dev); clear_work_bit(ctx); wake_up(&ctx->queue); @@ -837,20 +837,20 @@ static int s5p_mfc_open(struct file *file) dev->watchdog_timer.expires = jiffies + msecs_to_jiffies(MFC_WATCHDOG_INTERVAL); add_timer(&dev->watchdog_timer); - ret = s5p_mfc_power_on(); + ret = s5p_mfc_power_on(dev); if (ret < 0) { mfc_err("power on failed\n"); goto err_pwr_enable; } - s5p_mfc_clock_on(); + s5p_mfc_clock_on(dev); ret = s5p_mfc_load_firmware(dev); if (ret) { - s5p_mfc_clock_off(); + s5p_mfc_clock_off(dev); goto err_load_fw; } /* Init the FW */ ret = s5p_mfc_init_hw(dev); - s5p_mfc_clock_off(); + s5p_mfc_clock_off(dev); if (ret) goto err_init_hw; } @@ -927,7 +927,7 @@ static int s5p_mfc_open(struct file *file) err_load_fw: err_pwr_enable: if (dev->num_inst == 1) { - if (s5p_mfc_power_off() < 0) + if (s5p_mfc_power_off(dev) < 0) mfc_err("power off failed\n"); del_timer_sync(&dev->watchdog_timer); } @@ -959,7 +959,7 @@ static int s5p_mfc_release(struct file *file) vb2_queue_release(&ctx->vq_src); vb2_queue_release(&ctx->vq_dst); if (dev) { - s5p_mfc_clock_on(); + s5p_mfc_clock_on(dev); /* Mark context as idle */ clear_work_bit_irqsave(ctx); @@ -979,12 +979,12 @@ static int s5p_mfc_release(struct file *file) mfc_debug(2, "Last instance\n"); s5p_mfc_deinit_hw(dev); del_timer_sync(&dev->watchdog_timer); - s5p_mfc_clock_off(); - if (s5p_mfc_power_off() < 0) + s5p_mfc_clock_off(dev); + if (s5p_mfc_power_off(dev) < 0) mfc_err("Power off failed\n"); } else { mfc_debug(2, "Shutting down clock\n"); - s5p_mfc_clock_off(); + s5p_mfc_clock_off(dev); } } if (dev) diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_ctrl.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_ctrl.c index 6d3c92045c05..8eedf6524c39 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_ctrl.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_ctrl.c @@ -215,7 +215,7 @@ int s5p_mfc_init_hw(struct s5p_mfc_dev *dev) /* 0. MFC reset */ mfc_debug(2, "MFC reset..\n"); - s5p_mfc_clock_on(); + s5p_mfc_clock_on(dev); dev->risc_on = 0; ret = s5p_mfc_reset(dev); if (ret) { @@ -243,7 +243,7 @@ int s5p_mfc_init_hw(struct s5p_mfc_dev *dev) if (s5p_mfc_wait_for_done_dev(dev, S5P_MFC_R2H_CMD_FW_STATUS_RET)) { mfc_err("Failed to load firmware\n"); s5p_mfc_reset(dev); - s5p_mfc_clock_off(); + s5p_mfc_clock_off(dev); return -EIO; } s5p_mfc_clean_dev_int_flags(dev); @@ -252,14 +252,14 @@ int s5p_mfc_init_hw(struct s5p_mfc_dev *dev) if (ret) { mfc_err("Failed to send command to MFC - timeout\n"); s5p_mfc_reset(dev); - s5p_mfc_clock_off(); + s5p_mfc_clock_off(dev); return ret; } mfc_debug(2, "Ok, now will wait for completion of hardware init\n"); if (s5p_mfc_wait_for_done_dev(dev, S5P_MFC_R2H_CMD_SYS_INIT_RET)) { mfc_err("Failed to init hardware\n"); s5p_mfc_reset(dev); - s5p_mfc_clock_off(); + s5p_mfc_clock_off(dev); return -EIO; } dev->int_cond = 0; @@ -269,7 +269,7 @@ int s5p_mfc_init_hw(struct s5p_mfc_dev *dev) mfc_err("Failed to init firmware - error: %d int: %d\n", dev->int_err, dev->int_type); s5p_mfc_reset(dev); - s5p_mfc_clock_off(); + s5p_mfc_clock_off(dev); return -EIO; } if (IS_MFCV6_PLUS(dev)) @@ -279,7 +279,7 @@ int s5p_mfc_init_hw(struct s5p_mfc_dev *dev) mfc_debug(2, "MFC F/W version : %02xyy, %02xmm, %02xdd\n", (ver >> 16) & 0xFF, (ver >> 8) & 0xFF, ver & 0xFF); - s5p_mfc_clock_off(); + s5p_mfc_clock_off(dev); mfc_debug_leave(); return 0; } @@ -288,12 +288,12 @@ int s5p_mfc_init_hw(struct s5p_mfc_dev *dev) /* Deinitialize hardware */ void s5p_mfc_deinit_hw(struct s5p_mfc_dev *dev) { - s5p_mfc_clock_on(); + s5p_mfc_clock_on(dev); s5p_mfc_reset(dev); s5p_mfc_hw_call(dev->mfc_ops, release_dev_context_buffer, dev); - s5p_mfc_clock_off(); + s5p_mfc_clock_off(dev); } int s5p_mfc_sleep(struct s5p_mfc_dev *dev) @@ -301,7 +301,7 @@ int s5p_mfc_sleep(struct s5p_mfc_dev *dev) int ret; mfc_debug_enter(); - s5p_mfc_clock_on(); + s5p_mfc_clock_on(dev); s5p_mfc_clean_dev_int_flags(dev); ret = s5p_mfc_hw_call(dev->mfc_cmds, sleep_cmd, dev); if (ret) { @@ -312,7 +312,7 @@ int s5p_mfc_sleep(struct s5p_mfc_dev *dev) mfc_err("Failed to sleep\n"); return -EIO; } - s5p_mfc_clock_off(); + s5p_mfc_clock_off(dev); dev->int_cond = 0; if (dev->int_err != 0 || dev->int_type != S5P_MFC_R2H_CMD_SLEEP_RET) { @@ -384,12 +384,12 @@ int s5p_mfc_wakeup(struct s5p_mfc_dev *dev) mfc_debug_enter(); /* 0. MFC reset */ mfc_debug(2, "MFC reset..\n"); - s5p_mfc_clock_on(); + s5p_mfc_clock_on(dev); dev->risc_on = 0; ret = s5p_mfc_reset(dev); if (ret) { mfc_err("Failed to reset MFC - timeout\n"); - s5p_mfc_clock_off(); + s5p_mfc_clock_off(dev); return ret; } mfc_debug(2, "Done MFC reset..\n"); @@ -404,7 +404,7 @@ int s5p_mfc_wakeup(struct s5p_mfc_dev *dev) else ret = s5p_mfc_wait_wakeup(dev); - s5p_mfc_clock_off(); + s5p_mfc_clock_off(dev); if (ret) return ret; diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.c index eef26d4e02cf..b620db8896e1 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.c @@ -477,7 +477,7 @@ static int reqbufs_output(struct s5p_mfc_dev *dev, struct s5p_mfc_ctx *ctx, { int ret = 0; - s5p_mfc_clock_on(); + s5p_mfc_clock_on(dev); if (reqbufs->count == 0) { mfc_debug(2, "Freeing buffers\n"); @@ -514,7 +514,7 @@ static int reqbufs_output(struct s5p_mfc_dev *dev, struct s5p_mfc_ctx *ctx, ret = -EINVAL; } out: - s5p_mfc_clock_off(); + s5p_mfc_clock_off(dev); if (ret) mfc_err("Failed allocating buffers for OUTPUT queue\n"); return ret; @@ -525,7 +525,7 @@ static int reqbufs_capture(struct s5p_mfc_dev *dev, struct s5p_mfc_ctx *ctx, { int ret = 0; - s5p_mfc_clock_on(); + s5p_mfc_clock_on(dev); if (reqbufs->count == 0) { mfc_debug(2, "Freeing buffers\n"); @@ -568,7 +568,7 @@ static int reqbufs_capture(struct s5p_mfc_dev *dev, struct s5p_mfc_ctx *ctx, ret = -EINVAL; } out: - s5p_mfc_clock_off(); + s5p_mfc_clock_off(dev); if (ret) mfc_err("Failed allocating buffers for CAPTURE queue\n"); return ret; diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v5.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v5.c index ba22c6a3219a..87492db83536 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v5.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v5.c @@ -1346,7 +1346,7 @@ static void s5p_mfc_try_run_v5(struct s5p_mfc_dev *dev) * Last frame has already been sent to MFC. * Now obtaining frames from MFC buffer */ - s5p_mfc_clock_on(); + s5p_mfc_clock_on(dev); s5p_mfc_clean_ctx_int_flags(ctx); if (ctx->type == MFCINST_DECODER) { @@ -1422,7 +1422,7 @@ static void s5p_mfc_try_run_v5(struct s5p_mfc_dev *dev) * scheduled, reduce the clock count as no one will * ever do this, because no interrupt related to this try_run * will ever come from hardware. */ - s5p_mfc_clock_off(); + s5p_mfc_clock_off(dev); } } diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c index 08545213caa9..8908c159a91e 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c @@ -1992,7 +1992,7 @@ static void s5p_mfc_try_run_v6(struct s5p_mfc_dev *dev) /* Last frame has already been sent to MFC * Now obtaining frames from MFC buffer */ - s5p_mfc_clock_on(); + s5p_mfc_clock_on(dev); s5p_mfc_clean_ctx_int_flags(ctx); if (ctx->type == MFCINST_DECODER) { @@ -2072,7 +2072,7 @@ static void s5p_mfc_try_run_v6(struct s5p_mfc_dev *dev) * scheduled, reduce the clock count as no one will * ever do this, because no interrupt related to this try_run * will ever come from hardware. */ - s5p_mfc_clock_off(); + s5p_mfc_clock_off(dev); } } @@ -2088,9 +2088,9 @@ s5p_mfc_read_info_v6(struct s5p_mfc_ctx *ctx, unsigned long ofs) { int ret; - s5p_mfc_clock_on(); + s5p_mfc_clock_on(ctx->dev); ret = readl((void __iomem *)ofs); - s5p_mfc_clock_off(); + s5p_mfc_clock_off(ctx->dev); return ret; } diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_pm.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_pm.c index ecb3065c33c9..ae4241408383 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_pm.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_pm.c @@ -14,13 +14,11 @@ #include "s5p_mfc_debug.h" #include "s5p_mfc_pm.h" -static struct s5p_mfc_pm *pm; - int s5p_mfc_init_pm(struct s5p_mfc_dev *dev) { + struct s5p_mfc_pm *pm = &dev->pm; int i; - pm = &dev->pm; pm->num_clocks = dev->variant->num_clocks; pm->clk_names = dev->variant->clk_names; pm->device = &dev->plat_dev->dev; @@ -50,58 +48,58 @@ int s5p_mfc_init_pm(struct s5p_mfc_dev *dev) void s5p_mfc_final_pm(struct s5p_mfc_dev *dev) { - pm_runtime_disable(pm->device); + pm_runtime_disable(dev->pm.device); } -int s5p_mfc_clock_on(void) +int s5p_mfc_clock_on(struct s5p_mfc_dev *dev) { - return clk_enable(pm->clock_gate); + return clk_enable(dev->pm.clock_gate); } -void s5p_mfc_clock_off(void) +void s5p_mfc_clock_off(struct s5p_mfc_dev *dev) { - clk_disable(pm->clock_gate); + clk_disable(dev->pm.clock_gate); } -int s5p_mfc_power_on(void) +int s5p_mfc_power_on(struct s5p_mfc_dev *dev) { int i, ret = 0; - ret = pm_runtime_resume_and_get(pm->device); + ret = pm_runtime_resume_and_get(dev->pm.device); if (ret < 0) return ret; /* clock control */ - for (i = 0; i < pm->num_clocks; i++) { - ret = clk_prepare_enable(pm->clocks[i]); + for (i = 0; i < dev->pm.num_clocks; i++) { + ret = clk_prepare_enable(dev->pm.clocks[i]); if (ret < 0) { mfc_err("clock prepare failed for clock: %s\n", - pm->clk_names[i]); + dev->pm.clk_names[i]); goto err; } } /* prepare for software clock gating */ - clk_disable(pm->clock_gate); + clk_disable(dev->pm.clock_gate); return 0; err: while (--i >= 0) - clk_disable_unprepare(pm->clocks[i]); - pm_runtime_put(pm->device); + clk_disable_unprepare(dev->pm.clocks[i]); + pm_runtime_put(dev->pm.device); return ret; } -int s5p_mfc_power_off(void) +int s5p_mfc_power_off(struct s5p_mfc_dev *dev) { int i; /* finish software clock gating */ - clk_enable(pm->clock_gate); + clk_enable(dev->pm.clock_gate); - for (i = 0; i < pm->num_clocks; i++) - clk_disable_unprepare(pm->clocks[i]); + for (i = 0; i < dev->pm.num_clocks; i++) + clk_disable_unprepare(dev->pm.clocks[i]); - return pm_runtime_put_sync(pm->device); + return pm_runtime_put_sync(dev->pm.device); } diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_pm.h b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_pm.h index 4159d2364e87..9c71036f0385 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_pm.h +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_pm.h @@ -12,9 +12,9 @@ int s5p_mfc_init_pm(struct s5p_mfc_dev *dev); void s5p_mfc_final_pm(struct s5p_mfc_dev *dev); -int s5p_mfc_clock_on(void); -void s5p_mfc_clock_off(void); -int s5p_mfc_power_on(void); -int s5p_mfc_power_off(void); +int s5p_mfc_clock_on(struct s5p_mfc_dev *dev); +void s5p_mfc_clock_off(struct s5p_mfc_dev *dev); +int s5p_mfc_power_on(struct s5p_mfc_dev *dev); +int s5p_mfc_power_off(struct s5p_mfc_dev *dev); #endif /* S5P_MFC_PM_H_ */