media: spacemit: cam_isp: Fix declaration 76/317176/1 accepted/tizen/unified/20250101.165740 accepted/tizen/unified/x/20250101.210642
authorSeung-Woo Kim <sw0312.kim@samsung.com>
Thu, 26 Dec 2024 09:27:29 +0000 (18:27 +0900)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Thu, 26 Dec 2024 09:28:17 +0000 (18:28 +0900)
Some compilers give an error, "a label can only be part of a
statement and a declaration is not a statement" for declaration
in middle of statement. Fix the error by moving declaration to
function top.

Change-Id: I4abcb45fd8b6824869d772bc1fda2083ae7475c0
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
drivers/media/platform/spacemit/camera/cam_isp/k1x_isp_pipe.c

index affac933649aa3ec04af409e05f79ea2dd790cd5..606f8977f55a04da00dd71e9d39050bb90ed7a79 100644 (file)
@@ -929,6 +929,7 @@ long k1xisp_pipe_ioctl_core(struct file *file, unsigned int cmd, unsigned long a
 {
        int ret = 0;
        struct k1xisp_pipe_dev *pipe_dev = file->private_data;
+       struct isp_regs_info *user_regs;
 
        ISP_DRV_CHECK_POINTER(pipe_dev);
        switch (cmd) {
@@ -939,7 +940,7 @@ long k1xisp_pipe_ioctl_core(struct file *file, unsigned int cmd, unsigned long a
                ret = k1xisp_pipe_undeploy_driver(pipe_dev, *((u32*)arg));
                break;
        case ISP_IOC_SET_REG:
-               struct isp_regs_info *user_regs = (struct isp_regs_info*)arg;
+               user_regs = (struct isp_regs_info*)arg;
 
                if (pipe_dev->isp_reg_mem[user_regs->mem_index].config) {
                        if (pipe_dev->isp_reg_mem[user_regs->mem_index].mem.fd != user_regs->mem.fd) {