]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
media: atomisp: remove some dead code
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Sun, 19 Apr 2020 16:27:51 +0000 (18:27 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Wed, 20 May 2020 10:32:15 +0000 (12:32 +0200)
There are several parts of atomisp that are meant to be
built on different environments, tested using ifdefs.

Remove some of them, as this code should build only on
Linux.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
17 files changed:
drivers/staging/media/atomisp/i2c/atomisp-lm3554.c
drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c
drivers/staging/media/atomisp/include/linux/atomisp.h
drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/host/system_local.h
drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/hrt/isp2401_mamoiada_params.h
drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/hrt/var.h
drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_system/hrt/isp2401_mamoiada_params.h
drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_system/hrt/var.h
drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/system_local.h
drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/assert_support.h
drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/error_support.h
drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/math_support.h
drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/platform_support.h
drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/string_support.h
drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/xnr/xnr_3.0/ia_css_xnr3_param.h
drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_defs.h
drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_internal.h

index 4d94f49fccbcce5f6b13ddd697206c3fe5e38710..05f9b354a70e988c314ed2e87b21e180f7250cb5 100644 (file)
@@ -403,7 +403,6 @@ static int lm3554_g_flash_status(struct v4l2_subdev *sd, s32 *val)
        return 0;
 }
 
-#ifndef CSS15
 static int lm3554_g_flash_status_register(struct v4l2_subdev *sd, s32 *val)
 {
        struct lm3554 *flash = to_lm3554(sd);
@@ -417,7 +416,6 @@ static int lm3554_g_flash_status_register(struct v4l2_subdev *sd, s32 *val)
        *val = ret;
        return 0;
 }
-#endif
 
 static int lm3554_s_ctrl(struct v4l2_ctrl *ctrl)
 {
@@ -475,11 +473,9 @@ static int lm3554_g_volatile_ctrl(struct v4l2_ctrl *ctrl)
        case V4L2_CID_FLASH_STATUS:
                ret = lm3554_g_flash_status(&dev->sd, &ctrl->val);
                break;
-#ifndef CSS15
        case V4L2_CID_FLASH_STATUS_REGISTER:
                ret = lm3554_g_flash_status_register(&dev->sd, &ctrl->val);
                break;
-#endif
        default:
                ret = -EINVAL;
        }
@@ -570,7 +566,6 @@ static const struct v4l2_ctrl_config lm3554_controls[] = {
                .def = ATOMISP_FLASH_STATUS_OK,
                .flags = 0,
        },
-#ifndef CSS15
        {
                .ops = &ctrl_ops,
                .id = V4L2_CID_FLASH_STATUS_REGISTER,
@@ -582,7 +577,6 @@ static const struct v4l2_ctrl_config lm3554_controls[] = {
                .def = 0,
                .flags = 0,
        },
-#endif
 };
 
 /* -----------------------------------------------------------------------------
index 7f8a2b9a4c6949b84d7cfca7eb372b421d13956d..9c426c95dc3ff36e3c825b623fe0ab88fc24d8f9 100644 (file)
@@ -1112,7 +1112,6 @@ static int mt9m114_g_exposure(struct v4l2_subdev *sd, s32 *value)
        return 0;
 }
 
-#ifndef CSS15
 /*
  * This function will return the sensor supported max exposure zone number.
  * the sensor which supports max exposure zone number is 1.
@@ -1222,7 +1221,6 @@ static int mt9m114_s_exposure_selection(struct v4l2_subdev *sd,
 
        return 0;
 }
-#endif
 
 static int mt9m114_g_bin_factor_x(struct v4l2_subdev *sd, s32 *val)
 {
@@ -1331,11 +1329,9 @@ static int mt9m114_s_ctrl(struct v4l2_ctrl *ctrl)
                        __func__, ctrl->val);
                ret = mt9m114_t_hflip(&dev->sd, ctrl->val);
                break;
-#ifndef CSS15
        case V4L2_CID_EXPOSURE_METERING:
                ret = mt9m114_s_exposure_metering(&dev->sd, ctrl->val);
                break;
-#endif
        case V4L2_CID_EXPOSURE:
                ret = mt9m114_s_ev(&dev->sd, ctrl->val);
                break;
@@ -1373,11 +1369,9 @@ static int mt9m114_g_volatile_ctrl(struct v4l2_ctrl *ctrl)
        case V4L2_CID_EXPOSURE_ABSOLUTE:
                ret = mt9m114_g_exposure(&dev->sd, &ctrl->val);
                break;
-#ifndef CSS15
        case V4L2_CID_EXPOSURE_ZONE_NUM:
                ret = mt9m114_g_exposure_zone_num(&dev->sd, &ctrl->val);
                break;
-#endif
        case V4L2_CID_BIN_FACTOR_HORZ:
                ret = mt9m114_g_bin_factor_x(&dev->sd, &ctrl->val);
                break;
@@ -1467,7 +1461,6 @@ static struct v4l2_ctrl_config mt9m114_controls[] = {
                .def = 0,
                .flags = 0,
        },
-#ifndef CSS15
        {
                .ops = &ctrl_ops,
                .id = V4L2_CID_EXPOSURE_ZONE_NUM,
@@ -1490,7 +1483,6 @@ static struct v4l2_ctrl_config mt9m114_controls[] = {
                .def = 1,
                .flags = 0,
        },
-#endif
        {
                .ops = &ctrl_ops,
                .id = V4L2_CID_BIN_FACTOR_HORZ,
@@ -1794,9 +1786,7 @@ static const struct v4l2_subdev_pad_ops mt9m114_pad_ops = {
        .enum_frame_size = mt9m114_enum_frame_size,
        .get_fmt = mt9m114_get_fmt,
        .set_fmt = mt9m114_set_fmt,
-#ifndef CSS15
        .set_selection = mt9m114_s_exposure_selection,
-#endif
 };
 
 static const struct v4l2_subdev_ops mt9m114_ops = {
index df0ee5ddedd988925c2346fd94e01c80428e077e..47153e3b77551870f3def55dcaa9ba6380044067 100644 (file)
@@ -14,9 +14,6 @@
  *
  *
  */
-#ifdef CSS15
-#include <linux/atomisp_css15.h>
-#else
 
 #ifndef _ATOM_ISP_H
 #define _ATOM_ISP_H
@@ -1357,4 +1354,3 @@ enum {
 };
 
 #endif /* _ATOM_ISP_H */
-#endif /* CSS15*/
index 068b6efb33207d78d472f3b4a465e69058e3f22d..f88580a7aab47151992df8b3dbb36015f6dde43b 100644 (file)
 
 #include "system_global.h"
 
-#ifdef __FIST__
-#define HRT_ADDRESS_WIDTH      32              /* Surprise, this is a local property and even differs per platform */
-#else
 #define HRT_ADDRESS_WIDTH      64              /* Surprise, this is a local property */
-#endif
 
 /* This interface is deprecated */
 #include "hrt/hive_types.h"
index 29e097b5d9e4ffa89f1c699ae0601322f3fa58d1..e548e45a161d65dc4ffd75f314832e0336b48675 100644 (file)
 
 #define _isp_ceil_div(a, b)                     (((a) + (b) - 1) / (b))
 
-#ifdef C_RUN
-#define ISP_VEC_ALIGN                          (_isp_ceil_div(ISP_VEC_WIDTH, 64) * 8)
-#else
 #define ISP_VEC_ALIGN                          ISP_VMEM_ALIGN
-#endif
 
 /* HRT specific vector support */
 #define isp2401_mamoiada_vector_alignment         ISP_VEC_ALIGN
index d3df4e1649c97da8031eee4418e4b34a6ff4b055..6d6fb35c62209d613a0848172274fbc7c4931bc6 100644 (file)
 #define HRT_HOST_TYPE(cell_type)   HRTCAT(hrt_host_type_of_, cell_type)
 #define HRT_INT_TYPE(type)         HRTCAT(hrt_int_type_of_, type)
 
-#ifdef C_RUN
-
-#ifdef C_RUN_DYNAMIC_LINK_PROGRAMS
-void *csim_processor_get_crun_symbol(hive_proc_id p, const char *sym);
-#define _hrt_cell_get_crun_symbol(cell, sym)          csim_processor_get_crun_symbol(cell, HRTSTR(sym))
-#define _hrt_cell_get_crun_indexed_symbol(cell, sym)  csim_processor_get_crun_symbol(cell, HRTSTR(sym))
-#else
-#define _hrt_cell_get_crun_symbol(cell, sym)         (&sym)
-#define _hrt_cell_get_crun_indexed_symbol(cell, sym) (sym)
-#endif //  C_RUN_DYNAMIC_LINK_PROGRAMS
-
-#define hrt_scalar_store(cell, type, var, data) \
-       ((*(HRT_HOST_TYPE(type) *)_hrt_cell_get_crun_symbol(cell, var)) = (data))
-#define hrt_scalar_load(cell, type, var) \
-       ((*(HRT_HOST_TYPE(type) *)_hrt_cell_get_crun_symbol(cell, var)))
-
-#define hrt_indexed_store(cell, type, array, index, data) \
-       ((((HRT_HOST_TYPE(type) *)_hrt_cell_get_crun_indexed_symbol(cell, array))[index]) = (data))
-#define hrt_indexed_load(cell, type, array, index) \
-       (((HRT_HOST_TYPE(type) *)_hrt_cell_get_crun_indexed_symbol(cell, array))[index])
-
-#else /* C_RUN */
 
 #define hrt_scalar_store(cell, type, var, data) \
   HRTCAT(hrt_mem_store_, HRT_TYPE_BITS(cell, type))(\
@@ -93,7 +71,6 @@ void *csim_processor_get_crun_symbol(hive_proc_id p, const char *sym);
               HRTCAT(HIVE_MEM_, array), \
               (HRTCAT(HIVE_ADDR_, array)) + ((index) * HRT_TYPE_BYTES(cell, type))))
 
-#endif /* C_RUN */
 
 #endif /* _HRT_VAR_H */
 #endif
index 29e097b5d9e4ffa89f1c699ae0601322f3fa58d1..e548e45a161d65dc4ffd75f314832e0336b48675 100644 (file)
 
 #define _isp_ceil_div(a, b)                     (((a) + (b) - 1) / (b))
 
-#ifdef C_RUN
-#define ISP_VEC_ALIGN                          (_isp_ceil_div(ISP_VEC_WIDTH, 64) * 8)
-#else
 #define ISP_VEC_ALIGN                          ISP_VMEM_ALIGN
-#endif
 
 /* HRT specific vector support */
 #define isp2401_mamoiada_vector_alignment         ISP_VEC_ALIGN
index d3df4e1649c97da8031eee4418e4b34a6ff4b055..6d6fb35c62209d613a0848172274fbc7c4931bc6 100644 (file)
 #define HRT_HOST_TYPE(cell_type)   HRTCAT(hrt_host_type_of_, cell_type)
 #define HRT_INT_TYPE(type)         HRTCAT(hrt_int_type_of_, type)
 
-#ifdef C_RUN
-
-#ifdef C_RUN_DYNAMIC_LINK_PROGRAMS
-void *csim_processor_get_crun_symbol(hive_proc_id p, const char *sym);
-#define _hrt_cell_get_crun_symbol(cell, sym)          csim_processor_get_crun_symbol(cell, HRTSTR(sym))
-#define _hrt_cell_get_crun_indexed_symbol(cell, sym)  csim_processor_get_crun_symbol(cell, HRTSTR(sym))
-#else
-#define _hrt_cell_get_crun_symbol(cell, sym)         (&sym)
-#define _hrt_cell_get_crun_indexed_symbol(cell, sym) (sym)
-#endif //  C_RUN_DYNAMIC_LINK_PROGRAMS
-
-#define hrt_scalar_store(cell, type, var, data) \
-       ((*(HRT_HOST_TYPE(type) *)_hrt_cell_get_crun_symbol(cell, var)) = (data))
-#define hrt_scalar_load(cell, type, var) \
-       ((*(HRT_HOST_TYPE(type) *)_hrt_cell_get_crun_symbol(cell, var)))
-
-#define hrt_indexed_store(cell, type, array, index, data) \
-       ((((HRT_HOST_TYPE(type) *)_hrt_cell_get_crun_indexed_symbol(cell, array))[index]) = (data))
-#define hrt_indexed_load(cell, type, array, index) \
-       (((HRT_HOST_TYPE(type) *)_hrt_cell_get_crun_indexed_symbol(cell, array))[index])
-
-#else /* C_RUN */
 
 #define hrt_scalar_store(cell, type, var, data) \
   HRTCAT(hrt_mem_store_, HRT_TYPE_BITS(cell, type))(\
@@ -93,7 +71,6 @@ void *csim_processor_get_crun_symbol(hive_proc_id p, const char *sym);
               HRTCAT(HIVE_MEM_, array), \
               (HRTCAT(HIVE_ADDR_, array)) + ((index) * HRT_TYPE_BYTES(cell, type))))
 
-#endif /* C_RUN */
 
 #endif /* _HRT_VAR_H */
 #endif
index 914263d6bba5767bf8dc59b40dbfbe694ec492c4..2a6937d0b69ca1a4641cf2ce66fa4a890ad9f57a 100644 (file)
 
 #include "system_global.h"
 
-#ifdef __FIST__
-#define HRT_ADDRESS_WIDTH      32              /* Surprise, this is a local property and even differs per platform */
-#else
 /* HRT assumes 32 by default (see Linux/include/hrt/hive_types.h), overrule it in case it is different */
 #undef HRT_ADDRESS_WIDTH
 #define HRT_ADDRESS_WIDTH      64              /* Surprise, this is a local property */
-#endif
 
 /* This interface is deprecated */
 #include "hrt/hive_types.h"
index ac00880e31181e11b59c1df4a3654a8b459aeecb..4cb7e4c952c587687e06ca00a894342c6d7222b8 100644 (file)
 #define CT_ASSERT(cnd) ((void)sizeof(char[(cnd) ? 1 :  -1]))
 #endif /* CT_ASSERT */
 
-#ifdef NDEBUG
-
-#define assert(cnd) ((void)0)
-
-#else
-
-#if defined(_MSC_VER)
-#ifdef _KERNEL_MODE
-/* Windows kernel mode compilation */
-#include <wdm.h>
-#define assert(cnd) ASSERT(cnd)
-#else
-/* Windows usermode compilation */
-#include <assert.h>
-#endif
-
-#elif defined(__KERNEL__)
 #include <linux/bug.h>
 
 /* TODO: it would be cleaner to use this:
                        BUG(); \
        } while (0)
 
-#elif defined(__FIST__) || defined(__GNUC__)
-
-/* enable assert for crun */
-#include "assert.h"
-
-#else /* default for unknown environments */
-#define assert(cnd) ((void)0)
-#endif
-
-#endif /* NDEBUG */
-
 #ifndef PIPE_GENERATION
 /* Deprecated OP___assert, this is still used in ~1000 places
  * in the code. This will be removed over time.
index bca0195016dfe9b032b0fb226154cae63e1cfd01..4f0d259bf7edf4eda56966f9159638b8e0a398b8 100644 (file)
 #ifndef __ERROR_SUPPORT_H_INCLUDED__
 #define __ERROR_SUPPORT_H_INCLUDED__
 
-#if defined(_MSC_VER)
-#include <errno.h>
-/*
- * Put here everything _MSC_VER specific not covered in
- * "errno.h"
- */
-#define EINVAL  22
-#define EBADE   52
-#define ENODATA 61
-#define ENOTCONN 107
-#define ENOTSUP 252
-#define ENOBUFS 233
-
-#elif defined(__KERNEL__)
 #include <linux/errno.h>
 /*
  * Put here everything __KERNEL__ specific not covered in
  */
 #define ENOTSUP 252
 
-#elif defined(__GNUC__)
-#include <errno.h>
-/*
- * Put here everything __GNUC__ specific not covered in
- * "errno.h"
- */
-
-#else /* default is for the FIST environment */
-#include <errno.h>
-/*
- * Put here everything FIST specific not covered in
- * "errno.h"
- */
-
-#endif
-
 #define verifexit(cond, error_tag)  \
 do {                               \
        if (!(cond)) {              \
index b633cfaac1da3e4d3c4da341ab01eb8d39f5507c..fc32c89eba14ba5c9e54facb95f1a75fcf144a63 100644 (file)
@@ -17,9 +17,6 @@
 
 #include <linux/kernel.h> /* Override the definition of max/min from linux kernel*/
 
-#if defined(_MSC_VER)
-#include <stdlib.h> /* Override the definition of max/min from stdlib.h*/
-#endif /* _MSC_VER */
 
 /* in case we have min/max/MIN/MAX macro's undefine them */
 #ifdef min
index 39a125ba563ded05c89f351bbd0f9723ea475edf..525c34882fd74cc97d4107d8bfa16b953fa8e6c0 100644 (file)
@@ -33,9 +33,4 @@
 
 #define CSS_ALIGN(d, a) d __attribute__((aligned(a)))
 
-/*
- * Put here everything __KERNEL__ specific not covered in
- * "assert_support.h", "math_support.h", etc
- */
-
 #endif /* __PLATFORM_SUPPORT_H_INCLUDED__ */
index 8fa8d3e6f960aba647d570f746970473d70f7f28..84efbbe78650d9afaa61905f459e50393e91a05b 100644 (file)
@@ -17,7 +17,6 @@
 #include <platform_support.h>
 #include <type_support.h>
 
-#if !defined(_MSC_VER)
 /*
  * For all non microsoft cases, we need the following functions
  */
@@ -162,6 +161,5 @@ static inline int strcpy_s(
        return 0;
 }
 
-#endif /*!defined(_MSC_VER)*/
 
 #endif /* __STRING_SUPPORT_H_INCLUDED__ */
index e91753700442911d066fff581b9d3e43ad130c68..d6fda1326f09dbb7ead843ae4c40683bea6f04d0 100644 (file)
 #define XNR_BLENDING_SCALE_FACTOR   BIT(XNR_BLENDING_SCALE_LOG2)
 
 /* XNR3 filter size. Must be 11x11, 9x9 or 5x5. */
-#ifdef FLT_KERNEL_9x9
-#define XNR_FILTER_SIZE             9
-#else
-#ifdef FLT_KERNEL_11x11
-#define XNR_FILTER_SIZE             11
-#else
 #define XNR_FILTER_SIZE             5
-#endif
-#endif
 
 /* XNR3 alpha (1/sigma) parameters on the ISP, expressed as a base (0) value
  * for dark areas, and a scaled diff towards the value for bright areas. */
index f93272bf0e2a4555caba423ffd5860adfca9eccd..c601745be2a6a9749f4944d3a5d339937bc32054 100644 (file)
@@ -239,11 +239,7 @@ RGB[0,8191],coef[-8192,8191] -> RGB[0,8191]
 #define NUM_TNR_FRAMES_PER_REF_BUF_SET         (2)
 
 /* In luma-only mode alternate illuminated frames are supported, that requires two double buffers */
-#ifdef ENABLE_LUMA_ONLY
-#define NUM_TNR_REF_BUF_SETS   (2)
-#else
 #define NUM_TNR_REF_BUF_SETS   (1)
-#endif
 
 #define NUM_TNR_FRAMES         (NUM_TNR_FRAMES_PER_REF_BUF_SET * NUM_TNR_REF_BUF_SETS)
 
index 244111aad6961ac6a9fdf5008045940c1850e8ab..84e8f1e5421c31317b766d40fcdbc7983b0f9acf 100644 (file)
 
 #define SH_CSS_SP_INTERNAL_SERVICE_THREAD              1
 
-#ifdef __DISABLE_UNUSED_THREAD__
-#define SH_CSS_MAX_SP_THREADS                  0
-#else
 #define SH_CSS_MAX_SP_THREADS          5
-#endif
 
 #define SH_CSS_MAX_SP_INTERNAL_THREADS (\
         SH_CSS_SP_INTERNAL_SERVICE_THREAD +\