Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: s5p-mfc: remove an unused/uninitialized variable

The s5p_mfc_cmd_args structure in the v6 driver is never used, not
initialized to anything other than zero, but as of clang-21 this
causes a warning:

drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c:45:7: error: variable 'h2r_args' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer]
45 | &h2r_args);
| ^~~~~~~~

Just remove this for simplicity. Since the function is also called
through a callback, this does require adding a trivial wrapper with
the correct prototype.

Fixes: f96f3cfa0bb8 ("[media] s5p-mfc: Update MFC v4l2 driver to support MFC6.x")
Cc: stable@vger.kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>

authored by

Arnd Bergmann and committed by
Hans Verkuil
7fa37ba2 b4c44131

+13 -22
+13 -22
drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c
··· 14 14 #include "s5p_mfc_opr.h" 15 15 #include "s5p_mfc_cmd_v6.h" 16 16 17 - static int s5p_mfc_cmd_host2risc_v6(struct s5p_mfc_dev *dev, int cmd, 18 - const struct s5p_mfc_cmd_args *args) 17 + static int s5p_mfc_cmd_host2risc_v6(struct s5p_mfc_dev *dev, int cmd) 19 18 { 20 19 mfc_debug(2, "Issue the command: %d\n", cmd); 21 20 ··· 30 31 31 32 static int s5p_mfc_sys_init_cmd_v6(struct s5p_mfc_dev *dev) 32 33 { 33 - struct s5p_mfc_cmd_args h2r_args; 34 34 const struct s5p_mfc_buf_size_v6 *buf_size = dev->variant->buf_size->priv; 35 35 int ret; 36 36 ··· 39 41 40 42 mfc_write(dev, dev->ctx_buf.dma, S5P_FIMV_CONTEXT_MEM_ADDR_V6); 41 43 mfc_write(dev, buf_size->dev_ctx, S5P_FIMV_CONTEXT_MEM_SIZE_V6); 42 - return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SYS_INIT_V6, 43 - &h2r_args); 44 + return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SYS_INIT_V6); 44 45 } 45 46 46 47 static int s5p_mfc_sleep_cmd_v6(struct s5p_mfc_dev *dev) 47 48 { 48 - struct s5p_mfc_cmd_args h2r_args; 49 - 50 - memset(&h2r_args, 0, sizeof(struct s5p_mfc_cmd_args)); 51 - return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SLEEP_V6, 52 - &h2r_args); 49 + return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SLEEP_V6); 53 50 } 54 51 55 52 static int s5p_mfc_wakeup_cmd_v6(struct s5p_mfc_dev *dev) 56 53 { 57 - struct s5p_mfc_cmd_args h2r_args; 58 - 59 - memset(&h2r_args, 0, sizeof(struct s5p_mfc_cmd_args)); 60 - return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_WAKEUP_V6, 61 - &h2r_args); 54 + return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_WAKEUP_V6); 62 55 } 63 56 64 57 /* Open a new instance and get its number */ 65 58 static int s5p_mfc_open_inst_cmd_v6(struct s5p_mfc_ctx *ctx) 66 59 { 67 60 struct s5p_mfc_dev *dev = ctx->dev; 68 - struct s5p_mfc_cmd_args h2r_args; 69 61 int codec_type; 70 62 71 63 mfc_debug(2, "Requested codec mode: %d\n", ctx->codec_mode); ··· 117 129 mfc_write(dev, ctx->ctx.size, S5P_FIMV_CONTEXT_MEM_SIZE_V6); 118 130 mfc_write(dev, 0, S5P_FIMV_D_CRC_CTRL_V6); /* no crc */ 119 131 120 - return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_OPEN_INSTANCE_V6, 121 - &h2r_args); 132 + return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_OPEN_INSTANCE_V6); 122 133 } 123 134 124 135 /* Close instance */ 125 136 static int s5p_mfc_close_inst_cmd_v6(struct s5p_mfc_ctx *ctx) 126 137 { 127 138 struct s5p_mfc_dev *dev = ctx->dev; 128 - struct s5p_mfc_cmd_args h2r_args; 129 139 int ret = 0; 130 140 131 141 dev->curr_ctx = ctx->num; 132 142 if (ctx->state != MFCINST_FREE) { 133 143 mfc_write(dev, ctx->inst_no, S5P_FIMV_INSTANCE_ID_V6); 134 144 ret = s5p_mfc_cmd_host2risc_v6(dev, 135 - S5P_FIMV_H2R_CMD_CLOSE_INSTANCE_V6, 136 - &h2r_args); 145 + S5P_FIMV_H2R_CMD_CLOSE_INSTANCE_V6); 137 146 } else { 138 147 ret = -EINVAL; 139 148 } ··· 138 153 return ret; 139 154 } 140 155 156 + static int s5p_mfc_cmd_host2risc_v6_args(struct s5p_mfc_dev *dev, int cmd, 157 + const struct s5p_mfc_cmd_args *ignored) 158 + { 159 + return s5p_mfc_cmd_host2risc_v6(dev, cmd); 160 + } 161 + 141 162 /* Initialize cmd function pointers for MFC v6 */ 142 163 static const struct s5p_mfc_hw_cmds s5p_mfc_cmds_v6 = { 143 - .cmd_host2risc = s5p_mfc_cmd_host2risc_v6, 164 + .cmd_host2risc = s5p_mfc_cmd_host2risc_v6_args, 144 165 .sys_init_cmd = s5p_mfc_sys_init_cmd_v6, 145 166 .sleep_cmd = s5p_mfc_sleep_cmd_v6, 146 167 .wakeup_cmd = s5p_mfc_wakeup_cmd_v6,