From 7535c68d179fa11ef7320d9f13affb94562919b1 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 28 Apr 2020 09:30:26 +0200 Subject: [PATCH] media: atomisp: make util.c work with ISP2401 runtime detection Don't hide those small functions behind ifdefs. Signed-off-by: Mauro Carvalho Chehab --- .../pci/atomisp2/css2400/camera/util/interface/ia_css_util.h | 5 +++-- .../atomisp/pci/atomisp2/css2400/camera/util/src/util.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/camera/util/interface/ia_css_util.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/camera/util/interface/ia_css_util.h index b09a0a009c08..75333166ed9b 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/camera/util/interface/ia_css_util.h +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/camera/util/interface/ia_css_util.h @@ -74,7 +74,7 @@ enum ia_css_err ia_css_util_check_res( unsigned int width, unsigned int height); -#ifdef ISP2401 +/* ISP2401 */ /* @brief compare resolutions (less or equal) * * @param[in] a resolution @@ -87,6 +87,7 @@ bool ia_css_util_res_leq( struct ia_css_resolution a, struct ia_css_resolution b); +/* ISP2401 */ /** * @brief Check if resolution is zero * @@ -97,6 +98,7 @@ bool ia_css_util_res_leq( bool ia_css_util_resolution_is_zero( const struct ia_css_resolution resolution); +/* ISP2401 */ /** * @brief Check if resolution is even * @@ -107,7 +109,6 @@ bool ia_css_util_resolution_is_zero( bool ia_css_util_resolution_is_even( const struct ia_css_resolution resolution); -#endif /* @brief check width and height * * @param[in] stream_format diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/camera/util/src/util.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/camera/util/src/util.c index a44cd35acd0f..f14776f09bbb 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/camera/util/src/util.c +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/camera/util/src/util.c @@ -158,23 +158,24 @@ enum ia_css_err ia_css_util_check_res(unsigned int width, unsigned int height) return IA_CSS_SUCCESS; } -#ifdef ISP2401 +/* ISP2401 */ bool ia_css_util_res_leq(struct ia_css_resolution a, struct ia_css_resolution b) { return a.width <= b.width && a.height <= b.height; } +/* ISP2401 */ bool ia_css_util_resolution_is_zero(const struct ia_css_resolution resolution) { return (resolution.width == 0) || (resolution.height == 0); } +/* ISP2401 */ bool ia_css_util_resolution_is_even(const struct ia_css_resolution resolution) { return IS_EVEN(resolution.height) && IS_EVEN(resolution.width); } -#endif bool ia_css_util_is_input_format_raw(enum atomisp_input_format format) { return ((format == ATOMISP_INPUT_FORMAT_RAW_6) || -- 2.39.5