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: 758170 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 4B3E46AA7 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="NxayP9rb" Received: by mail-ej1-f52.google.com with SMTP id a640c23a62f3a-9fa45e75ed9so342784866b.1 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=rOcIGW7V3fMNwaqxpr8Fl9HM1TCszyBtKWtZVrblF1vbZEAPwsGTBC6Y/ohqa0JZI2 aN6pnSE+Muklb/urP1esFVBzewaMaHMB7P93qLGrCjPvmk/QhCRotXhN5FvjyisYjKEh 3FPUa99zQfXZxVYVcimCt/v4NrWVMUDGczFXJJfsY8B79xQErEqPLtui7Nxxxy2AH+0u 3D8A9bIBADL9HEXdKOCV6lYOOAW0BtgN7KR/9uH7enGs6c5zLXJ+m4hHbPFH0LIRZ1J3 fSeM+LgAxXSyby1QLV18P5pI9G41lDlLGW2pzjD2VZ3SyvMDE1PUE0Ib/M5nyJRR+opN YKeg== X-Gm-Message-State: AOJu0YynWfXwX0P+yKPaq6faoFNRI35S//jLIlEIXnLGNQbG0noEB+Y/ RK4DNU6ERSK11PkFIwtcyhrNVQsDmdcwIGjdNpXF9GnORtQ= X-Google-Smtp-Source: AGHT+IE4Eqhm+mVXAUZubJti24nq7Cqcl8a1TWf67Clpk2HjAZzxRkbxtOO/aqa2XhufK3wXiaMZJg== 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-media@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 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: 758721 Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 50E12746B 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Zwh4aTfl" Received: by mail-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-54c70c70952so3810188a12.3 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=BOHF/AV8+3VRtLIfInLYYfQ7G3Hp0FREhCIhX1MAp52z/OspbpJ7T2epBlZX5S1+Wg wc4iiPfFM8cff83Xz/eA9/WLG7IoV7kBo4w4zo0+1H2HYdjTLdGnp9Wo0MNpRpCvcslI qw7YmifKDuYu5nWhO2Zg42rsEkVriik5XF7hPOW1ioyQ7R3PrVz0MKHau7KsBu5bdD9T seKN0UnuWAEovpQyE/43FPn8o6SRCHevfQ913orugnZWvjsYDErY5l9vbyW3GRAjFCUZ NUQ5uKYMUlXkTjRUQAeeqGhys6W6CvUK6bptPH9q4I0s/8w4//LJUgpE+71AcHHWEoYc 09jA== X-Gm-Message-State: AOJu0YxVnLW1g39p25iYN/4HTRF0Ur0hIoqEW/6MwF8Sn0UDR3J/g/JG AKntMSuzkxmEJTyH9q65Fnl0HPbuxdpeyQ== X-Google-Smtp-Source: AGHT+IESUFUOS1uBJFg3d1DW1wsZmKy7QL9mSj2CDo1xn0OLo+tYjRvyt6wulJLJVaRh5xueH8Xlow== 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-media@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 File-scope static variable "s5p_mfc_ops" is not read after assignment, thus it can be dropped entirely. Signed-off-by: Krzysztof Kozlowski --- 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: 758169 Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.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 E01A3D27D 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="e3gMYgXg" Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-3368fe4dcb1so2117461f8f.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=DpgYZRMQc0QnVGAyu9YT1w2DwOjuqBVWNae/kdHVSwKE/CnJtR21v0i7r2KBraoxL1 Uig6lEHCfBBs2itQ96Z+7rOH5tc/Fg8U4Ygy3eF/K+Aux8gRiZc6mSqj+0sHFCSTsQxi +rsT7mIkABMQ3QRdXsvVNnAcNyvWkWKg6lBGnOucDDb3eyb9vMxQWQHZEFi85o1sF4i+ HQPysFPHQp6A4Z9yFC8b2PPD4gg5UHJRrqI+TQN0OAfRTE4r9OH38Z4/+SLBU2t6l/l9 5IsjEuwifs/0qtbTmRj3J5ZFbtphhHAs3afnzLuvsxjW9ug1mh3wmzBElJkLws0gvEdG OWPQ== X-Gm-Message-State: AOJu0Yww262XSavdofQ9Ymy6tPhRwi4Ys0B4ehxy5oPPqy3aHEQsOrXp E/dI8NgU/+3r/oy2qBIqK9ReKwzEpKh37w== X-Google-Smtp-Source: AGHT+IFwIlNrqF36iOB2bMuUT0fvY1qEd29x+4+MoJx19qAPP0y2jMFEUhBFwGBNwv2sHSJjb3I5uA== 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-media@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 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: 758720 Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9CE83DDDD 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="H8tRSTo1" Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-5534dcfdd61so5706755a12.0 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=sgSjRWmlN49PdJpUGmbQMqzwmcb1IG7Aoz3PKaEleeFu5+BbqNZ7izFxhGanFm6Xa0 +PO4k6NR3xSO+OB/3/ZqTMkJnsNogHMDSVR/Mz31jNCO951ZwZ5nq/FSh4sF5+OIqYL5 +GlnB4gFimO7+DQ7mqVR67q5VwTqxhneHsU4liINgqc/5ES/I4s+nWO4son8VezuCtTp VpNiBlq8cAyDGEhTotXMblVchPiQPvRjZpHCNPc4P+8tMYEI6jJT6gC/Gt5iCKi/dWOv CDU8TZ32ggEg7W/4zJqor/9UrT2Hw/ly597E1qSyed0g/cuYEbMZTVN+UbaBx5+1Ug8Z SprA== X-Gm-Message-State: AOJu0Yz58bcfUvMbazY731U7r9pliXzjtZQfpPYdC8uaDKglJmRlKm6l fQfigIbJhr2p/xKsQh+RPNxG1NyeVXjCHQ== X-Google-Smtp-Source: AGHT+IFMytQlUGsUHr2lW0AyF5yYtyjd47XaMcqL33aA0ICawVecLpDO9lpGweLKnEUzEiLSvrTzLw== 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-media@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 Constify stored pointers to firmware names for code safety. These are not modified by the driver. Signed-off-by: Krzysztof Kozlowski --- 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: 758168 Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.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 B53DAEAD9 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="CwhKnTQM" Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-a235eb41251so376096766b.3 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=H6eV0SNKa/cmjPOsx10I2tulnYUFvL1XgZhpM65251DHiRcGj5adMuAMf6ui/eJagu GIlh7OTogPupjvmr+hlA5B42tqIGQErWu8IQ2QudiH9fZYkf8dElFMW1l64EjsOeLnPs RP/AECFsjQc7nvmqyRNv/kvN9q23YFQBH8PHgf09POkoRe3gGkFpMQjlm3bh4lEvJCYQ oGGFM5QLNpdrsrHvaM4MmXqbJZ04Ovt+ad1OSEvSMCIKiQG8lQdE+TaH/JtTAQAQtCMS 4IalFIh4F1Q3WL8hARt4Y7ssstopXabLuV0IUii5FxWz2jXDTXr3szWpTiDS2qpyGl8f pRBw== X-Gm-Message-State: AOJu0Yx6ydYkIMQOVgJfHkeaPXB8rtpJEcHf7wlpjb+YOyRrs2XQRaAG hP8hYM8CP0sTAoXza97mpi/85t4sX4mVdpSObh812FMBO1U= X-Google-Smtp-Source: AGHT+IHsiJFm89Z87CL2nktkKopTAQrSauGGlkZXKCgaTQNFWSFTCHq1yVM9nlZafsoU0sG4ZBOpvw== 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-media@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 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: 758719 Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.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 B7AFA101C5 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="WO0jspmp" Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-a2698cff486so397511266b.0 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=U1rvNDwjJrPk3btuufL1OXrLLAafEV9AxdxPPkCCVqGm5bH/kXlfjp6EchgFywZi1u 13RBFQWKOOXgZu+rSaMts1kvEta09tJqvxL/el4ctVgU052vUJyNaTrE+nKuYdsC/nYj IU1Aa1ulAkxcV7opI//GdpJEDGhTW2ONRXAbaOWceyiHO+kto+8B1fWI5ScbPvabYC5G Pj0tULetjDnRpeziXbmF5DxeqNIelRmAnLPGRQHlrTa55/i5GGUYeAK8IEc0FyRO6A2M 0GI1k8+6V5aivz8pVLJHFYF+b7gN6NmLjUEBcxz8QvDI3918UBbx5zXwh0ChMigNAaiy W4Wg== X-Gm-Message-State: AOJu0Yz+2LTdbU904Wdalr0aNbL0MKVI/f1mGP+xFBjqrYlsbPotdFQo sx1r8DcAmgm4t493K6oPaXbXSaRrV5wOnA== X-Google-Smtp-Source: AGHT+IGEZuRTW9lR28kyRWxFyvxDVysVplZ4MC3jv1gqpwB+nQ5N4lvYN4ureL64S8WJoFh2wnm0cg== 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-media@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 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 --- 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: 758167 Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.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 14CE2107B4 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="BBADRzrX" Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-a23350cd51cso371772166b.2 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=Tslqar1ut0MiPR9FJgVekpB/0GBODc+sCnNxiMh+QM2R1rZwXldzJJkFIyBlpv2ds+ y2UuyukpZ8DyS86VJhl2NJGoWDpBgs8I3lEFU6wLhMpw6AtvH4HF9lmMUY0viEB+tqXA dgiYlhXT7tV26FC4DBy4PrJG0+vEyVyflE0fQtbmAAE6y4kXkAQIkuwPm/5gCdD9E9ff wluH2QBl4HU7lsRzJN+j/wK9c19X7MuTdTlpdegmeN0WmP1PxOs9CefyI0742miwUdu3 NEmbl476hoZc44zB3Ju8OtwhCv42ThpKFVu/3PH75+9AKU+mTCGtSShTUkwSwIv9WMYe zRrQ== X-Gm-Message-State: AOJu0YwncvqaciVp/tOP9eVq1WJQ3Xj2cZnHi8fs8cvUMJ9dCas9CMFb IdZBpYUVB43IUgrzWDkfmFbdk+myeWpahw== X-Google-Smtp-Source: AGHT+IFTxUD5XmeSWMzCl542MzJrIKxzQRJWTyDjixOd+YwahjXJkiVCK4SBBeDOB5vSilZbmPTNcA== 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-media@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 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: 758718 Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2FB3010A38 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="PqzgX+HO" Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-a2345aaeb05so357466366b.0 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=JCM10B+XMBJMB7F7g2VCJ7TxyYVdLNo32vfbGHS2X6mbtT3aCXes4ZEtM30vaAi8Xk joCur4anWYSmXFXXkXA38YHHeTFzmxYMkfq+FTeuoCx8zHoMhaDgkHmDDjPzN6AKMtFq pJ0VY6TMz4rTk1qZSBQtfW/0G269ot8gd8VBsub3expQqdUYfL2UkEq59HfX6xbZbY5k ZNVGHEwXdZKxIhNs419gPgA2E0/LqM5zGEW3auJPr7L4iLsZGAmpft/bCFqbDwmPkwLx JNRHr4jc69z9hgDQOgfuygTYi4fGX/7PtcVbVIeIX4BCi9PzVIk4pR4tO2oaso3onevN HJuw== X-Gm-Message-State: AOJu0YwbfQFMEncYKNRUrWN9As86sHWHC58c+LafBO1CQ8rsjq1/oZ+r szBendYF6PCD/k8epTBwKjzR3zgKoWTYBA== X-Google-Smtp-Source: AGHT+IE3IwxCSoLG3da3FmkL17i0iJicpSX61cBEK5nLjXw7pKwvspI2EWPB1zDxavjrFOIhOojSIg== 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-media@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 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: 758166 Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.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 8AD4312E58 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="XxJNvvlT" Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-a235e394758so340229666b.1 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=Kw4HpujDCpfhcaCu8jTD/7WD4L3HU3uEbeBtu+KcLy8XL950gT8A7YWnTbDoDh/dYP 1K3RAYO9H/U3yU+w60KcfJ9Pm2CQaLzCkVbO/14I9Lxs1At5m8oy6M4cXH/z/7xbQ7Yv D0i2i9WL0+PPWD0bhEBaxAyBTbnIFLNWyFar4AMlSaW7XHq8gH4J1gTF/eyRM0F0YjzV knUAO2AYnbaD/Ev6Hwg3mQem3UhRePVyU+W022W/HWTVGhLbQnkA0rfAIrbeOa8z6Npp OpBhibuciQkdn58snZ4ho00vrEvdGCrxDSRNBULfqPWtokocU8R6t88SMah+aYYSE9mV tJuQ== X-Gm-Message-State: AOJu0YxpfwlNYC/uhAIz6JpIjPXg62+J0O1SeXF00PMln2RxQnTyJASJ R0RAwM72fLaM2qR7JOiUL41V/YS/FskMrTGzDkMA+Z/7rGQ= X-Google-Smtp-Source: AGHT+IHMDDehuEau4qfcvjut+X+7u9CsTSccuO5YA9mSNeGnSng6cgw9DjkcaCJG7uG9ydKVmkyWPA== 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-media@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 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: 758717 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 B2EB515EA2 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ShzPTsie" Received: by mail-ed1-f51.google.com with SMTP id 4fb4d7f45d1cf-554d8b24996so177120a12.0 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=U+FZDbAmsEUcmcpAaZ9nd4yz0o/y/wU+MbQHnWlL1dH0FNQEEgaJyAwrNrHozff5Ki BD9CMWxA8ZUZithCGUhLe6ihSTNKOj6+yhjyR6XUdDCMev02GIbLviYSUqvpA9sbHY4l h6UcoxGa/SbW1qX4XnI3H3HKzovFsFgv5mN1tOmUnbKD+hPLNcfKR2g3XawFzdWuMGXS SUgTFnHn5uJGjfs0Q++1G8AfKuqiU3LVB04+tkxAHl1sCqm2NwVWwItHN0Dhn2sLBXBi J7l6m5T1oK9NdPFSZrqlkRbqtw3Edcy6rsJv3hoac4edlskvMRYpWg0GXaazh5ZasLBf NGfQ== X-Gm-Message-State: AOJu0Yw/XQn/pdtIOqT5jsWkeIOgL2w3eIK8QPmjXJVwFgBVXCkggo40 nS3feRi60Ktoaz/Gk+d9zkJD0ZZTIUXTzQ== X-Google-Smtp-Source: AGHT+IFQ+879cPB96mB+qRdtO8ch3WDmQE2+Mg1lSxV1xg5CK21rYIIEy3ZAMMkigKWapWPYLD8hwA== 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-media@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 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: 758165 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 5CC6912E72 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="iDhJ491Z" Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-a23566e91d5so379382166b.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=e3IfnMRj0SWaIR5Dqc54n1lAICsW3SjeJomR/KDuwUrck9/gCOfydK/WiK+fq9oN1K nP+rSABTsCHP117MbYmfLPjfmEgvrT7DHGFquHGfRMapTZ+dXINLVp7vqmwf/1v+3rqU R9+wfV5xR7GNavDDtaYACqiSrHQxGlYKzCvVGbd9MgUAP8E3wPTWi2ysuiP8ehq0hwR3 cIdXbikwmvUBGCzMl1lx7OzK7U+AkYhfJkiW1OK8matqAE6RBVQeUPHRPacAIp+/nxXj x9abOH7b0rFyWuW2Khza4gTP5xheU3GTTP/z6stBFFk83k06zsRDGOt6arS3NR2c6mQL gj/g== X-Gm-Message-State: AOJu0Yyk3cKAGvY59k2u1AdeFkcgQgBi+aJFWi4tCpkfcHeYajJ5nrYe hLo24bjKWunIeERqeCcM9lg9Bu9xMl/2eQ== X-Google-Smtp-Source: AGHT+IGNlruZWqXLTaJtVlfHZVC/VuMeP2kusBEjBvlaUUeA0fVFpFIiDFBxGGsHqthqqGICGwy4BA== 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-media@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 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: 758716 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.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 DB511168B9 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="PhEUKsgK" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-40d31116dbeso38378735e9.3 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=TQzqHMG1+S1oZrB/k0Jm0f+8pB98hcehRr43AHlpTA5nVOXHom8r2E8I4200JEff3n BQuY2FuRX4cLOLD+c8/0PqZxGg9q01oHJIZphc4cEPFDhT/tguyoVarwQhoPJkGuNTTq /YjpFCg1HpJfKUhBfulTC+UgcWPX3TP4OZNotceEL6ujqp++LCFyCE/AER4VMZJDYHc7 0eywxihJri+g4b2Z1W/6VssqlwmIUyGjOlARVDmKL6d0tpMqrtxHOWV4rrPzDaiON1pl YK11FnPrF1rRTo4cieEnixOSycFwJSZoppLsJq3449l8kILW938hbF8mVAmxDLF+BIgM WxIw== X-Gm-Message-State: AOJu0YyKCnZs28KKenrnq58CLyhfuEgX4sz5ExOXAg+cQOaXPldGjWwM waJlIRnrrb8OEifehv0Y2CQ/F/YPkAzCow== X-Google-Smtp-Source: AGHT+IHsdpLGhrTWdR2PM12LvCAZT+GmCIeOjlssIDAiXxh0F5PQ8Q1KllNosT7odAwn1NahfRJATg== 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-media@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 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: 758164 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.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 5874418B10 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="pMgj1Mat" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-40d514cbba3so12883675e9.1 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=A+tjSDS3Ywx+XMhQDaJl3b342hJ8cMnYhVV26aYFmPghLJPAH67YPvm6U9+X0sYdCp fn/734bE2A+FdiO5JVsmUyMoWQvGZd9FKkCrwb8EkDguG/urlv5tGyZVWVKcILMRXSpG XkUIGzZbw8T55nvwfmkE6LqsnUpKzDl8zE4JA+Emd9QX4PIwuCA/QObJiR31UeQq5hB2 QWCueqsPG/cf85LCW7fEKLisbeDb6O19p6BCzuohMsvtnOcQITJa2X3TnfCDcq8AwDnN 4vlgASyCTtjDT2emvRZwDJEjVZFlFN/IOiZ3uVKjwJ+IPhCR4QGZEbcZPmJG2gBhri9u bCtA== X-Gm-Message-State: AOJu0YxZbCwIoai12amV3wlTwmmyeW00QO6p4JRkWYNmBbH1jzQWxmih F0kBlmv775sY1TM8l+ofN11k9Awuk2JBlw== X-Google-Smtp-Source: AGHT+IHLlyUYEzbxNQ4mTd/zBBnZyOhyw30NJX23+cnFC3EQip/rLJXvkKrHPjnjCs9rbEopQX0zQA== 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-media@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 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: 758715 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 795E118E3A 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="eXUHames" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-40d5473882aso6096995e9.1 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=T+hciCxioA+g+RwcpMPmyJqb/XQqsq+ZDrMOlRsDa9UpaJwRiHiWOVj9K40R5Nibjy PXMVuUC4V/vpKm4WfMybT/dDPRu0HbUpBwMXFbPA0ZBUbgL4jJTjjiiZXF8dlBOiWAcR 6XeUvmZKYNzT81YmRvGOEb2/u+vr+LOWsxX0bssscS2gUg9yWDYKg73Au9DwkfjvYoNo iEbuIsx6/3a67Nh4JY2pJlM4AjV+TPqq7ORwZGHmSAlHMxzSaUhY/ZA9pV1lEpawVVLn lbLc4ACCUOAgzJlujIiqMY3HQ95XNr64h8oeAX2bMTnmFSMGqiuMwO2woyvAytFldJY3 xwjg== X-Gm-Message-State: AOJu0YyQB41Ma5471qL5MsJM1yhyjmpWtINBQsIFWUNIZkGWR3c3/lVy 1ebVl+VeMAf1cOnMt6asDsNMp/tLBhgsTg== X-Google-Smtp-Source: AGHT+IHe2nVWvkUtwXhZsmXI3rB+Z5hHEylqrUulG2W34bGPt954jQWKdciG6OGyzuyoq8uzX5d4Cw== 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-media@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 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: 758163 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 CEE7619445 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="iPrQvliA" Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-a2330a92ae6so381501266b.0 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=TzAc/cV4NPu+lTZusH5vXAksmNPVjs4BiZQiAy75t6sTErUaVlvZvYhzxktoRDAzNa nxWTNkU+rYEXDDTvtSc51yG/ZZe0jfwQ6ppS4RYCRUL5U+ircsyHqE8Oa9vIaGJkDCuv lddwucD3QZuNh9uL+/W2+0/eTWT3cf29GRijO8P8yUxKlxzEnHbBeBpjTtO92o1dSN26 ldP4hioYi4dv7wI269UyHXQQEPkROBOdYRP9lSMOAkXLhCkCwfNu4X020oWKFa84kNiI PoKeVYmvNB5eeAgxyCQlF/KrP7stRh1nSHuc2nd1cSFqyEvEwZYojt9cVgadAZnNktIT gMHQ== X-Gm-Message-State: AOJu0YyNjYaNxdo6mpodzGYLAxy3DLrQSpjTNShmVVi2va0auAYCehV7 sXmhk3WdUseHLnT6ADBft+dcmchA5/QE8g== X-Google-Smtp-Source: AGHT+IHUFyGWrmseIr3JUDZ9dc9UtbQmz0vxAekPKcFcKPleItOlE7UVPDO3yuSk4SS0FfXFvzrlRQ== 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-media@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 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_ */