lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <15d601da37da$3e8235d0$bb86a170$@samsung.com>
Date: Tue, 26 Dec 2023 14:32:22 +0530
From: "Aakarsh Jain" <aakarsh.jain@...sung.com>
To: "'Krzysztof Kozlowski'" <krzysztof.kozlowski@...aro.org>, "'Marek
 Szyprowski'" <m.szyprowski@...sung.com>, "'Andrzej Hajda'"
	<andrzej.hajda@...el.com>, "'Mauro Carvalho Chehab'" <mchehab@...nel.org>
Cc: <linux-fsd@...la.coma>, <linux-samsung-soc@...r.kernel.org>, "'Smitha T
 Murthy'" <smithatmurthy@...il.com>, <linux-arm-kernel@...ts.infradead.org>,
	<linux-media@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH 07/15] media: s5p-mfc: constify s5p_mfc_hw_cmds
 structures



> -----Original Message-----
> From: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
> Sent: 24 December 2023 21:14
> To: Marek Szyprowski <m.szyprowski@...sung.com>; Andrzej Hajda
> <andrzej.hajda@...el.com>; Mauro Carvalho Chehab
> <mchehab@...nel.org>
> Cc: Aakarsh Jain <aakarsh.jain@...sung.com>; linux-fsd@...la.coma; linux-
> samsung-soc@...r.kernel.org; Smitha T Murthy
> <smithatmurthy@...il.com>; linux-arm-kernel@...ts.infradead.org; linux-
> media@...r.kernel.org; linux-kernel@...r.kernel.org; Krzysztof Kozlowski
> <krzysztof.kozlowski@...aro.org>
> Subject: [PATCH 07/15] media: s5p-mfc: constify s5p_mfc_hw_cmds
> structures
> 
> 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 <krzysztof.kozlowski@...aro.org>
> ---
>  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;
> 
> --
> 2.34.1

Reviewed-by: Aakarsh Jain <aakarsh.jain@...sung.com>

Thanks!



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ