|
| 1 | +From 7fa37ba25a1dfc084e24ea9acc14bf1fad8af14c Mon Sep 17 00:00:00 2001 |
| 2 | +From: Arnd Bergmann < [email protected]> |
| 3 | +Date: Thu, 7 Aug 2025 22:54:15 +0200 |
| 4 | +Subject: media: s5p-mfc: remove an unused/uninitialized variable |
| 5 | + |
| 6 | +The s5p_mfc_cmd_args structure in the v6 driver is never used, not |
| 7 | +initialized to anything other than zero, but as of clang-21 this |
| 8 | +causes a warning: |
| 9 | + |
| 10 | +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] |
| 11 | + 45 | &h2r_args); |
| 12 | + | ^~~~~~~~ |
| 13 | + |
| 14 | +Just remove this for simplicity. Since the function is also called |
| 15 | +through a callback, this does require adding a trivial wrapper with |
| 16 | +the correct prototype. |
| 17 | + |
| 18 | +Fixes: f96f3cfa0bb8 ("[media] s5p-mfc: Update MFC v4l2 driver to support MFC6.x") |
| 19 | + |
| 20 | +Signed-off-by: Arnd Bergmann < [email protected]> |
| 21 | +Signed-off-by: Hans Verkuil < [email protected]> |
| 22 | +--- |
| 23 | +Link: https://git.linuxtv.org/media.git/commit/?id=7fa37ba25a1dfc084e24ea9acc14bf1fad8af14c |
| 24 | +--- |
| 25 | + .../platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c | 35 ++++++++-------------- |
| 26 | + 1 file changed, 13 insertions(+), 22 deletions(-) |
| 27 | + |
| 28 | +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 |
| 29 | +index 47bc3014b5d8..f7c682fca645 100644 |
| 30 | +--- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c |
| 31 | ++++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c |
| 32 | +@@ -14,8 +14,7 @@ |
| 33 | + #include "s5p_mfc_opr.h" |
| 34 | + #include "s5p_mfc_cmd_v6.h" |
| 35 | + |
| 36 | +-static int s5p_mfc_cmd_host2risc_v6(struct s5p_mfc_dev *dev, int cmd, |
| 37 | +- const struct s5p_mfc_cmd_args *args) |
| 38 | ++static int s5p_mfc_cmd_host2risc_v6(struct s5p_mfc_dev *dev, int cmd) |
| 39 | + { |
| 40 | + mfc_debug(2, "Issue the command: %d\n", cmd); |
| 41 | + |
| 42 | +@@ -31,7 +30,6 @@ static int s5p_mfc_cmd_host2risc_v6(struct s5p_mfc_dev *dev, int cmd, |
| 43 | + |
| 44 | + static int s5p_mfc_sys_init_cmd_v6(struct s5p_mfc_dev *dev) |
| 45 | + { |
| 46 | +- struct s5p_mfc_cmd_args h2r_args; |
| 47 | + const struct s5p_mfc_buf_size_v6 *buf_size = dev->variant->buf_size->priv; |
| 48 | + int ret; |
| 49 | + |
| 50 | +@@ -41,33 +39,23 @@ static int s5p_mfc_sys_init_cmd_v6(struct s5p_mfc_dev *dev) |
| 51 | + |
| 52 | + mfc_write(dev, dev->ctx_buf.dma, S5P_FIMV_CONTEXT_MEM_ADDR_V6); |
| 53 | + mfc_write(dev, buf_size->dev_ctx, S5P_FIMV_CONTEXT_MEM_SIZE_V6); |
| 54 | +- return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SYS_INIT_V6, |
| 55 | +- &h2r_args); |
| 56 | ++ return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SYS_INIT_V6); |
| 57 | + } |
| 58 | + |
| 59 | + static int s5p_mfc_sleep_cmd_v6(struct s5p_mfc_dev *dev) |
| 60 | + { |
| 61 | +- struct s5p_mfc_cmd_args h2r_args; |
| 62 | +- |
| 63 | +- memset(&h2r_args, 0, sizeof(struct s5p_mfc_cmd_args)); |
| 64 | +- return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SLEEP_V6, |
| 65 | +- &h2r_args); |
| 66 | ++ return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SLEEP_V6); |
| 67 | + } |
| 68 | + |
| 69 | + static int s5p_mfc_wakeup_cmd_v6(struct s5p_mfc_dev *dev) |
| 70 | + { |
| 71 | +- struct s5p_mfc_cmd_args h2r_args; |
| 72 | +- |
| 73 | +- memset(&h2r_args, 0, sizeof(struct s5p_mfc_cmd_args)); |
| 74 | +- return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_WAKEUP_V6, |
| 75 | +- &h2r_args); |
| 76 | ++ return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_WAKEUP_V6); |
| 77 | + } |
| 78 | + |
| 79 | + /* Open a new instance and get its number */ |
| 80 | + static int s5p_mfc_open_inst_cmd_v6(struct s5p_mfc_ctx *ctx) |
| 81 | + { |
| 82 | + struct s5p_mfc_dev *dev = ctx->dev; |
| 83 | +- struct s5p_mfc_cmd_args h2r_args; |
| 84 | + int codec_type; |
| 85 | + |
| 86 | + mfc_debug(2, "Requested codec mode: %d\n", ctx->codec_mode); |
| 87 | +@@ -129,23 +117,20 @@ static int s5p_mfc_open_inst_cmd_v6(struct s5p_mfc_ctx *ctx) |
| 88 | + mfc_write(dev, ctx->ctx.size, S5P_FIMV_CONTEXT_MEM_SIZE_V6); |
| 89 | + mfc_write(dev, 0, S5P_FIMV_D_CRC_CTRL_V6); /* no crc */ |
| 90 | + |
| 91 | +- return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_OPEN_INSTANCE_V6, |
| 92 | +- &h2r_args); |
| 93 | ++ return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_OPEN_INSTANCE_V6); |
| 94 | + } |
| 95 | + |
| 96 | + /* Close instance */ |
| 97 | + static int s5p_mfc_close_inst_cmd_v6(struct s5p_mfc_ctx *ctx) |
| 98 | + { |
| 99 | + struct s5p_mfc_dev *dev = ctx->dev; |
| 100 | +- struct s5p_mfc_cmd_args h2r_args; |
| 101 | + int ret = 0; |
| 102 | + |
| 103 | + dev->curr_ctx = ctx->num; |
| 104 | + if (ctx->state != MFCINST_FREE) { |
| 105 | + mfc_write(dev, ctx->inst_no, S5P_FIMV_INSTANCE_ID_V6); |
| 106 | + ret = s5p_mfc_cmd_host2risc_v6(dev, |
| 107 | +- S5P_FIMV_H2R_CMD_CLOSE_INSTANCE_V6, |
| 108 | +- &h2r_args); |
| 109 | ++ S5P_FIMV_H2R_CMD_CLOSE_INSTANCE_V6); |
| 110 | + } else { |
| 111 | + ret = -EINVAL; |
| 112 | + } |
| 113 | +@@ -153,9 +138,15 @@ static int s5p_mfc_close_inst_cmd_v6(struct s5p_mfc_ctx *ctx) |
| 114 | + return ret; |
| 115 | + } |
| 116 | + |
| 117 | ++static int s5p_mfc_cmd_host2risc_v6_args(struct s5p_mfc_dev *dev, int cmd, |
| 118 | ++ const struct s5p_mfc_cmd_args *ignored) |
| 119 | ++{ |
| 120 | ++ return s5p_mfc_cmd_host2risc_v6(dev, cmd); |
| 121 | ++} |
| 122 | ++ |
| 123 | + /* Initialize cmd function pointers for MFC v6 */ |
| 124 | + static const struct s5p_mfc_hw_cmds s5p_mfc_cmds_v6 = { |
| 125 | +- .cmd_host2risc = s5p_mfc_cmd_host2risc_v6, |
| 126 | ++ .cmd_host2risc = s5p_mfc_cmd_host2risc_v6_args, |
| 127 | + .sys_init_cmd = s5p_mfc_sys_init_cmd_v6, |
| 128 | + .sleep_cmd = s5p_mfc_sleep_cmd_v6, |
| 129 | + .wakeup_cmd = s5p_mfc_wakeup_cmd_v6, |
| 130 | +-- |
| 131 | +cgit v1.2.3 |
| 132 | + |
0 commit comments