All of lore.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Marek Szyprowski <m.szyprowski@samsung.com>,
	 Andrzej Hajda <andrzej.hajda@intel.com>,
	 Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Aakarsh Jain <aakarsh.jain@samsung.com>,
	linux-fsd@tesla.coma,  linux-samsung-soc@vger.kernel.org,
	 Smitha T Murthy <smithatmurthy@gmail.com>,
	 linux-arm-kernel@lists.infradead.org,
	linux-media@vger.kernel.org,  linux-kernel@vger.kernel.org,
	 Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Subject: [PATCH 08/15] media: s5p-mfc: constify s5p_mfc_hw_ops structures
Date: Sun, 24 Dec 2023 16:44:07 +0100	[thread overview]
Message-ID: <20231224-n-s5p-mfc-const-v1-8-a3b246470fe4@linaro.org> (raw)
In-Reply-To: <20231224-n-s5p-mfc-const-v1-0-a3b246470fe4@linaro.org>

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 <krzysztof.kozlowski@linaro.org>
---
 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_ */

-- 
2.34.1


WARNING: multiple messages have this Message-ID (diff)
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Marek Szyprowski <m.szyprowski@samsung.com>,
	 Andrzej Hajda <andrzej.hajda@intel.com>,
	 Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Aakarsh Jain <aakarsh.jain@samsung.com>,
	linux-fsd@tesla.coma,  linux-samsung-soc@vger.kernel.org,
	 Smitha T Murthy <smithatmurthy@gmail.com>,
	 linux-arm-kernel@lists.infradead.org,
	linux-media@vger.kernel.org,  linux-kernel@vger.kernel.org,
	 Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Subject: [PATCH 08/15] media: s5p-mfc: constify s5p_mfc_hw_ops structures
Date: Sun, 24 Dec 2023 16:44:07 +0100	[thread overview]
Message-ID: <20231224-n-s5p-mfc-const-v1-8-a3b246470fe4@linaro.org> (raw)
In-Reply-To: <20231224-n-s5p-mfc-const-v1-0-a3b246470fe4@linaro.org>

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 <krzysztof.kozlowski@linaro.org>
---
 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_ */

-- 
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2023-12-24 15:44 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-24 15:43 [PATCH 00/15] media: s5p-mfc: cleanups Krzysztof Kozlowski
2023-12-24 15:43 ` Krzysztof Kozlowski
2023-12-24 15:44 ` [PATCH 01/15] media: s5p-mfc: drop unused static s5p_mfc_cmds Krzysztof Kozlowski
2023-12-24 15:44   ` Krzysztof Kozlowski
2023-12-26  5:10   ` Aakarsh Jain
2023-12-26  5:10     ` Aakarsh Jain
2023-12-24 15:44 ` [PATCH 02/15] media: s5p-mfc: drop unused static s5p_mfc_ops Krzysztof Kozlowski
2023-12-24 15:44   ` Krzysztof Kozlowski
2023-12-26  5:12   ` Aakarsh Jain
2023-12-26  5:12     ` Aakarsh Jain
2023-12-24 15:44 ` [PATCH 03/15] media: s5p-mfc: drop unused get_*_def_fmt declarations Krzysztof Kozlowski
2023-12-24 15:44   ` Krzysztof Kozlowski
2023-12-26  5:18   ` Aakarsh Jain
2023-12-26  5:18     ` Aakarsh Jain
2023-12-24 15:44 ` [PATCH 04/15] media: s5p-mfc: constify fw_name strings Krzysztof Kozlowski
2023-12-24 15:44   ` Krzysztof Kozlowski
2023-12-26  8:53   ` Aakarsh Jain
2023-12-26  8:53     ` Aakarsh Jain
2023-12-24 15:44 ` [PATCH 05/15] media: s5p-mfc: constify s5p_mfc_buf_size structures Krzysztof Kozlowski
2023-12-24 15:44   ` Krzysztof Kozlowski
2023-12-26  5:43   ` Aakarsh Jain
2023-12-26  5:43     ` Aakarsh Jain
2023-12-24 15:44 ` [PATCH 06/15] media: s5p-mfc: constify s5p_mfc_variant structures Krzysztof Kozlowski
2023-12-24 15:44   ` Krzysztof Kozlowski
2023-12-26  5:44   ` Aakarsh Jain
2023-12-26  5:44     ` Aakarsh Jain
2023-12-24 15:44 ` [PATCH 07/15] media: s5p-mfc: constify s5p_mfc_hw_cmds structures Krzysztof Kozlowski
2023-12-24 15:44   ` Krzysztof Kozlowski
2023-12-26  9:02   ` Aakarsh Jain
2023-12-26  9:02     ` Aakarsh Jain
2023-12-24 15:44 ` Krzysztof Kozlowski [this message]
2023-12-24 15:44   ` [PATCH 08/15] media: s5p-mfc: constify s5p_mfc_hw_ops structures Krzysztof Kozlowski
2023-12-24 15:44 ` [PATCH 09/15] media: s5p-mfc: constify s5p_mfc_fmt structures Krzysztof Kozlowski
2023-12-24 15:44   ` Krzysztof Kozlowski
2023-12-26  6:27   ` Aakarsh Jain
2023-12-26  6:27     ` Aakarsh Jain
2023-12-24 15:44 ` [PATCH 10/15] media: s5p-mfc: constify struct structures Krzysztof Kozlowski
2023-12-24 15:44   ` Krzysztof Kozlowski
2023-12-24 15:44 ` [PATCH 11/15] media: s5p-mfc: constify pointers to s5p_mfc_cmd_args Krzysztof Kozlowski
2023-12-24 15:44   ` Krzysztof Kozlowski
2023-12-24 15:44 ` [PATCH 12/15] media: s5p-mfc: constify local pointers to s5p_mfc_enc_params Krzysztof Kozlowski
2023-12-24 15:44   ` Krzysztof Kozlowski
2023-12-24 15:44 ` [PATCH 13/15] media: s5p-mfc: drop useless clock refcnt debugging Krzysztof Kozlowski
2023-12-24 15:44   ` Krzysztof Kozlowski
2023-12-24 15:44 ` [PATCH 14/15] media: s5p-mfc: drop useless static s5p_mfc_dev in s5p_mfc_pm.c Krzysztof Kozlowski
2023-12-24 15:44   ` Krzysztof Kozlowski
2023-12-24 15:44 ` [PATCH 15/15] media: s5p-mfc: drop static device variable " Krzysztof Kozlowski
2023-12-24 15:44   ` Krzysztof Kozlowski
2023-12-26  6:21   ` Aakarsh Jain
2023-12-26  6:21     ` Aakarsh Jain
2023-12-26  9:06     ` Krzysztof Kozlowski
2023-12-26  9:06       ` Krzysztof Kozlowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231224-n-s5p-mfc-const-v1-8-a3b246470fe4@linaro.org \
    --to=krzysztof.kozlowski@linaro.org \
    --cc=aakarsh.jain@samsung.com \
    --cc=andrzej.hajda@intel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-fsd@tesla.coma \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mchehab@kernel.org \
    --cc=smithatmurthy@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.