media: s5p-mfc: constify pointers to s5p_mfc_cmd_args
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Sun, 24 Dec 2023 15:44:10 +0000 (16:44 +0100)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Mon, 22 Jan 2024 11:16:43 +0000 (12:16 +0100)
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 <krzysztof.kozlowski@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd.h
drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v5.c
drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c

index 945d12fdceb7d5b4dde07a3bdee30586b7efab7f..172c5a63b58ea2338d529283d4504e318f7ea7f5 100644 (file)
@@ -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);
index 1fbf7ed5d4cca6d7769986ad642f033fa68f9128..82ee6d300c738f18448e726448e0ee0f383d534e 100644 (file)
@@ -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;
index 740aa4dfae579e3bcffb8d17e14da3cc720ea480..47bc3014b5d8b874da5b3fa90b4163284c047a86 100644 (file)
@@ -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);