diff options
author | Jeremy Sowden <jeremy@azazel.net> | 2017-12-19 19:35:13 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2018-03-21 22:36:00 +0300 |
commit | 6dc9a2568f84084e5e2a606d60a739e0779a5959 (patch) | |
tree | 6e4e84c9336609518dba17ce7dc30597de4a2b8b /drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/binary/interface/ia_css_binary.h | |
parent | d82a4a14d4ab4e7e00117594750938f69d4841c5 (diff) | |
download | linux-6dc9a2568f84084e5e2a606d60a739e0779a5959.tar.xz |
media: atomisp: convert default struct values to use compound-literals with designated initializers
The CSS API uses a lot of nested anonymous structs defined in object
macros to assign default values to its data-structures. These have been
changed to use compound-literals and designated initializers to make
them more comprehensible and less fragile.
The compound-literals can also be used in assignment, which means we can
get rid of some temporary variables whose only purpose is to be
initialized by one of these anonymous structs and then serve as the
rvalue in an assignment expression.
A lot of the members of the default struct values used by the CSS API
were explicitly initialized to zero values. Designated initializers
have allowed these members, and in some case whole default struct
values, to be removed.
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/binary/interface/ia_css_binary.h')
-rw-r--r-- | drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/binary/interface/ia_css_binary.h | 88 |
1 files changed, 6 insertions, 82 deletions
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/binary/interface/ia_css_binary.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/binary/interface/ia_css_binary.h index 5a58abe2b233..732e49a241eb 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/binary/interface/ia_css_binary.h +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/binary/interface/ia_css_binary.h @@ -93,17 +93,6 @@ struct ia_css_cas_binary_descr { bool *is_output_stage; }; -#define IA_CSS_DEFAULT_CAS_BINARY_DESCR \ -{ \ - 0, \ - 0, \ - NULL, \ - NULL, \ - NULL, \ - NULL, \ - NULL, \ -} - struct ia_css_binary_descr { int mode; bool online; @@ -171,80 +160,15 @@ struct ia_css_binary { struct ia_css_isp_param_css_segments css_params; }; -#ifdef ISP2401 - #define IA_CSS_BINARY_DEFAULT_SETTINGS \ -{ \ - NULL, \ - IA_CSS_STREAM_FORMAT_YUV420_8_LEGACY, \ - IA_CSS_BINARY_DEFAULT_FRAME_INFO, \ - IA_CSS_BINARY_DEFAULT_FRAME_INFO, \ - {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \ - { 0, 0},/* effective_in_frame_res */ \ - IA_CSS_BINARY_DEFAULT_FRAME_INFO, \ - 0, /* input_buf_vectors */ \ - 0, /* deci_factor_log2 */ \ - 0, /* vf_downscale_log2 */ \ - 0, /* s3atbl_width */ \ - 0, /* s3atbl_height */ \ - 0, /* s3atbl_isp_width */ \ - 0, /* s3atbl_isp_height */ \ - 0, /* morph_tbl_width */ \ - 0, /* morph_tbl_aligned_width */ \ - 0, /* morph_tbl_height */ \ - 0, /* sctbl_width_per_color */ \ - 0, /* sctbl_aligned_width_per_color */ \ - 0, /* sctbl_height */ \ - 0, /* sctbl_legacy_width_per_color */ \ - 0, /* sctbl_legacy_height */ \ - IA_CSS_DEFAULT_SDIS_INFO, /* dis */ \ - { 0, 0},/* dvs_envelope_info */ \ - false, /* online */ \ - 0, /* uds_xc */ \ - 0, /* uds_yc */ \ - 0, /* left_padding */ \ - DEFAULT_BINARY_METRICS, /* metrics */ \ - IA_CSS_DEFAULT_ISP_MEM_PARAMS, /* mem_params */ \ - IA_CSS_DEFAULT_ISP_CSS_PARAMS, /* css_params */ \ +(struct ia_css_binary) { \ + .input_format = IA_CSS_STREAM_FORMAT_YUV420_8_LEGACY, \ + .in_frame_info = IA_CSS_BINARY_DEFAULT_FRAME_INFO, \ + .internal_frame_info = IA_CSS_BINARY_DEFAULT_FRAME_INFO, \ + .out_frame_info = {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \ + .vf_frame_info = IA_CSS_BINARY_DEFAULT_FRAME_INFO, \ } -#else - -#define IA_CSS_BINARY_DEFAULT_SETTINGS \ -{ \ - NULL, \ - IA_CSS_STREAM_FORMAT_YUV420_8_LEGACY, \ - IA_CSS_BINARY_DEFAULT_FRAME_INFO, \ - IA_CSS_BINARY_DEFAULT_FRAME_INFO, \ - {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \ - { 0, 0},/* effective_in_frame_res */ \ - IA_CSS_BINARY_DEFAULT_FRAME_INFO, \ - 0, /* input_buf_vectors */ \ - 0, /* deci_factor_log2 */ \ - 0, /* vf_downscale_log2 */ \ - 0, /* s3atbl_width */ \ - 0, /* s3atbl_height */ \ - 0, /* s3atbl_isp_width */ \ - 0, /* s3atbl_isp_height */ \ - 0, /* morph_tbl_width */ \ - 0, /* morph_tbl_aligned_width */ \ - 0, /* morph_tbl_height */ \ - 0, /* sctbl_width_per_color */ \ - 0, /* sctbl_aligned_width_per_color */ \ - 0, /* sctbl_height */ \ - IA_CSS_DEFAULT_SDIS_INFO, /* dis */ \ - { 0, 0},/* dvs_envelope_info */ \ - false, /* online */ \ - 0, /* uds_xc */ \ - 0, /* uds_yc */ \ - 0, /* left_padding */ \ - DEFAULT_BINARY_METRICS, /* metrics */ \ - IA_CSS_DEFAULT_ISP_MEM_PARAMS, /* mem_params */ \ - IA_CSS_DEFAULT_ISP_CSS_PARAMS, /* css_params */ \ -} - -#endif - enum ia_css_err ia_css_binary_init_infos(void); |