linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Sparse fixes for the Atom ISP Staging Driver
@ 2017-11-27 11:30 Jeremy Sowden
  2017-11-27 11:30 ` [PATCH 1/3] media: staging: atomisp: address member of struct ia_css_host_data is a pointer-to-char, so define default as NULL Jeremy Sowden
                   ` (2 more replies)
  0 siblings, 3 replies; 53+ messages in thread
From: Jeremy Sowden @ 2017-11-27 11:30 UTC (permalink / raw)
  To: linux-media, devel; +Cc: Jeremy Sowden

Fixed some sparse warnings in the Atom ISP staging driver and the checkpatch
warnings that affected my patches.

Jeremy Sowden (3):
  media: staging: atomisp: address member of struct ia_css_host_data is
    a pointer-to-char, so define default as NULL.
  media: staging: atomisp: defined as static some const arrays which
    don't need external linkage.
  media: staging: atomisp: prefer s16 to int16_t.

 .../isp/kernels/eed1_8/ia_css_eed1_8.host.c        | 25 +++++++++++-----------
 .../isp_param/interface/ia_css_isp_param_types.h   |  2 +-
 2 files changed, 13 insertions(+), 14 deletions(-)


base-commit: 844056fd74ebdd826bd23a7d989597e15f478acb
-- 
2.15.0

^ permalink raw reply	[flat|nested] 53+ messages in thread

* [PATCH 1/3] media: staging: atomisp: address member of struct ia_css_host_data is a pointer-to-char, so define default as NULL.
  2017-11-27 11:30 [PATCH 0/3] Sparse fixes for the Atom ISP Staging Driver Jeremy Sowden
@ 2017-11-27 11:30 ` Jeremy Sowden
  2017-11-27 11:30 ` [PATCH 2/3] media: staging: atomisp: defined as static some const arrays which don't need external linkage Jeremy Sowden
  2017-11-27 11:30 ` [PATCH 3/3] media: staging: atomisp: prefer s16 to int16_t Jeremy Sowden
  2 siblings, 0 replies; 53+ messages in thread
From: Jeremy Sowden @ 2017-11-27 11:30 UTC (permalink / raw)
  To: linux-media, devel; +Cc: Jeremy Sowden

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 .../css2400/runtime/isp_param/interface/ia_css_isp_param_types.h        | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
index 8e651b80345a..6fee3f7fd184 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
@@ -95,7 +95,7 @@ union ia_css_all_memory_offsets {
 };
 
 #define IA_CSS_DEFAULT_ISP_MEM_PARAMS \
-		{ { { { 0, 0 } } } }
+		{ { { { NULL, 0 } } } }
 
 #define IA_CSS_DEFAULT_ISP_CSS_PARAMS \
 		{ { { { 0, 0 } } } }
-- 
2.15.0

^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH 2/3] media: staging: atomisp: defined as static some const arrays which don't need external linkage.
  2017-11-27 11:30 [PATCH 0/3] Sparse fixes for the Atom ISP Staging Driver Jeremy Sowden
  2017-11-27 11:30 ` [PATCH 1/3] media: staging: atomisp: address member of struct ia_css_host_data is a pointer-to-char, so define default as NULL Jeremy Sowden
@ 2017-11-27 11:30 ` Jeremy Sowden
  2017-11-27 12:21   ` Greg KH
  2017-11-27 11:30 ` [PATCH 3/3] media: staging: atomisp: prefer s16 to int16_t Jeremy Sowden
  2 siblings, 1 reply; 53+ messages in thread
From: Jeremy Sowden @ 2017-11-27 11:30 UTC (permalink / raw)
  To: linux-media, devel; +Cc: Jeremy Sowden

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 .../isp/kernels/eed1_8/ia_css_eed1_8.host.c        | 24 +++++++++++-----------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/eed1_8/ia_css_eed1_8.host.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/eed1_8/ia_css_eed1_8.host.c
index 682f8b709ff9..47bb5042381b 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/eed1_8/ia_css_eed1_8.host.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/eed1_8/ia_css_eed1_8.host.c
@@ -32,44 +32,44 @@
 #define NUMBER_OF_TCINV_POINTS 9
 #define NUMBER_OF_FCINV_POINTS 9
 
-const int16_t chgrinv_x[NUMBER_OF_CHGRINV_POINTS] = {
+static const int16_t chgrinv_x[NUMBER_OF_CHGRINV_POINTS] = {
 0, 16, 64, 144, 272, 448, 672, 976,
 1376, 1888, 2528, 3312, 4256, 5376, 6688};
 
-const int16_t chgrinv_a[NUMBER_OF_CHGRINV_POINTS] = {
+static const int16_t chgrinv_a[NUMBER_OF_CHGRINV_POINTS] = {
 -7171, -256, -29, -3456, -1071, -475, -189, -102,
 -48, -38, -10, -9, -7, -6, 0};
 
-const int16_t chgrinv_b[NUMBER_OF_CHGRINV_POINTS] = {
+static const int16_t chgrinv_b[NUMBER_OF_CHGRINV_POINTS] = {
 8191, 1021, 256, 114, 60, 37, 24, 17,
 12, 9, 6, 5, 4, 3, 2};
 
-const int16_t chgrinv_c[NUMBER_OF_CHGRINV_POINTS] = {
+static const int16_t chgrinv_c[NUMBER_OF_CHGRINV_POINTS] = {
 1, 1, 1, 0, 0, 0, 0, 0,
 0, 0, 0, 0, 0, 0, 0};
 
-const int16_t tcinv_x[NUMBER_OF_TCINV_POINTS] = {
+static const int16_t tcinv_x[NUMBER_OF_TCINV_POINTS] = {
 0, 4, 11, 23, 42, 68, 102, 148, 205};
 
-const int16_t tcinv_a[NUMBER_OF_TCINV_POINTS] = {
+static const int16_t tcinv_a[NUMBER_OF_TCINV_POINTS] = {
 -6364, -631, -126, -34, -13, -6, -4452, -2156, 0};
 
-const int16_t tcinv_b[NUMBER_OF_TCINV_POINTS] = {
+static const int16_t tcinv_b[NUMBER_OF_TCINV_POINTS] = {
 8191, 1828, 726, 352, 197, 121, 80, 55, 40};
 
-const int16_t tcinv_c[NUMBER_OF_TCINV_POINTS] = {
+static const int16_t tcinv_c[NUMBER_OF_TCINV_POINTS] = {
 1, 1, 1, 1, 1, 1, 0, 0, 0};
 
-const int16_t fcinv_x[NUMBER_OF_FCINV_POINTS] = {
+static const int16_t fcinv_x[NUMBER_OF_FCINV_POINTS] = {
 0, 80, 216, 456, 824, 1344, 2040, 2952, 4096};
 
-const int16_t fcinv_a[NUMBER_OF_FCINV_POINTS] = {
+static const int16_t fcinv_a[NUMBER_OF_FCINV_POINTS] = {
 -5244, -486, -86, -2849, -961, -400, -180, -86, 0};
 
-const int16_t fcinv_b[NUMBER_OF_FCINV_POINTS] = {
+static const int16_t fcinv_b[NUMBER_OF_FCINV_POINTS] = {
 8191, 1637, 607, 287, 159, 98, 64, 44, 32};
 
-const int16_t fcinv_c[NUMBER_OF_FCINV_POINTS] = {
+static const int16_t fcinv_c[NUMBER_OF_FCINV_POINTS] = {
 1, 1, 1, 0, 0, 0, 0, 0, 0};
 
 
-- 
2.15.0

^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH 3/3] media: staging: atomisp: prefer s16 to int16_t.
  2017-11-27 11:30 [PATCH 0/3] Sparse fixes for the Atom ISP Staging Driver Jeremy Sowden
  2017-11-27 11:30 ` [PATCH 1/3] media: staging: atomisp: address member of struct ia_css_host_data is a pointer-to-char, so define default as NULL Jeremy Sowden
  2017-11-27 11:30 ` [PATCH 2/3] media: staging: atomisp: defined as static some const arrays which don't need external linkage Jeremy Sowden
@ 2017-11-27 11:30 ` Jeremy Sowden
  2017-11-29  8:47   ` Sakari Ailus
  2 siblings, 1 reply; 53+ messages in thread
From: Jeremy Sowden @ 2017-11-27 11:30 UTC (permalink / raw)
  To: linux-media, devel; +Cc: Jeremy Sowden

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 .../isp/kernels/eed1_8/ia_css_eed1_8.host.c        | 25 +++++++++++-----------
 1 file changed, 12 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/eed1_8/ia_css_eed1_8.host.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/eed1_8/ia_css_eed1_8.host.c
index 47bb5042381b..af6c8688876d 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/eed1_8/ia_css_eed1_8.host.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/eed1_8/ia_css_eed1_8.host.c
@@ -32,47 +32,46 @@
 #define NUMBER_OF_TCINV_POINTS 9
 #define NUMBER_OF_FCINV_POINTS 9
 
-static const int16_t chgrinv_x[NUMBER_OF_CHGRINV_POINTS] = {
+static const s16 chgrinv_x[NUMBER_OF_CHGRINV_POINTS] = {
 0, 16, 64, 144, 272, 448, 672, 976,
 1376, 1888, 2528, 3312, 4256, 5376, 6688};
 
-static const int16_t chgrinv_a[NUMBER_OF_CHGRINV_POINTS] = {
+static const s16 chgrinv_a[NUMBER_OF_CHGRINV_POINTS] = {
 -7171, -256, -29, -3456, -1071, -475, -189, -102,
 -48, -38, -10, -9, -7, -6, 0};
 
-static const int16_t chgrinv_b[NUMBER_OF_CHGRINV_POINTS] = {
+static const s16 chgrinv_b[NUMBER_OF_CHGRINV_POINTS] = {
 8191, 1021, 256, 114, 60, 37, 24, 17,
 12, 9, 6, 5, 4, 3, 2};
 
-static const int16_t chgrinv_c[NUMBER_OF_CHGRINV_POINTS] = {
+static const s16 chgrinv_c[NUMBER_OF_CHGRINV_POINTS] = {
 1, 1, 1, 0, 0, 0, 0, 0,
 0, 0, 0, 0, 0, 0, 0};
 
-static const int16_t tcinv_x[NUMBER_OF_TCINV_POINTS] = {
+static const s16 tcinv_x[NUMBER_OF_TCINV_POINTS] = {
 0, 4, 11, 23, 42, 68, 102, 148, 205};
 
-static const int16_t tcinv_a[NUMBER_OF_TCINV_POINTS] = {
+static const s16 tcinv_a[NUMBER_OF_TCINV_POINTS] = {
 -6364, -631, -126, -34, -13, -6, -4452, -2156, 0};
 
-static const int16_t tcinv_b[NUMBER_OF_TCINV_POINTS] = {
+static const s16 tcinv_b[NUMBER_OF_TCINV_POINTS] = {
 8191, 1828, 726, 352, 197, 121, 80, 55, 40};
 
-static const int16_t tcinv_c[NUMBER_OF_TCINV_POINTS] = {
+static const s16 tcinv_c[NUMBER_OF_TCINV_POINTS] = {
 1, 1, 1, 1, 1, 1, 0, 0, 0};
 
-static const int16_t fcinv_x[NUMBER_OF_FCINV_POINTS] = {
+static const s16 fcinv_x[NUMBER_OF_FCINV_POINTS] = {
 0, 80, 216, 456, 824, 1344, 2040, 2952, 4096};
 
-static const int16_t fcinv_a[NUMBER_OF_FCINV_POINTS] = {
+static const s16 fcinv_a[NUMBER_OF_FCINV_POINTS] = {
 -5244, -486, -86, -2849, -961, -400, -180, -86, 0};
 
-static const int16_t fcinv_b[NUMBER_OF_FCINV_POINTS] = {
+static const s16 fcinv_b[NUMBER_OF_FCINV_POINTS] = {
 8191, 1637, 607, 287, 159, 98, 64, 44, 32};
 
-static const int16_t fcinv_c[NUMBER_OF_FCINV_POINTS] = {
+static const s16 fcinv_c[NUMBER_OF_FCINV_POINTS] = {
 1, 1, 1, 0, 0, 0, 0, 0, 0};
 
-
 void
 ia_css_eed1_8_vmem_encode(
 	struct eed1_8_vmem_params *to,
-- 
2.15.0

^ permalink raw reply related	[flat|nested] 53+ messages in thread

* Re: [PATCH 2/3] media: staging: atomisp: defined as static some const arrays which don't need external linkage.
  2017-11-27 11:30 ` [PATCH 2/3] media: staging: atomisp: defined as static some const arrays which don't need external linkage Jeremy Sowden
@ 2017-11-27 12:21   ` Greg KH
  2017-11-27 12:44     ` [PATCH v2 0/3] Sparse fixes for the Atom ISP Staging Driver Jeremy Sowden
  2017-11-29  9:08     ` [PATCH 2/3] media: staging: atomisp: defined as static some const arrays which don't need external linkage Sakari Ailus
  0 siblings, 2 replies; 53+ messages in thread
From: Greg KH @ 2017-11-27 12:21 UTC (permalink / raw)
  To: Jeremy Sowden; +Cc: linux-media, devel

On Mon, Nov 27, 2017 at 11:30:53AM +0000, Jeremy Sowden wrote:
> Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
> ---
>  .../isp/kernels/eed1_8/ia_css_eed1_8.host.c        | 24 +++++++++++-----------
>  1 file changed, 12 insertions(+), 12 deletions(-)

I can never take patches without any changelog text, and so no one
should write them that way :)

Try it again?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 53+ messages in thread

* [PATCH v2 0/3] Sparse fixes for the Atom ISP Staging Driver
  2017-11-27 12:21   ` Greg KH
@ 2017-11-27 12:44     ` Jeremy Sowden
  2017-11-27 12:44       ` [PATCH v2 1/3] media: staging: atomisp: fix for sparse "using plain integer as NULL pointer" warnings Jeremy Sowden
                         ` (2 more replies)
  2017-11-29  9:08     ` [PATCH 2/3] media: staging: atomisp: defined as static some const arrays which don't need external linkage Sakari Ailus
  1 sibling, 3 replies; 53+ messages in thread
From: Jeremy Sowden @ 2017-11-27 12:44 UTC (permalink / raw)
  To: linux-media, devel; +Cc: Jeremy Sowden

Fixed some sparse warnings in the Atom ISP staging driver and the checkpatch
warnings that affected my patches.

This time with longer commit messages. :)

Jeremy Sowden (3):
  media: staging: atomisp: fix for sparse "using plain integer as NULL
    pointer" warnings.
  media: staging: atomisp: fixes for "symbol was not declared. Should it
    be static?" sparse warnings.
  media: staging: atomisp: fixed some checkpatch integer type warnings.

 .../isp/kernels/eed1_8/ia_css_eed1_8.host.c        | 25 +++++++++++-----------
 .../isp_param/interface/ia_css_isp_param_types.h   |  2 +-
 2 files changed, 13 insertions(+), 14 deletions(-)


base-commit: 844056fd74ebdd826bd23a7d989597e15f478acb
-- 
2.15.0

^ permalink raw reply	[flat|nested] 53+ messages in thread

* [PATCH v2 1/3] media: staging: atomisp: fix for sparse "using plain integer as NULL pointer" warnings.
  2017-11-27 12:44     ` [PATCH v2 0/3] Sparse fixes for the Atom ISP Staging Driver Jeremy Sowden
@ 2017-11-27 12:44       ` Jeremy Sowden
  2017-11-28 14:15         ` Dan Carpenter
  2017-11-27 12:44       ` [PATCH v2 2/3] media: staging: atomisp: fixes for "symbol was not declared. Should it be static?" sparse warnings Jeremy Sowden
  2017-11-27 12:44       ` [PATCH v2 3/3] media: staging: atomisp: fixed some checkpatch integer type warnings Jeremy Sowden
  2 siblings, 1 reply; 53+ messages in thread
From: Jeremy Sowden @ 2017-11-27 12:44 UTC (permalink / raw)
  To: linux-media, devel; +Cc: Jeremy Sowden

The "address" member of struct ia_css_host_data is a pointer-to-char, so define default as NULL.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 .../css2400/runtime/isp_param/interface/ia_css_isp_param_types.h        | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
index 8e651b80345a..6fee3f7fd184 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
@@ -95,7 +95,7 @@ union ia_css_all_memory_offsets {
 };
 
 #define IA_CSS_DEFAULT_ISP_MEM_PARAMS \
-		{ { { { 0, 0 } } } }
+		{ { { { NULL, 0 } } } }
 
 #define IA_CSS_DEFAULT_ISP_CSS_PARAMS \
 		{ { { { 0, 0 } } } }
-- 
2.15.0

^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 2/3] media: staging: atomisp: fixes for "symbol was not declared. Should it be static?" sparse warnings.
  2017-11-27 12:44     ` [PATCH v2 0/3] Sparse fixes for the Atom ISP Staging Driver Jeremy Sowden
  2017-11-27 12:44       ` [PATCH v2 1/3] media: staging: atomisp: fix for sparse "using plain integer as NULL pointer" warnings Jeremy Sowden
@ 2017-11-27 12:44       ` Jeremy Sowden
  2017-11-27 12:44       ` [PATCH v2 3/3] media: staging: atomisp: fixed some checkpatch integer type warnings Jeremy Sowden
  2 siblings, 0 replies; 53+ messages in thread
From: Jeremy Sowden @ 2017-11-27 12:44 UTC (permalink / raw)
  To: linux-media, devel; +Cc: Jeremy Sowden

Defined some const arrays as static since they don't need external linkage.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 .../isp/kernels/eed1_8/ia_css_eed1_8.host.c        | 24 +++++++++++-----------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/eed1_8/ia_css_eed1_8.host.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/eed1_8/ia_css_eed1_8.host.c
index 682f8b709ff9..47bb5042381b 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/eed1_8/ia_css_eed1_8.host.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/eed1_8/ia_css_eed1_8.host.c
@@ -32,44 +32,44 @@
 #define NUMBER_OF_TCINV_POINTS 9
 #define NUMBER_OF_FCINV_POINTS 9
 
-const int16_t chgrinv_x[NUMBER_OF_CHGRINV_POINTS] = {
+static const int16_t chgrinv_x[NUMBER_OF_CHGRINV_POINTS] = {
 0, 16, 64, 144, 272, 448, 672, 976,
 1376, 1888, 2528, 3312, 4256, 5376, 6688};
 
-const int16_t chgrinv_a[NUMBER_OF_CHGRINV_POINTS] = {
+static const int16_t chgrinv_a[NUMBER_OF_CHGRINV_POINTS] = {
 -7171, -256, -29, -3456, -1071, -475, -189, -102,
 -48, -38, -10, -9, -7, -6, 0};
 
-const int16_t chgrinv_b[NUMBER_OF_CHGRINV_POINTS] = {
+static const int16_t chgrinv_b[NUMBER_OF_CHGRINV_POINTS] = {
 8191, 1021, 256, 114, 60, 37, 24, 17,
 12, 9, 6, 5, 4, 3, 2};
 
-const int16_t chgrinv_c[NUMBER_OF_CHGRINV_POINTS] = {
+static const int16_t chgrinv_c[NUMBER_OF_CHGRINV_POINTS] = {
 1, 1, 1, 0, 0, 0, 0, 0,
 0, 0, 0, 0, 0, 0, 0};
 
-const int16_t tcinv_x[NUMBER_OF_TCINV_POINTS] = {
+static const int16_t tcinv_x[NUMBER_OF_TCINV_POINTS] = {
 0, 4, 11, 23, 42, 68, 102, 148, 205};
 
-const int16_t tcinv_a[NUMBER_OF_TCINV_POINTS] = {
+static const int16_t tcinv_a[NUMBER_OF_TCINV_POINTS] = {
 -6364, -631, -126, -34, -13, -6, -4452, -2156, 0};
 
-const int16_t tcinv_b[NUMBER_OF_TCINV_POINTS] = {
+static const int16_t tcinv_b[NUMBER_OF_TCINV_POINTS] = {
 8191, 1828, 726, 352, 197, 121, 80, 55, 40};
 
-const int16_t tcinv_c[NUMBER_OF_TCINV_POINTS] = {
+static const int16_t tcinv_c[NUMBER_OF_TCINV_POINTS] = {
 1, 1, 1, 1, 1, 1, 0, 0, 0};
 
-const int16_t fcinv_x[NUMBER_OF_FCINV_POINTS] = {
+static const int16_t fcinv_x[NUMBER_OF_FCINV_POINTS] = {
 0, 80, 216, 456, 824, 1344, 2040, 2952, 4096};
 
-const int16_t fcinv_a[NUMBER_OF_FCINV_POINTS] = {
+static const int16_t fcinv_a[NUMBER_OF_FCINV_POINTS] = {
 -5244, -486, -86, -2849, -961, -400, -180, -86, 0};
 
-const int16_t fcinv_b[NUMBER_OF_FCINV_POINTS] = {
+static const int16_t fcinv_b[NUMBER_OF_FCINV_POINTS] = {
 8191, 1637, 607, 287, 159, 98, 64, 44, 32};
 
-const int16_t fcinv_c[NUMBER_OF_FCINV_POINTS] = {
+static const int16_t fcinv_c[NUMBER_OF_FCINV_POINTS] = {
 1, 1, 1, 0, 0, 0, 0, 0, 0};
 
 
-- 
2.15.0

^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 3/3] media: staging: atomisp: fixed some checkpatch integer type warnings.
  2017-11-27 12:44     ` [PATCH v2 0/3] Sparse fixes for the Atom ISP Staging Driver Jeremy Sowden
  2017-11-27 12:44       ` [PATCH v2 1/3] media: staging: atomisp: fix for sparse "using plain integer as NULL pointer" warnings Jeremy Sowden
  2017-11-27 12:44       ` [PATCH v2 2/3] media: staging: atomisp: fixes for "symbol was not declared. Should it be static?" sparse warnings Jeremy Sowden
@ 2017-11-27 12:44       ` Jeremy Sowden
  2017-11-27 19:09         ` Alan Cox
  2 siblings, 1 reply; 53+ messages in thread
From: Jeremy Sowden @ 2017-11-27 12:44 UTC (permalink / raw)
  To: linux-media, devel; +Cc: Jeremy Sowden

Changed the types of some arrays from int16_t to s16.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 .../isp/kernels/eed1_8/ia_css_eed1_8.host.c        | 25 +++++++++++-----------
 1 file changed, 12 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/eed1_8/ia_css_eed1_8.host.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/eed1_8/ia_css_eed1_8.host.c
index 47bb5042381b..af6c8688876d 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/eed1_8/ia_css_eed1_8.host.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/eed1_8/ia_css_eed1_8.host.c
@@ -32,47 +32,46 @@
 #define NUMBER_OF_TCINV_POINTS 9
 #define NUMBER_OF_FCINV_POINTS 9
 
-static const int16_t chgrinv_x[NUMBER_OF_CHGRINV_POINTS] = {
+static const s16 chgrinv_x[NUMBER_OF_CHGRINV_POINTS] = {
 0, 16, 64, 144, 272, 448, 672, 976,
 1376, 1888, 2528, 3312, 4256, 5376, 6688};
 
-static const int16_t chgrinv_a[NUMBER_OF_CHGRINV_POINTS] = {
+static const s16 chgrinv_a[NUMBER_OF_CHGRINV_POINTS] = {
 -7171, -256, -29, -3456, -1071, -475, -189, -102,
 -48, -38, -10, -9, -7, -6, 0};
 
-static const int16_t chgrinv_b[NUMBER_OF_CHGRINV_POINTS] = {
+static const s16 chgrinv_b[NUMBER_OF_CHGRINV_POINTS] = {
 8191, 1021, 256, 114, 60, 37, 24, 17,
 12, 9, 6, 5, 4, 3, 2};
 
-static const int16_t chgrinv_c[NUMBER_OF_CHGRINV_POINTS] = {
+static const s16 chgrinv_c[NUMBER_OF_CHGRINV_POINTS] = {
 1, 1, 1, 0, 0, 0, 0, 0,
 0, 0, 0, 0, 0, 0, 0};
 
-static const int16_t tcinv_x[NUMBER_OF_TCINV_POINTS] = {
+static const s16 tcinv_x[NUMBER_OF_TCINV_POINTS] = {
 0, 4, 11, 23, 42, 68, 102, 148, 205};
 
-static const int16_t tcinv_a[NUMBER_OF_TCINV_POINTS] = {
+static const s16 tcinv_a[NUMBER_OF_TCINV_POINTS] = {
 -6364, -631, -126, -34, -13, -6, -4452, -2156, 0};
 
-static const int16_t tcinv_b[NUMBER_OF_TCINV_POINTS] = {
+static const s16 tcinv_b[NUMBER_OF_TCINV_POINTS] = {
 8191, 1828, 726, 352, 197, 121, 80, 55, 40};
 
-static const int16_t tcinv_c[NUMBER_OF_TCINV_POINTS] = {
+static const s16 tcinv_c[NUMBER_OF_TCINV_POINTS] = {
 1, 1, 1, 1, 1, 1, 0, 0, 0};
 
-static const int16_t fcinv_x[NUMBER_OF_FCINV_POINTS] = {
+static const s16 fcinv_x[NUMBER_OF_FCINV_POINTS] = {
 0, 80, 216, 456, 824, 1344, 2040, 2952, 4096};
 
-static const int16_t fcinv_a[NUMBER_OF_FCINV_POINTS] = {
+static const s16 fcinv_a[NUMBER_OF_FCINV_POINTS] = {
 -5244, -486, -86, -2849, -961, -400, -180, -86, 0};
 
-static const int16_t fcinv_b[NUMBER_OF_FCINV_POINTS] = {
+static const s16 fcinv_b[NUMBER_OF_FCINV_POINTS] = {
 8191, 1637, 607, 287, 159, 98, 64, 44, 32};
 
-static const int16_t fcinv_c[NUMBER_OF_FCINV_POINTS] = {
+static const s16 fcinv_c[NUMBER_OF_FCINV_POINTS] = {
 1, 1, 1, 0, 0, 0, 0, 0, 0};
 
-
 void
 ia_css_eed1_8_vmem_encode(
 	struct eed1_8_vmem_params *to,
-- 
2.15.0

^ permalink raw reply related	[flat|nested] 53+ messages in thread

* Re: [PATCH v2 3/3] media: staging: atomisp: fixed some checkpatch integer type warnings.
  2017-11-27 12:44       ` [PATCH v2 3/3] media: staging: atomisp: fixed some checkpatch integer type warnings Jeremy Sowden
@ 2017-11-27 19:09         ` Alan Cox
  2017-11-27 22:02           ` Jeremy Sowden
  2017-11-28 10:27           ` [PATCH v2 0/3] Sparse fixes for the Atom ISP Staging Driver Jeremy Sowden
  0 siblings, 2 replies; 53+ messages in thread
From: Alan Cox @ 2017-11-27 19:09 UTC (permalink / raw)
  To: Jeremy Sowden; +Cc: linux-media, devel

On Mon, 27 Nov 2017 12:44:50 +0000
Jeremy Sowden <jeremy@azazel.net> wrote:

> Changed the types of some arrays from int16_t to s16W


Which are the same type, except int16_t is the standard form.

No point.

Alan

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH v2 3/3] media: staging: atomisp: fixed some checkpatch integer type warnings.
  2017-11-27 19:09         ` Alan Cox
@ 2017-11-27 22:02           ` Jeremy Sowden
  2017-11-28 10:27           ` [PATCH v2 0/3] Sparse fixes for the Atom ISP Staging Driver Jeremy Sowden
  1 sibling, 0 replies; 53+ messages in thread
From: Jeremy Sowden @ 2017-11-27 22:02 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-media, devel

On 2017-11-27, at 19:09:38 +0000, Alan Cox wrote:
> On Mon, 27 Nov 2017 12:44:50 +0000 Jeremy Sowden wrote:
> > Changed the types of some arrays from int16_t to s16
>
> Which are the same type, except int16_t is the standard form.
>
> No point.

Righto, so this would be one of those cases in which I should have
exercised judgment: checkpatch suggested preferring the kernel's own
types, but it wasn't a reason to change existing code.

Thanks for the feedback.

J.

^ permalink raw reply	[flat|nested] 53+ messages in thread

* [PATCH v2 0/3] Sparse fixes for the Atom ISP Staging Driver
  2017-11-27 19:09         ` Alan Cox
  2017-11-27 22:02           ` Jeremy Sowden
@ 2017-11-28 10:27           ` Jeremy Sowden
  2017-11-28 10:27             ` [PATCH v3 1/2] media: staging: atomisp: fix for sparse "using plain integer as NULL pointer" warnings Jeremy Sowden
                               ` (2 more replies)
  1 sibling, 3 replies; 53+ messages in thread
From: Jeremy Sowden @ 2017-11-28 10:27 UTC (permalink / raw)
  To: linux-media, devel; +Cc: Jeremy Sowden

Fixed some sparse warnings in the Atom ISP staging driver.

This time with longer commit messages. :)

I've chosen to ignore checkpatch.pl's suggestion to change the types of
the arrays in the second patch from int16_t to s16.

Jeremy Sowden (2):
  media: staging: atomisp: fix for sparse "using plain integer as NULL
    pointer" warnings.
  media: staging: atomisp: fixes for "symbol was not declared. Should it
    be static?" sparse warnings.

 .../isp/kernels/eed1_8/ia_css_eed1_8.host.c        | 24 +++++++++++-----------
 .../isp_param/interface/ia_css_isp_param_types.h   |  2 +-
 2 files changed, 13 insertions(+), 13 deletions(-)


base-commit: 844056fd74ebdd826bd23a7d989597e15f478acb
-- 
2.15.0

^ permalink raw reply	[flat|nested] 53+ messages in thread

* [PATCH v3 1/2] media: staging: atomisp: fix for sparse "using plain integer as NULL pointer" warnings.
  2017-11-28 10:27           ` [PATCH v2 0/3] Sparse fixes for the Atom ISP Staging Driver Jeremy Sowden
@ 2017-11-28 10:27             ` Jeremy Sowden
  2017-11-28 10:27             ` [PATCH v3 2/2] media: staging: atomisp: fixes for "symbol was not declared. Should it be static?" sparse warnings Jeremy Sowden
  2017-11-29  8:48             ` [PATCH v2 0/3] Sparse fixes for the Atom ISP Staging Driver Sakari Ailus
  2 siblings, 0 replies; 53+ messages in thread
From: Jeremy Sowden @ 2017-11-28 10:27 UTC (permalink / raw)
  To: linux-media, devel; +Cc: Jeremy Sowden

The "address" member of struct ia_css_host_data is a pointer-to-char, so define default as NULL.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 .../css2400/runtime/isp_param/interface/ia_css_isp_param_types.h        | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
index 8e651b80345a..6fee3f7fd184 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
@@ -95,7 +95,7 @@ union ia_css_all_memory_offsets {
 };
 
 #define IA_CSS_DEFAULT_ISP_MEM_PARAMS \
-		{ { { { 0, 0 } } } }
+		{ { { { NULL, 0 } } } }
 
 #define IA_CSS_DEFAULT_ISP_CSS_PARAMS \
 		{ { { { 0, 0 } } } }
-- 
2.15.0

^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v3 2/2] media: staging: atomisp: fixes for "symbol was not declared. Should it be static?" sparse warnings.
  2017-11-28 10:27           ` [PATCH v2 0/3] Sparse fixes for the Atom ISP Staging Driver Jeremy Sowden
  2017-11-28 10:27             ` [PATCH v3 1/2] media: staging: atomisp: fix for sparse "using plain integer as NULL pointer" warnings Jeremy Sowden
@ 2017-11-28 10:27             ` Jeremy Sowden
  2017-11-29  8:48             ` [PATCH v2 0/3] Sparse fixes for the Atom ISP Staging Driver Sakari Ailus
  2 siblings, 0 replies; 53+ messages in thread
From: Jeremy Sowden @ 2017-11-28 10:27 UTC (permalink / raw)
  To: linux-media, devel; +Cc: Jeremy Sowden

Defined some const arrays as static since they don't need external linkage.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 .../isp/kernels/eed1_8/ia_css_eed1_8.host.c        | 24 +++++++++++-----------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/eed1_8/ia_css_eed1_8.host.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/eed1_8/ia_css_eed1_8.host.c
index 682f8b709ff9..47bb5042381b 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/eed1_8/ia_css_eed1_8.host.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/eed1_8/ia_css_eed1_8.host.c
@@ -32,44 +32,44 @@
 #define NUMBER_OF_TCINV_POINTS 9
 #define NUMBER_OF_FCINV_POINTS 9
 
-const int16_t chgrinv_x[NUMBER_OF_CHGRINV_POINTS] = {
+static const int16_t chgrinv_x[NUMBER_OF_CHGRINV_POINTS] = {
 0, 16, 64, 144, 272, 448, 672, 976,
 1376, 1888, 2528, 3312, 4256, 5376, 6688};
 
-const int16_t chgrinv_a[NUMBER_OF_CHGRINV_POINTS] = {
+static const int16_t chgrinv_a[NUMBER_OF_CHGRINV_POINTS] = {
 -7171, -256, -29, -3456, -1071, -475, -189, -102,
 -48, -38, -10, -9, -7, -6, 0};
 
-const int16_t chgrinv_b[NUMBER_OF_CHGRINV_POINTS] = {
+static const int16_t chgrinv_b[NUMBER_OF_CHGRINV_POINTS] = {
 8191, 1021, 256, 114, 60, 37, 24, 17,
 12, 9, 6, 5, 4, 3, 2};
 
-const int16_t chgrinv_c[NUMBER_OF_CHGRINV_POINTS] = {
+static const int16_t chgrinv_c[NUMBER_OF_CHGRINV_POINTS] = {
 1, 1, 1, 0, 0, 0, 0, 0,
 0, 0, 0, 0, 0, 0, 0};
 
-const int16_t tcinv_x[NUMBER_OF_TCINV_POINTS] = {
+static const int16_t tcinv_x[NUMBER_OF_TCINV_POINTS] = {
 0, 4, 11, 23, 42, 68, 102, 148, 205};
 
-const int16_t tcinv_a[NUMBER_OF_TCINV_POINTS] = {
+static const int16_t tcinv_a[NUMBER_OF_TCINV_POINTS] = {
 -6364, -631, -126, -34, -13, -6, -4452, -2156, 0};
 
-const int16_t tcinv_b[NUMBER_OF_TCINV_POINTS] = {
+static const int16_t tcinv_b[NUMBER_OF_TCINV_POINTS] = {
 8191, 1828, 726, 352, 197, 121, 80, 55, 40};
 
-const int16_t tcinv_c[NUMBER_OF_TCINV_POINTS] = {
+static const int16_t tcinv_c[NUMBER_OF_TCINV_POINTS] = {
 1, 1, 1, 1, 1, 1, 0, 0, 0};
 
-const int16_t fcinv_x[NUMBER_OF_FCINV_POINTS] = {
+static const int16_t fcinv_x[NUMBER_OF_FCINV_POINTS] = {
 0, 80, 216, 456, 824, 1344, 2040, 2952, 4096};
 
-const int16_t fcinv_a[NUMBER_OF_FCINV_POINTS] = {
+static const int16_t fcinv_a[NUMBER_OF_FCINV_POINTS] = {
 -5244, -486, -86, -2849, -961, -400, -180, -86, 0};
 
-const int16_t fcinv_b[NUMBER_OF_FCINV_POINTS] = {
+static const int16_t fcinv_b[NUMBER_OF_FCINV_POINTS] = {
 8191, 1637, 607, 287, 159, 98, 64, 44, 32};
 
-const int16_t fcinv_c[NUMBER_OF_FCINV_POINTS] = {
+static const int16_t fcinv_c[NUMBER_OF_FCINV_POINTS] = {
 1, 1, 1, 0, 0, 0, 0, 0, 0};
 
 
-- 
2.15.0

^ permalink raw reply related	[flat|nested] 53+ messages in thread

* Re: [PATCH v2 1/3] media: staging: atomisp: fix for sparse "using plain integer as NULL pointer" warnings.
  2017-11-27 12:44       ` [PATCH v2 1/3] media: staging: atomisp: fix for sparse "using plain integer as NULL pointer" warnings Jeremy Sowden
@ 2017-11-28 14:15         ` Dan Carpenter
  2017-11-28 23:33           ` Jeremy Sowden
  0 siblings, 1 reply; 53+ messages in thread
From: Dan Carpenter @ 2017-11-28 14:15 UTC (permalink / raw)
  To: Jeremy Sowden; +Cc: linux-media, devel

On Mon, Nov 27, 2017 at 12:44:48PM +0000, Jeremy Sowden wrote:
> The "address" member of struct ia_css_host_data is a pointer-to-char, so define default as NULL.
> 
> Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
> ---
>  .../css2400/runtime/isp_param/interface/ia_css_isp_param_types.h        | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
> index 8e651b80345a..6fee3f7fd184 100644
> --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
> +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
> @@ -95,7 +95,7 @@ union ia_css_all_memory_offsets {
>  };
>  
>  #define IA_CSS_DEFAULT_ISP_MEM_PARAMS \
> -		{ { { { 0, 0 } } } }
> +		{ { { { NULL, 0 } } } }

This define is way ugly and instead of making superficial changes, you
should try to eliminate it.

People look at warnings as a bad thing but they are actually a valuable
resource which call attention to bad code.  By making this change you're
kind of wasting the warning.  The bad code is still there, it's just
swept under the rug but like a dead mouse carcass it's still stinking up
the living room.  We should leave the warning there until it irritates
someone enough to fix it properly.

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH v2 1/3] media: staging: atomisp: fix for sparse "using plain integer as NULL pointer" warnings.
  2017-11-28 14:15         ` Dan Carpenter
@ 2017-11-28 23:33           ` Jeremy Sowden
  2017-11-29  0:04             ` Dan Carpenter
  0 siblings, 1 reply; 53+ messages in thread
From: Jeremy Sowden @ 2017-11-28 23:33 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: linux-media, devel

[-- Attachment #1: Type: text/plain, Size: 6192 bytes --]

On 2017-11-28, at 17:15:24 +0300, Dan Carpenter wrote:
> On Mon, Nov 27, 2017 at 12:44:48PM +0000, Jeremy Sowden wrote:
> > The "address" member of struct ia_css_host_data is a
> > pointer-to-char, so define default as NULL.
> >
> > --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
> > +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
> > @@ -95,7 +95,7 @@ union ia_css_all_memory_offsets {
> >  };
> >
> >  #define IA_CSS_DEFAULT_ISP_MEM_PARAMS \
> > -		{ { { { 0, 0 } } } }
> > +		{ { { { NULL, 0 } } } }
>
> This define is way ugly and instead of making superficial changes, you
> should try to eliminate it.
>
> People look at warnings as a bad thing but they are actually a
> valuable resource which call attention to bad code.  By making this
> change you're kind of wasting the warning.  The bad code is still
> there, it's just swept under the rug but like a dead mouse carcass
> it's still stinking up the living room.  We should leave the warning
> there until it irritates someone enough to fix it properly.

Tracking down the offending initializer was definitely a pain.

Compound literals with designated initializers would make this macro
(and a number of others) easier to understand and more type-safe:

   #define IA_CSS_DEFAULT_ISP_MEM_PARAMS \
  -		{ { { { 0, 0 } } } }
  +	(struct ia_css_isp_param_host_segments) { \
  +		.params = { { \
  +			(struct ia_css_host_data) { \
  +				.address = NULL, \
  +				.size = 0 \
  +			} \
  +		} } \
  +	}

Unfortunately this default value is one end of a chain of default values
used to initialize members of default values of enclosing structs where
the outermost values are used to initialize some static variables:

  static enum ia_css_err
  init_pipe_defaults(enum ia_css_pipe_mode mode,
		     struct ia_css_pipe *pipe,
		     bool copy_pipe)
  {
    static struct ia_css_pipe default_pipe = IA_CSS_DEFAULT_PIPE;
    static struct ia_css_preview_settings prev  = IA_CSS_DEFAULT_PREVIEW_SETTINGS;
    static struct ia_css_capture_settings capt  = IA_CSS_DEFAULT_CAPTURE_SETTINGS;
    static struct ia_css_video_settings   video = IA_CSS_DEFAULT_VIDEO_SETTINGS;
    static struct ia_css_yuvpp_settings   yuvpp = IA_CSS_DEFAULT_YUVPP_SETTINGS;

    if (pipe == NULL) {
      IA_CSS_ERROR("NULL pipe parameter");
      return IA_CSS_ERR_INVALID_ARGUMENTS;
    }

    /* Initialize pipe to pre-defined defaults */
    *pipe = default_pipe;

    /* TODO: JB should not be needed, but temporary backward reference */
    switch (mode) {
    case IA_CSS_PIPE_MODE_PREVIEW:
      pipe->mode = IA_CSS_PIPE_ID_PREVIEW;
      pipe->pipe_settings.preview = prev;
      break;
    case IA_CSS_PIPE_MODE_CAPTURE:
      if (copy_pipe) {
	pipe->mode = IA_CSS_PIPE_ID_COPY;
      } else {
	pipe->mode = IA_CSS_PIPE_ID_CAPTURE;
      }
      pipe->pipe_settings.capture = capt;
      break;
    case IA_CSS_PIPE_MODE_VIDEO:
      pipe->mode = IA_CSS_PIPE_ID_VIDEO;
      pipe->pipe_settings.video = video;
      break;
    case IA_CSS_PIPE_MODE_ACC:
      pipe->mode = IA_CSS_PIPE_ID_ACC;
      break;
    case IA_CSS_PIPE_MODE_COPY:
      pipe->mode = IA_CSS_PIPE_ID_CAPTURE;
      break;
    case IA_CSS_PIPE_MODE_YUVPP:
      pipe->mode = IA_CSS_PIPE_ID_YUVPP;
      pipe->pipe_settings.yuvpp = yuvpp;
      break;
    default:
      return IA_CSS_ERR_INVALID_ARGUMENTS;
    }

    return IA_CSS_SUCCESS;
  }

and GCC's limited support for using compound literals to initialize
static variables doesn't stretch this far.

I'm not convinced, however, that those variables actually achieve very
much.  If I change the code to assign the defaults directly, the problem
goes away:

  diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
  index f92b6a9f77eb..671b2c732a46 100644
  --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
  +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
  @@ -2291,25 +2291,19 @@ init_pipe_defaults(enum ia_css_pipe_mode mode,
		 struct ia_css_pipe *pipe,
		 bool copy_pipe)
   {
  -       static struct ia_css_pipe default_pipe = IA_CSS_DEFAULT_PIPE;
  -       static struct ia_css_preview_settings prev  = IA_CSS_DEFAULT_PREVIEW_SETTINGS;
  -       static struct ia_css_capture_settings capt  = IA_CSS_DEFAULT_CAPTURE_SETTINGS;
  -       static struct ia_css_video_settings   video = IA_CSS_DEFAULT_VIDEO_SETTINGS;
  -       static struct ia_css_yuvpp_settings   yuvpp = IA_CSS_DEFAULT_YUVPP_SETTINGS;
  -
	  if (pipe == NULL) {
		  IA_CSS_ERROR("NULL pipe parameter");
		  return IA_CSS_ERR_INVALID_ARGUMENTS;
	  }

	  /* Initialize pipe to pre-defined defaults */
  -       *pipe = default_pipe;
  +       *pipe = IA_CSS_DEFAULT_PIPE;

	  /* TODO: JB should not be needed, but temporary backward reference */
	  switch (mode) {
	  case IA_CSS_PIPE_MODE_PREVIEW:
		  pipe->mode = IA_CSS_PIPE_ID_PREVIEW;
  -               pipe->pipe_settings.preview = prev;
  +               pipe->pipe_settings.preview = IA_CSS_DEFAULT_PREVIEW_SETTINGS;
		  break;
	  case IA_CSS_PIPE_MODE_CAPTURE:
		  if (copy_pipe) {
  @@ -2317,11 +2311,11 @@ init_pipe_defaults(enum ia_css_pipe_mode mode,
		  } else {
			  pipe->mode = IA_CSS_PIPE_ID_CAPTURE;
		  }
  -               pipe->pipe_settings.capture = capt;
  +               pipe->pipe_settings.capture = IA_CSS_DEFAULT_CAPTURE_SETTINGS;
		  break;
	  case IA_CSS_PIPE_MODE_VIDEO:
		  pipe->mode = IA_CSS_PIPE_ID_VIDEO;
  -               pipe->pipe_settings.video = video;
  +               pipe->pipe_settings.video = IA_CSS_DEFAULT_VIDEO_SETTINGS;
		  break;
	  case IA_CSS_PIPE_MODE_ACC:
		  pipe->mode = IA_CSS_PIPE_ID_ACC;
  @@ -2331,7 +2325,7 @@ init_pipe_defaults(enum ia_css_pipe_mode mode,
		  break;
	  case IA_CSS_PIPE_MODE_YUVPP:
		  pipe->mode = IA_CSS_PIPE_ID_YUVPP;
  -               pipe->pipe_settings.yuvpp = yuvpp;
  +               pipe->pipe_settings.yuvpp = IA_CSS_DEFAULT_YUVPP_SETTINGS;
		  break;
	  default:
		  return IA_CSS_ERR_INVALID_ARGUMENTS;

Does this seem reasonable or am I barking up the wrong tree?

J.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH v2 1/3] media: staging: atomisp: fix for sparse "using plain integer as NULL pointer" warnings.
  2017-11-28 23:33           ` Jeremy Sowden
@ 2017-11-29  0:04             ` Dan Carpenter
  2017-11-29  8:38               ` Jeremy Sowden
  0 siblings, 1 reply; 53+ messages in thread
From: Dan Carpenter @ 2017-11-29  0:04 UTC (permalink / raw)
  To: Jeremy Sowden; +Cc: devel, linux-media

On Tue, Nov 28, 2017 at 11:33:37PM +0000, Jeremy Sowden wrote:
> On 2017-11-28, at 17:15:24 +0300, Dan Carpenter wrote:
> > On Mon, Nov 27, 2017 at 12:44:48PM +0000, Jeremy Sowden wrote:
> > > The "address" member of struct ia_css_host_data is a
> > > pointer-to-char, so define default as NULL.
> > >
> > > --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
> > > +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
> > > @@ -95,7 +95,7 @@ union ia_css_all_memory_offsets {
> > >  };
> > >
> > >  #define IA_CSS_DEFAULT_ISP_MEM_PARAMS \
> > > -		{ { { { 0, 0 } } } }
> > > +		{ { { { NULL, 0 } } } }
> >
> > This define is way ugly and instead of making superficial changes, you
> > should try to eliminate it.
> >
> > People look at warnings as a bad thing but they are actually a
> > valuable resource which call attention to bad code.  By making this
> > change you're kind of wasting the warning.  The bad code is still
> > there, it's just swept under the rug but like a dead mouse carcass
> > it's still stinking up the living room.  We should leave the warning
> > there until it irritates someone enough to fix it properly.
> 
> Tracking down the offending initializer was definitely a pain.
> 
> Compound literals with designated initializers would make this macro
> (and a number of others) easier to understand and more type-safe:
> 
>    #define IA_CSS_DEFAULT_ISP_MEM_PARAMS \
>   -		{ { { { 0, 0 } } } }
>   +	(struct ia_css_isp_param_host_segments) { \
>   +		.params = { { \
>   +			(struct ia_css_host_data) { \
>   +				.address = NULL, \
>   +				.size = 0 \
>   +			} \
>   +		} } \
>   +	}

Using designated initializers is good, yes.  Can't we just use an
empty initializer since this is all zeroed memory anyway?

	(struct ia_css_isp_param_host_segments) { }

I haven't tried it.

> 
> Unfortunately this default value is one end of a chain of default values


Yeah.  A really long chain...


> used to initialize members of default values of enclosing structs where
> the outermost values are used to initialize some static variables:
> 
>   static enum ia_css_err
>   init_pipe_defaults(enum ia_css_pipe_mode mode,
> 		     struct ia_css_pipe *pipe,
> 		     bool copy_pipe)
>   {
>     static struct ia_css_pipe default_pipe = IA_CSS_DEFAULT_PIPE;
>     static struct ia_css_preview_settings prev  = IA_CSS_DEFAULT_PREVIEW_SETTINGS;
>     static struct ia_css_capture_settings capt  = IA_CSS_DEFAULT_CAPTURE_SETTINGS;
>     static struct ia_css_video_settings   video = IA_CSS_DEFAULT_VIDEO_SETTINGS;
>     static struct ia_css_yuvpp_settings   yuvpp = IA_CSS_DEFAULT_YUVPP_SETTINGS;
> 
>     if (pipe == NULL) {
>       IA_CSS_ERROR("NULL pipe parameter");
>       return IA_CSS_ERR_INVALID_ARGUMENTS;
>     }
> 
>     /* Initialize pipe to pre-defined defaults */
>     *pipe = default_pipe;
> 
>     /* TODO: JB should not be needed, but temporary backward reference */
>     switch (mode) {
>     case IA_CSS_PIPE_MODE_PREVIEW:
>       pipe->mode = IA_CSS_PIPE_ID_PREVIEW;
>       pipe->pipe_settings.preview = prev;
>       break;
>     case IA_CSS_PIPE_MODE_CAPTURE:
>       if (copy_pipe) {
> 	pipe->mode = IA_CSS_PIPE_ID_COPY;
>       } else {
> 	pipe->mode = IA_CSS_PIPE_ID_CAPTURE;
>       }
>       pipe->pipe_settings.capture = capt;
>       break;
>     case IA_CSS_PIPE_MODE_VIDEO:
>       pipe->mode = IA_CSS_PIPE_ID_VIDEO;
>       pipe->pipe_settings.video = video;
>       break;
>     case IA_CSS_PIPE_MODE_ACC:
>       pipe->mode = IA_CSS_PIPE_ID_ACC;
>       break;
>     case IA_CSS_PIPE_MODE_COPY:
>       pipe->mode = IA_CSS_PIPE_ID_CAPTURE;
>       break;
>     case IA_CSS_PIPE_MODE_YUVPP:
>       pipe->mode = IA_CSS_PIPE_ID_YUVPP;
>       pipe->pipe_settings.yuvpp = yuvpp;
>       break;
>     default:
>       return IA_CSS_ERR_INVALID_ARGUMENTS;
>     }
> 
>     return IA_CSS_SUCCESS;
>   }
> 
> and GCC's limited support for using compound literals to initialize
> static variables doesn't stretch this far.
> 
> I'm not convinced, however, that those variables actually achieve very
> much.  If I change the code to assign the defaults directly, the problem
> goes away:
> 
>   diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
>   index f92b6a9f77eb..671b2c732a46 100644
>   --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
>   +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
>   @@ -2291,25 +2291,19 @@ init_pipe_defaults(enum ia_css_pipe_mode mode,
> 		 struct ia_css_pipe *pipe,
> 		 bool copy_pipe)
>    {
>   -       static struct ia_css_pipe default_pipe = IA_CSS_DEFAULT_PIPE;
>   -       static struct ia_css_preview_settings prev  = IA_CSS_DEFAULT_PREVIEW_SETTINGS;
>   -       static struct ia_css_capture_settings capt  = IA_CSS_DEFAULT_CAPTURE_SETTINGS;
>   -       static struct ia_css_video_settings   video = IA_CSS_DEFAULT_VIDEO_SETTINGS;
>   -       static struct ia_css_yuvpp_settings   yuvpp = IA_CSS_DEFAULT_YUVPP_SETTINGS;
>   -
> 	  if (pipe == NULL) {
> 		  IA_CSS_ERROR("NULL pipe parameter");
> 		  return IA_CSS_ERR_INVALID_ARGUMENTS;
> 	  }
> 
> 	  /* Initialize pipe to pre-defined defaults */
>   -       *pipe = default_pipe;
>   +       *pipe = IA_CSS_DEFAULT_PIPE;
> 
> 	  /* TODO: JB should not be needed, but temporary backward reference */
> 	  switch (mode) {
> 	  case IA_CSS_PIPE_MODE_PREVIEW:
> 		  pipe->mode = IA_CSS_PIPE_ID_PREVIEW;
>   -               pipe->pipe_settings.preview = prev;
>   +               pipe->pipe_settings.preview = IA_CSS_DEFAULT_PREVIEW_SETTINGS;
> 		  break;
> 	  case IA_CSS_PIPE_MODE_CAPTURE:
> 		  if (copy_pipe) {
>   @@ -2317,11 +2311,11 @@ init_pipe_defaults(enum ia_css_pipe_mode mode,
> 		  } else {
> 			  pipe->mode = IA_CSS_PIPE_ID_CAPTURE;
> 		  }
>   -               pipe->pipe_settings.capture = capt;
>   +               pipe->pipe_settings.capture = IA_CSS_DEFAULT_CAPTURE_SETTINGS;
> 		  break;
> 	  case IA_CSS_PIPE_MODE_VIDEO:
> 		  pipe->mode = IA_CSS_PIPE_ID_VIDEO;
>   -               pipe->pipe_settings.video = video;
>   +               pipe->pipe_settings.video = IA_CSS_DEFAULT_VIDEO_SETTINGS;
> 		  break;
> 	  case IA_CSS_PIPE_MODE_ACC:
> 		  pipe->mode = IA_CSS_PIPE_ID_ACC;
>   @@ -2331,7 +2325,7 @@ init_pipe_defaults(enum ia_css_pipe_mode mode,
> 		  break;
> 	  case IA_CSS_PIPE_MODE_YUVPP:
> 		  pipe->mode = IA_CSS_PIPE_ID_YUVPP;
>   -               pipe->pipe_settings.yuvpp = yuvpp;
>   +               pipe->pipe_settings.yuvpp = IA_CSS_DEFAULT_YUVPP_SETTINGS;
> 		  break;
> 	  default:
> 		  return IA_CSS_ERR_INVALID_ARGUMENTS;
> 
> Does this seem reasonable or am I barking up the wrong tree?

Yes.  Chopping the chain down and deleting as much of this code as
possible seems a good thing.

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH v2 1/3] media: staging: atomisp: fix for sparse "using plain integer as NULL pointer" warnings.
  2017-11-29  0:04             ` Dan Carpenter
@ 2017-11-29  8:38               ` Jeremy Sowden
  2017-11-29 13:58                 ` Alan Cox
  2017-11-30 21:40                 ` [PATCH 0/3] Clean up of data-structure initialization in the CSS API Jeremy Sowden
  0 siblings, 2 replies; 53+ messages in thread
From: Jeremy Sowden @ 2017-11-29  8:38 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: devel, linux-media

[-- Attachment #1: Type: text/plain, Size: 3829 bytes --]

On 2017-11-29, at 03:04:53 +0300, Dan Carpenter wrote:
> On Tue, Nov 28, 2017 at 11:33:37PM +0000, Jeremy Sowden wrote:
> > On 2017-11-28, at 17:15:24 +0300, Dan Carpenter wrote:
> > > On Mon, Nov 27, 2017 at 12:44:48PM +0000, Jeremy Sowden wrote:
> > > > The "address" member of struct ia_css_host_data is a
> > > > pointer-to-char, so define default as NULL.
> > > >
> > > > --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
> > > > +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
> > > > @@ -95,7 +95,7 @@ union ia_css_all_memory_offsets {
> > > >  };
> > > >
> > > >  #define IA_CSS_DEFAULT_ISP_MEM_PARAMS \
> > > > -		{ { { { 0, 0 } } } }
> > > > +		{ { { { NULL, 0 } } } }
> > >
> > > This define is way ugly and instead of making superficial changes, you
> > > should try to eliminate it.
> > >
> > > People look at warnings as a bad thing but they are actually a
> > > valuable resource which call attention to bad code.  By making this
> > > change you're kind of wasting the warning.  The bad code is still
> > > there, it's just swept under the rug but like a dead mouse carcass
> > > it's still stinking up the living room.  We should leave the warning
> > > there until it irritates someone enough to fix it properly.
> >
> > Tracking down the offending initializer was definitely a pain.
> >
> > Compound literals with designated initializers would make this macro
> > (and a number of others) easier to understand and more type-safe:
> >
> >    #define IA_CSS_DEFAULT_ISP_MEM_PARAMS \
> >   -		{ { { { 0, 0 } } } }
> >   +	(struct ia_css_isp_param_host_segments) { \
> >   +		.params = { { \
> >   +			(struct ia_css_host_data) { \
> >   +				.address = NULL, \
> >   +				.size = 0 \
> >   +			} \
> >   +		} } \
> >   +	}
>
> Using designated initializers is good, yes.  Can't we just use an
> empty initializer since this is all zeroed memory anyway?
>
> 	(struct ia_css_isp_param_host_segments) { }
>
> I haven't tried it.

There are 35 defaults defined by macros like this, most of them much
more complicated that IA_CSS_DEFAULT_ISP_MEM_PARAMS, and a few members
are initialized to non-zero values.  My plan, therefore, is to convert
everything to use designated initializers, and then start removing the
zeroes afterwards.

> >
> > Unfortunately this default value is one end of a chain of default values
>
> Yeah.  A really long chain...
>
> > used to initialize members of default values of enclosing structs where
> > the outermost values are used to initialize some static variables:
> >
> >   static enum ia_css_err
> >   init_pipe_defaults(enum ia_css_pipe_mode mode,
> > 		     struct ia_css_pipe *pipe,
> > 		     bool copy_pipe)
> >   {
> >     static struct ia_css_pipe default_pipe = IA_CSS_DEFAULT_PIPE;
> >     static struct ia_css_preview_settings prev  = IA_CSS_DEFAULT_PREVIEW_SETTINGS;
> >     static struct ia_css_capture_settings capt  = IA_CSS_DEFAULT_CAPTURE_SETTINGS;
> >     static struct ia_css_video_settings   video = IA_CSS_DEFAULT_VIDEO_SETTINGS;
> >     static struct ia_css_yuvpp_settings   yuvpp = IA_CSS_DEFAULT_YUVPP_SETTINGS;
> >
> >     if (pipe == NULL) {
> >       IA_CSS_ERROR("NULL pipe parameter");
> >       return IA_CSS_ERR_INVALID_ARGUMENTS;
> >     }
> >
> >     /* Initialize pipe to pre-defined defaults */
> >     *pipe = default_pipe;
> >
> >     [...]
> >
> > I'm not convinced, however, that those variables actually achieve very
> > much.  If I change the code to assign the defaults directly, the problem
> > goes away:
> >
> >     [...]
> >
> > Does this seem reasonable or am I barking up the wrong tree?
>
> Yes.  Chopping the chain down and deleting as much of this code as
> possible seems a good thing.

I'll get chopping.

J.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH 3/3] media: staging: atomisp: prefer s16 to int16_t.
  2017-11-27 11:30 ` [PATCH 3/3] media: staging: atomisp: prefer s16 to int16_t Jeremy Sowden
@ 2017-11-29  8:47   ` Sakari Ailus
  0 siblings, 0 replies; 53+ messages in thread
From: Sakari Ailus @ 2017-11-29  8:47 UTC (permalink / raw)
  To: Jeremy Sowden; +Cc: linux-media, devel

On Mon, Nov 27, 2017 at 11:30:54AM +0000, Jeremy Sowden wrote:
> Signed-off-by: Jeremy Sowden <jeremy@azazel.net>

I'd just leave it as-is, int16_t is a standard type. The commit message
would be needed, too.

-- 
Sakari Ailus
e-mail: sakari.ailus@iki.fi

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH v2 0/3] Sparse fixes for the Atom ISP Staging Driver
  2017-11-28 10:27           ` [PATCH v2 0/3] Sparse fixes for the Atom ISP Staging Driver Jeremy Sowden
  2017-11-28 10:27             ` [PATCH v3 1/2] media: staging: atomisp: fix for sparse "using plain integer as NULL pointer" warnings Jeremy Sowden
  2017-11-28 10:27             ` [PATCH v3 2/2] media: staging: atomisp: fixes for "symbol was not declared. Should it be static?" sparse warnings Jeremy Sowden
@ 2017-11-29  8:48             ` Sakari Ailus
  2 siblings, 0 replies; 53+ messages in thread
From: Sakari Ailus @ 2017-11-29  8:48 UTC (permalink / raw)
  To: Jeremy Sowden; +Cc: linux-media, devel

On Tue, Nov 28, 2017 at 10:27:24AM +0000, Jeremy Sowden wrote:
> Fixed some sparse warnings in the Atom ISP staging driver.
> 
> This time with longer commit messages. :)
> 
> I've chosen to ignore checkpatch.pl's suggestion to change the types of
> the arrays in the second patch from int16_t to s16.
> 
> Jeremy Sowden (2):
>   media: staging: atomisp: fix for sparse "using plain integer as NULL
>     pointer" warnings.
>   media: staging: atomisp: fixes for "symbol was not declared. Should it
>     be static?" sparse warnings.
> 
>  .../isp/kernels/eed1_8/ia_css_eed1_8.host.c        | 24 +++++++++++-----------
>  .../isp_param/interface/ia_css_isp_param_types.h   |  2 +-
>  2 files changed, 13 insertions(+), 13 deletions(-)

Thanks, applied!

-- 
Sakari Ailus
e-mail: sakari.ailus@iki.fi

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH 2/3] media: staging: atomisp: defined as static some const arrays which don't need external linkage.
  2017-11-27 12:21   ` Greg KH
  2017-11-27 12:44     ` [PATCH v2 0/3] Sparse fixes for the Atom ISP Staging Driver Jeremy Sowden
@ 2017-11-29  9:08     ` Sakari Ailus
  2017-11-29  9:15       ` Greg KH
  1 sibling, 1 reply; 53+ messages in thread
From: Sakari Ailus @ 2017-11-29  9:08 UTC (permalink / raw)
  To: Greg KH; +Cc: Jeremy Sowden, linux-media, devel

Hi Greg,

On Mon, Nov 27, 2017 at 01:21:25PM +0100, Greg KH wrote:
> On Mon, Nov 27, 2017 at 11:30:53AM +0000, Jeremy Sowden wrote:
> > Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
> > ---
> >  .../isp/kernels/eed1_8/ia_css_eed1_8.host.c        | 24 +++++++++++-----------
> >  1 file changed, 12 insertions(+), 12 deletions(-)
> 
> I can never take patches without any changelog text, and so no one
> should write them that way :)

I've been applying the atomisp patches to my tree for some time now,
further on passing them to Mauro to be merged via the media tree. To avoid
conflicts, I suggest to avoid merging them via the staging tree.

Thanks.

-- 
Kind regards,

Sakari Ailus
e-mail: sakari.ailus@iki.fi

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH 2/3] media: staging: atomisp: defined as static some const arrays which don't need external linkage.
  2017-11-29  9:08     ` [PATCH 2/3] media: staging: atomisp: defined as static some const arrays which don't need external linkage Sakari Ailus
@ 2017-11-29  9:15       ` Greg KH
  2017-11-29  9:26         ` Sakari Ailus
  0 siblings, 1 reply; 53+ messages in thread
From: Greg KH @ 2017-11-29  9:15 UTC (permalink / raw)
  To: Sakari Ailus; +Cc: Jeremy Sowden, linux-media, devel

On Wed, Nov 29, 2017 at 11:08:17AM +0200, Sakari Ailus wrote:
> Hi Greg,
> 
> On Mon, Nov 27, 2017 at 01:21:25PM +0100, Greg KH wrote:
> > On Mon, Nov 27, 2017 at 11:30:53AM +0000, Jeremy Sowden wrote:
> > > Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
> > > ---
> > >  .../isp/kernels/eed1_8/ia_css_eed1_8.host.c        | 24 +++++++++++-----------
> > >  1 file changed, 12 insertions(+), 12 deletions(-)
> > 
> > I can never take patches without any changelog text, and so no one
> > should write them that way :)
> 
> I've been applying the atomisp patches to my tree for some time now,
> further on passing them to Mauro to be merged via the media tree. To avoid
> conflicts, I suggest to avoid merging them via the staging tree.

I'm not touching any of these patches, just commenting that patches
without changelogs should not be written :)

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH 2/3] media: staging: atomisp: defined as static some const arrays which don't need external linkage.
  2017-11-29  9:15       ` Greg KH
@ 2017-11-29  9:26         ` Sakari Ailus
  0 siblings, 0 replies; 53+ messages in thread
From: Sakari Ailus @ 2017-11-29  9:26 UTC (permalink / raw)
  To: Greg KH; +Cc: Jeremy Sowden, linux-media, devel

On Wed, Nov 29, 2017 at 10:15:06AM +0100, Greg KH wrote:
> On Wed, Nov 29, 2017 at 11:08:17AM +0200, Sakari Ailus wrote:
> > Hi Greg,
> > 
> > On Mon, Nov 27, 2017 at 01:21:25PM +0100, Greg KH wrote:
> > > On Mon, Nov 27, 2017 at 11:30:53AM +0000, Jeremy Sowden wrote:
> > > > Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
> > > > ---
> > > >  .../isp/kernels/eed1_8/ia_css_eed1_8.host.c        | 24 +++++++++++-----------
> > > >  1 file changed, 12 insertions(+), 12 deletions(-)
> > > 
> > > I can never take patches without any changelog text, and so no one
> > > should write them that way :)
> > 
> > I've been applying the atomisp patches to my tree for some time now,
> > further on passing them to Mauro to be merged via the media tree. To avoid
> > conflicts, I suggest to avoid merging them via the staging tree.
> 
> I'm not touching any of these patches, just commenting that patches
> without changelogs should not be written :)

Ack, just wanted to avoid potential mege conflicts. Thanks.

-- 
Kind regards,

Sakari Ailus
e-mail: sakari.ailus@iki.fi

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH v2 1/3] media: staging: atomisp: fix for sparse "using plain integer as NULL pointer" warnings.
  2017-11-29  8:38               ` Jeremy Sowden
@ 2017-11-29 13:58                 ` Alan Cox
  2017-11-30 21:40                 ` [PATCH 0/3] Clean up of data-structure initialization in the CSS API Jeremy Sowden
  1 sibling, 0 replies; 53+ messages in thread
From: Alan Cox @ 2017-11-29 13:58 UTC (permalink / raw)
  To: Jeremy Sowden; +Cc: Dan Carpenter, devel, linux-media

> There are 35 defaults defined by macros like this, most of them much
> more complicated that IA_CSS_DEFAULT_ISP_MEM_PARAMS, and a few members
> are initialized to non-zero values.  My plan, therefore, is to convert
> everything to use designated initializers, and then start removing the
> zeroes afterwards.

Where they are only used once in the tree it might be even cleaner to
just do


static struct foo = FOO_DEFAULT_BAR;

foo.x = 12;
foo.bar = &foo;

etc in the code.


Alan

^ permalink raw reply	[flat|nested] 53+ messages in thread

* [PATCH 0/3] Clean up of data-structure initialization in the CSS API
  2017-11-29  8:38               ` Jeremy Sowden
  2017-11-29 13:58                 ` Alan Cox
@ 2017-11-30 21:40                 ` Jeremy Sowden
  2017-11-30 21:40                   ` [PATCH 1/3] media: atomisp: convert default struct values to use compound-literals with designated initializers Jeremy Sowden
                                     ` (2 more replies)
  1 sibling, 3 replies; 53+ messages in thread
From: Jeremy Sowden @ 2017-11-30 21:40 UTC (permalink / raw)
  To: linux-media, devel; +Cc: Jeremy Sowden

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 made it
possible 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.

The designated initializers also allow the removal of lots of
struct-members initialized to zero values.

I made the changes in three stages: firstly, I converted the default
values to compound-literals and designated initializers and removed the
temporary variables; secondly, I removed the zero-valued struct-members;
finally, I removed some structs which had become empty.

Jeremy Sowden (3):
  media: atomisp: convert default struct values to use compound-literals
    with designated initializers.
  media: atomisp: delete zero-valued struct members.
  media: atomisp: delete empty default struct values.

 .../hive_isp_css_common/input_formatter_global.h   |  16 ---
 .../pci/atomisp2/css2400/ia_css_frame_public.h     |  29 ++----
 .../atomisp/pci/atomisp2/css2400/ia_css_pipe.h     | 110 +++++++--------------
 .../pci/atomisp2/css2400/ia_css_pipe_public.h      | 108 +++-----------------
 .../atomisp/pci/atomisp2/css2400/ia_css_types.h    |  64 +++---------
 .../isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h     |  50 +---------
 .../kernels/sdis/common/ia_css_sdis_common_types.h |  31 ++----
 .../isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c   |   3 +-
 .../runtime/binary/interface/ia_css_binary.h       |  88 ++---------------
 .../atomisp2/css2400/runtime/binary/src/binary.c   |   3 +-
 .../isp_param/interface/ia_css_isp_param_types.h   |  10 --
 .../runtime/pipeline/interface/ia_css_pipeline.h   |  24 ++---
 .../css2400/runtime/pipeline/src/pipeline.c        |   7 +-
 .../media/atomisp/pci/atomisp2/css2400/sh_css.c    |  31 ++----
 .../atomisp/pci/atomisp2/css2400/sh_css_legacy.h   |  11 ---
 .../atomisp/pci/atomisp2/css2400/sh_css_metrics.h  |  21 ----
 16 files changed, 114 insertions(+), 492 deletions(-)


base-commit: 37cb8e1f8e10c6e9bd2a1b95cdda0620a21b0551
-- 
2.15.0

^ permalink raw reply	[flat|nested] 53+ messages in thread

* [PATCH 1/3] media: atomisp: convert default struct values to use compound-literals with designated initializers.
  2017-11-30 21:40                 ` [PATCH 0/3] Clean up of data-structure initialization in the CSS API Jeremy Sowden
@ 2017-11-30 21:40                   ` Jeremy Sowden
  2017-12-01 15:07                     ` Dan Carpenter
  2017-11-30 21:40                   ` [PATCH 2/3] media: atomisp: delete zero-valued struct members Jeremy Sowden
  2017-11-30 21:40                   ` [PATCH 3/3] media: atomisp: delete empty default struct values Jeremy Sowden
  2 siblings, 1 reply; 53+ messages in thread
From: Jeremy Sowden @ 2017-11-30 21:40 UTC (permalink / raw)
  To: linux-media, devel; +Cc: Jeremy Sowden

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.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 .../hive_isp_css_common/input_formatter_global.h   |  25 ++--
 .../pci/atomisp2/css2400/ia_css_frame_public.h     |  46 ++++---
 .../atomisp/pci/atomisp2/css2400/ia_css_pipe.h     | 145 +++++++++++----------
 .../pci/atomisp2/css2400/ia_css_pipe_public.h      | 136 +++++++++----------
 .../atomisp/pci/atomisp2/css2400/ia_css_types.h    |  78 +++++------
 .../isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h     | 130 +++++++++++++-----
 .../kernels/sdis/common/ia_css_sdis_common_types.h |  85 +++++++++---
 .../isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c   |   3 +-
 .../runtime/binary/interface/ia_css_binary.h       | 140 ++++++++++----------
 .../atomisp2/css2400/runtime/binary/src/binary.c   |   3 +-
 .../isp_param/interface/ia_css_isp_param_types.h   |  19 ++-
 .../runtime/pipeline/interface/ia_css_pipeline.h   |  30 ++---
 .../css2400/runtime/pipeline/src/pipeline.c        |   7 +-
 .../media/atomisp/pci/atomisp2/css2400/sh_css.c    |  22 +---
 .../atomisp/pci/atomisp2/css2400/sh_css_legacy.h   |  16 +--
 .../atomisp/pci/atomisp2/css2400/sh_css_metrics.h  |  26 ++--
 16 files changed, 514 insertions(+), 397 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/input_formatter_global.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/input_formatter_global.h
index 5654d911db65..d5a586b08955 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/input_formatter_global.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/input_formatter_global.h
@@ -108,19 +108,20 @@ struct input_formatter_cfg_s {
 };
 
 #define DEFAULT_IF_CONFIG \
+(struct input_formatter_cfg_s) \
 { \
-	0,          /* start_line */\
-	0,          /* start_column */\
-	0,          /* left_padding */\
-	0,          /* cropped_height */\
-	0,          /* cropped_width */\
-	0,          /* deinterleaving */\
-	0,          /*.buf_vecs */\
-	0,          /* buf_start_index */\
-	0,          /* buf_increment */\
-	0,          /* buf_eol_offset */\
-	false,      /* is_yuv420_format */\
-	false       /* block_no_reqs */\
+	.start_line		= 0, \
+	.start_column		= 0, \
+	.left_padding		= 0, \
+	.cropped_height		= 0, \
+	.cropped_width		= 0, \
+	.deinterleaving		= 0, \
+	.buf_vecs		= 0, \
+	.buf_start_index	= 0, \
+	.buf_increment		= 0, \
+	.buf_eol_offset		= 0, \
+	.is_yuv420_format	= false, \
+	.block_no_reqs		= false \
 }
 
 extern const hrt_address HIVE_IF_SRST_ADDRESS[N_INPUT_FORMATTER_ID];
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_frame_public.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_frame_public.h
index 92f2389176b2..786585037af9 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_frame_public.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_frame_public.h
@@ -121,15 +121,19 @@ struct ia_css_frame_info {
 };
 
 #define IA_CSS_BINARY_DEFAULT_FRAME_INFO \
-{ \
-	{0,                      /* width */ \
-	 0},                     /* height */ \
-	0,                       /* padded_width */ \
-	IA_CSS_FRAME_FORMAT_NUM, /* format */ \
-	0,                       /* raw_bit_depth */ \
-	IA_CSS_BAYER_ORDER_NUM,  /* raw_bayer_order */ \
-	{0,                       /*start col */ \
-	 0},                       /*start line */ \
+(struct ia_css_frame_info) { \
+	.res			= (struct ia_css_resolution) { \
+					.width = 0, \
+					.height = 0 \
+				}, \
+	.padded_width		= 0, \
+	.format			= IA_CSS_FRAME_FORMAT_NUM,  \
+	.raw_bit_depth		= 0, \
+	.raw_bayer_order	= IA_CSS_BAYER_ORDER_NUM, \
+	.crop_info		= (struct ia_css_crop_info) { \
+					.start_column	= 0, \
+					.start_line	= 0 \
+				}, \
 }
 
 /**
@@ -190,18 +194,18 @@ struct ia_css_frame {
 };
 
 #define DEFAULT_FRAME \
-{ \
-	IA_CSS_BINARY_DEFAULT_FRAME_INFO,	/* info */ \
-	0,					/* data */ \
-	0,					/* data_bytes */ \
-	SH_CSS_INVALID_QUEUE_ID,		/* dynamic_data_index */ \
-	IA_CSS_BUFFER_TYPE_INVALID,			/* buf_type */ \
-	IA_CSS_FRAME_FLASH_STATE_NONE,		/* flash_state */ \
-	0,					/* exp_id */ \
-	0,					/* isp_config_id */ \
-	false,					/* valid */ \
-	false,					/* contiguous  */ \
-	{ 0 }					/* planes */ \
+(struct ia_css_frame) { \
+	.info			= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
+	.data			= 0, \
+	.data_bytes		= 0, \
+	.dynamic_queue_id	= SH_CSS_INVALID_QUEUE_ID, \
+	.buf_type		= IA_CSS_BUFFER_TYPE_INVALID, \
+	.flash_state		= IA_CSS_FRAME_FLASH_STATE_NONE, \
+	.exp_id			= 0, \
+	.isp_config_id		= 0, \
+	.valid			= false, \
+	.contiguous		= false, \
+	.planes			= { 0 } \
 }
 
 /** @brief Fill a frame with zeros
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h
index d0c0e6b92025..5d307679768e 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h
@@ -33,22 +33,22 @@ struct ia_css_preview_settings {
 	/* 2401 only for these two - do we in fact use them for anything real */
 	struct ia_css_frame *delay_frames[MAX_NUM_DELAY_FRAMES];
 	struct ia_css_frame *tnr_frames[NUM_TNR_FRAMES];
-	
+
 	struct ia_css_pipe *copy_pipe;
 	struct ia_css_pipe *capture_pipe;
 	struct ia_css_pipe *acc_pipe;
 };
 
 #define IA_CSS_DEFAULT_PREVIEW_SETTINGS \
-{ \
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* copy_binary */\
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* preview_binary */\
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* vf_pp_binary */\
-	{ NULL },			/* dvs_frames */ \
-	{ NULL },			/* tnr_frames */ \
-	NULL,				/* copy_pipe */\
-	NULL,				/* capture_pipe */\
-	NULL,				/* acc_pipe */\
+(struct ia_css_preview_settings) { \
+	.copy_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+	.preview_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+	.vf_pp_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+	.delay_frames	= { NULL }, \
+	.tnr_frames	= { NULL }, \
+	.copy_pipe	= NULL, \
+	.capture_pipe	= NULL, \
+	.acc_pipe	= NULL, \
 }
 
 struct ia_css_capture_settings {
@@ -70,20 +70,20 @@ struct ia_css_capture_settings {
 };
 
 #define IA_CSS_DEFAULT_CAPTURE_SETTINGS \
-{ \
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* copy_binary */\
-	{IA_CSS_BINARY_DEFAULT_SETTINGS},	/* primary_binary */\
-	0,				/* num_primary_stage */\
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* pre_isp_binary */\
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* anr_gdc_binary */\
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* post_isp_binary */\
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* capture_pp_binary */\
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* vf_pp_binary */\
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* capture_ldc_binary */\
-	NULL,				/* yuv_scaler_binary */ \
-	{ NULL },			/* delay_frames[ref_frames] */ \
-	NULL,				/* is_output_stage */ \
-	0,				/* num_yuv_scaler */ \
+(struct ia_css_capture_settings) { \
+	.copy_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+	.primary_binary		= {IA_CSS_BINARY_DEFAULT_SETTINGS}, \
+	.num_primary_stage	= 0, \
+	.pre_isp_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+	.anr_gdc_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+	.post_isp_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+	.capture_pp_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+	.vf_pp_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+	.capture_ldc_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+	.yuv_scaler_binary	= NULL, \
+	.delay_frames		= { NULL }, \
+	.is_output_stage	= NULL, \
+	.num_yuv_scaler		= 0, \
 }
 
 struct ia_css_video_settings {
@@ -105,18 +105,18 @@ struct ia_css_video_settings {
 };
 
 #define IA_CSS_DEFAULT_VIDEO_SETTINGS \
-{ \
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* copy_binary */ \
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* video_binary */ \
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* vf_pp_binary */ \
-	NULL,				/* yuv_scaler_binary */ \
-	{ NULL },			/* delay_frames */ \
-	{ NULL },			/* tnr_frames */ \
-	NULL,				/* vf_pp_in_frame */ \
-	NULL,				/* copy_pipe */ \
-	NULL,				/* capture_pipe */ \
-	NULL,				/* is_output_stage */ \
-	0,				/* num_yuv_scaler */ \
+(struct ia_css_video_settings) { \
+	.copy_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+	.video_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+	.vf_pp_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+	.yuv_scaler_binary	= NULL, \
+	.delay_frames		= { NULL }, \
+	.tnr_frames		= { NULL }, \
+	.vf_pp_in_frame		= NULL, \
+	.copy_pipe		= NULL, \
+	.capture_pipe		= NULL, \
+	.is_output_stage	= NULL, \
+	.num_yuv_scaler		= 0, \
 }
 
 struct ia_css_yuvpp_settings {
@@ -130,14 +130,15 @@ struct ia_css_yuvpp_settings {
 };
 
 #define IA_CSS_DEFAULT_YUVPP_SETTINGS \
+(struct ia_css_yuvpp_settings) \
 { \
-	IA_CSS_BINARY_DEFAULT_SETTINGS,		/* copy_binary */ \
-	NULL,					/* yuv_scaler_binary */ \
-	NULL,					/* vf_pp_binary */ \
-	NULL,					/* is_output_stage */ \
-	0,					/* num_yuv_scaler */ \
-	0,					/* num_vf_pp */ \
-	0,					/* num_output */ \
+	.copy_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+	.yuv_scaler_binary	= NULL, \
+	.vf_pp_binary		= NULL, \
+	.is_output_stage	= NULL, \
+	.num_yuv_scaler		= 0, \
+	.num_vf_pp		= 0, \
+	.num_output		= 0, \
 }
 
 struct osys_object;
@@ -185,35 +186,35 @@ struct ia_css_pipe {
 };
 
 #define IA_CSS_DEFAULT_PIPE \
-{ \
-	false,					/* stop_requested */ \
-	DEFAULT_PIPE_CONFIG,			/* config */ \
-	DEFAULT_PIPE_EXTRA_CONFIG,		/* extra_config */ \
-	DEFAULT_PIPE_INFO,			/* info */ \
-	IA_CSS_PIPE_ID_ACC,			/* mode (pipe_id) */ \
-	NULL,					/* shading_table */ \
-	DEFAULT_PIPELINE,			/* pipeline */ \
-	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* output_info */ \
-	IA_CSS_BINARY_DEFAULT_FRAME_INFO,	/* bds_output_info */ \
-	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* vf_output_info */ \
-	IA_CSS_BINARY_DEFAULT_FRAME_INFO,	/* out_yuv_ds_input_info */ \
-	IA_CSS_BINARY_DEFAULT_FRAME_INFO,	/* vf_yuv_ds_input_info */ \
-	NULL,					/* output_stage */ \
-	NULL,					/* vf_stage */ \
-	SH_CSS_BDS_FACTOR_1_00,			/* required_bds_factor */ \
-	1,					/* dvs_frame_delay */ \
-	0,					/* num_invalid_frames */ \
-	{true},					/* enable_viewfinder */ \
-	NULL,					/* stream */ \
-	DEFAULT_FRAME,				/* in_frame_struct */ \
-	DEFAULT_FRAME,				/* out_frame_struct */ \
-	DEFAULT_FRAME,				/* vf_frame_struct */ \
-	{ NULL },				/* continuous_frames */ \
-	{ NULL },				/* cont_md_buffers */ \
-	{ IA_CSS_DEFAULT_PREVIEW_SETTINGS },	/* pipe_settings */ \
-	0,					/* scaler_pp_lut */ \
-	NULL,					/* osys object */ \
-	PIPE_ENTRY_EMPTY_TOKEN,			/* pipe_num */\
+(struct ia_css_pipe) { \
+	.stop_requested		= false, \
+	.config			= DEFAULT_PIPE_CONFIG, \
+	.extra_config		= DEFAULT_PIPE_EXTRA_CONFIG, \
+	.info			= DEFAULT_PIPE_INFO, \
+	.mode			= IA_CSS_PIPE_ID_ACC, /* (pipe_id) */ \
+	.shading_table		= NULL, \
+	.pipeline		= DEFAULT_PIPELINE, \
+	.output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
+	.bds_output_info	= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
+	.vf_output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
+	.out_yuv_ds_input_info	= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
+	.vf_yuv_ds_input_info	= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
+	.output_stage		= NULL, \
+	.vf_stage		= NULL, \
+	.required_bds_factor	= SH_CSS_BDS_FACTOR_1_00, \
+	.dvs_frame_delay	= 1, \
+	.num_invalid_frames	= 0, \
+	.enable_viewfinder	= {true}, \
+	.stream			= NULL, \
+	.in_frame_struct	= DEFAULT_FRAME, \
+	.out_frame_struct	= DEFAULT_FRAME, \
+	.vf_frame_struct	= DEFAULT_FRAME, \
+	.continuous_frames	= { NULL }, \
+	.cont_md_buffers	= { NULL }, \
+	.pipe_settings		= { .preview = IA_CSS_DEFAULT_PREVIEW_SETTINGS }, \
+	.scaler_pp_lut		= 0, \
+	.osys_obj		= NULL, \
+	.pipe_num		= PIPE_ENTRY_EMPTY_TOKEN, \
 }
 
 void ia_css_pipe_map_queue(struct ia_css_pipe *pipe, bool map);
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe_public.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe_public.h
index 733e0ef3afe8..6012b44c9076 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe_public.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe_public.h
@@ -157,42 +157,44 @@ struct ia_css_pipe_config {
  * Default origin of internal frame positioned on shading table.
  */
 #define IA_CSS_PIPE_DEFAULT_INTERNAL_FRAME_ORIGIN_BQS_ON_SCTBL \
+(struct ia_css_coordinate)
 { \
-	0,					/* x [bqs] */ \
-	0					/* y [bqs] */ \
+	.x = 0, \
+	.y = 0 \
 }
 
 /**
  * Default settings for newly created pipe configurations.
  */
 #define DEFAULT_PIPE_CONFIG \
-{ \
-	IA_CSS_PIPE_MODE_PREVIEW,		/* mode */ \
-	1,					/* isp_pipe_version */ \
-	{ 0, 0 },				/* pipe_effective_input_res */ \
-	{ 0, 0 },				/* bayer_ds_out_res */ \
-	{ 0, 0 },				/* vf_pp_in_res */ \
-	{ 0, 0 },				/* capt_pp_in_res */ \
-	{ 0, 0 },				/* output_system_in_res */ \
-	{ 0, 0 },				/* dvs_crop_out_res */ \
-	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* output_info */ \
-	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* vf_output_info */ \
-	NULL,					/* acc_extension */ \
-	NULL,					/* acc_stages */ \
-	0,					/* num_acc_stages */ \
-	DEFAULT_CAPTURE_CONFIG,			/* default_capture_config */ \
-	{ 0, 0 },				/* dvs_envelope */ \
-	IA_CSS_FRAME_DELAY_1,			/* dvs_frame_delay */ \
-	-1,					/* acc_num_execs */ \
-	false,					/* enable_dz */ \
-	false,					/* enable_dpc */ \
-	false,					/* enable_vfpp_bci */ \
-	false,					/* enable_luma_only */ \
-	false,					/* enable_tnr */ \
-	NULL,					/* p_isp_config */\
-	{ 0, 0 },				/* gdc_in_buffer_res */ \
-	{ 0, 0 },				/* gdc_in_buffer_offset */ \
-	IA_CSS_PIPE_DEFAULT_INTERNAL_FRAME_ORIGIN_BQS_ON_SCTBL	/* internal_frame_origin_bqs_on_sctbl */ \
+(struct ia_css_pipe_config) { \
+	.mode			= IA_CSS_PIPE_MODE_PREVIEW, \
+	.isp_pipe_version	= 1, \
+	.input_effective_res	= { 0, 0 }, \
+	.bayer_ds_out_res	= { 0, 0 }, \
+	.capt_pp_in_res		= { 0, 0 }, \
+	.vf_pp_in_res		= { 0, 0 }, \
+	.output_system_in_res	= { 0, 0 }, \
+	.dvs_crop_out_res	= { 0, 0 }, \
+	.output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
+	.vf_output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
+	.acc_extension		= NULL, \
+	.acc_stages		= NULL, \
+	.num_acc_stages		= 0, \
+	.default_capture_config	= DEFAULT_CAPTURE_CONFIG, \
+	.dvs_envelope		= { 0, 0 }, \
+	.dvs_frame_delay	= IA_CSS_FRAME_DELAY_1, \
+	.acc_num_execs		= -1, \
+	.enable_dz		= false, \
+	.enable_dpc		= false, \
+	.enable_vfpp_bci	= false, \
+	.enable_luma_only	= false, \
+	.enable_tnr		= false, \
+	.p_isp_config		= NULL, \
+	.gdc_in_buffer_res	= { 0, 0 }, \
+	.gdc_in_buffer_offset	= { 0, 0 }, \
+	.internal_frame_origin_bqs_on_sctbl \
+				= IA_CSS_PIPE_DEFAULT_INTERNAL_FRAME_ORIGIN_BQS_ON_SCTBL \
 }
 
 #else
@@ -201,29 +203,29 @@ struct ia_css_pipe_config {
  * Default settings for newly created pipe configurations.
  */
 #define DEFAULT_PIPE_CONFIG \
-{ \
-	IA_CSS_PIPE_MODE_PREVIEW,		/* mode */ \
-	1,					/* isp_pipe_version */ \
-	{ 0, 0 },				/* pipe_effective_input_res */ \
-	{ 0, 0 },				/* bayer_ds_out_res */ \
-	{ 0, 0 },				/* vf_pp_in_res */ \
-	{ 0, 0 },				/* capt_pp_in_res */ \
-	{ 0, 0 },				/* dvs_crop_out_res */ \
-	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* output_info */ \
-	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* vf_output_info */ \
-	NULL,					/* acc_extension */ \
-	NULL,					/* acc_stages */ \
-	0,					/* num_acc_stages */ \
-	DEFAULT_CAPTURE_CONFIG,			/* default_capture_config */ \
-	{ 0, 0 },				/* dvs_envelope */ \
-	IA_CSS_FRAME_DELAY_1,			/* dvs_frame_delay */ \
-	-1,					/* acc_num_execs */ \
-	false,					/* enable_dz */ \
-	false,					/* enable_dpc */ \
-	false,					/* enable_vfpp_bci */ \
-	NULL,					/* p_isp_config */\
-	{ 0, 0 },				/* gdc_in_buffer_res */ \
-	{ 0, 0 }				/* gdc_in_buffer_offset */ \
+(struct ia_css_pipe_config) { \
+	.mode			= IA_CSS_PIPE_MODE_PREVIEW, \
+	.isp_pipe_version	= 1, \
+	.input_effective_res	= { 0, 0 }, \
+	.bayer_ds_out_res	= { 0, 0 }, \
+	.capt_pp_in_res		= { 0, 0 }, \
+	.vf_pp_in_res		= { 0, 0 }, \
+	.dvs_crop_out_res	= { 0, 0 }, \
+	.output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
+	.vf_output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
+	.acc_extension		= NULL, \
+	.acc_stages		= NULL, \
+	.num_acc_stages		= 0, \
+	.default_capture_config	= DEFAULT_CAPTURE_CONFIG, \
+	.dvs_envelope		= { 0, 0 }, \
+	.dvs_frame_delay	= IA_CSS_FRAME_DELAY_1, \
+	.acc_num_execs		= -1, \
+	.enable_dz		= false, \
+	.enable_dpc		= false, \
+	.enable_vfpp_bci	= false, \
+	.p_isp_config		= NULL, \
+	.gdc_in_buffer_res	= { 0, 0 }, \
+	.gdc_in_buffer_offset	= { 0, 0 } \
 }
 
 #endif
@@ -275,26 +277,26 @@ struct ia_css_pipe_info {
 #ifdef ISP2401
 
 #define DEFAULT_PIPE_INFO \
-{ \
-	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* output_info */ \
-	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* vf_output_info */ \
-	IA_CSS_BINARY_DEFAULT_FRAME_INFO,	/* raw_output_info */ \
-	{ 0, 0},				/* output system in res */ \
-	DEFAULT_SHADING_INFO,			/* shading_info */ \
-	DEFAULT_GRID_INFO,			/* grid_info */ \
-	0					/* num_invalid_frames */ \
+(struct ia_css_pipe_info) { \
+	.output_info			= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
+	.vf_output_info			= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
+	.raw_output_info		= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
+	.output_system_in_res_info	= { 0, 0 }, \
+	.shading_info			= DEFAULT_SHADING_INFO, \
+	.grid_info			= DEFAULT_GRID_INFO, \
+	.num_invalid_frames		= 0 \
 }
 
 #else
 
 #define DEFAULT_PIPE_INFO \
-{ \
-	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* output_info */ \
-	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* vf_output_info */ \
-	IA_CSS_BINARY_DEFAULT_FRAME_INFO,	/* raw_output_info */ \
-	DEFAULT_SHADING_INFO,			/* shading_info */ \
-	DEFAULT_GRID_INFO,			/* grid_info */ \
-	0					/* num_invalid_frames */ \
+(struct ia_css_pipe_info) { \
+	.output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
+	.vf_output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
+	.raw_output_info	= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
+	.shading_info		= DEFAULT_SHADING_INFO, \
+	.grid_info		= DEFAULT_GRID_INFO, \
+	.num_invalid_frames	= 0 \
 }
 
 #endif
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h
index 5fec3d5c89d8..584eb3fb1f47 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h
@@ -374,20 +374,20 @@ struct ia_css_shading_info {
 
 /** Default Shading Correction information of Shading Correction Type 1. */
 #define DEFAULT_SHADING_INFO_TYPE_1 \
-{ \
-	IA_CSS_SHADING_CORRECTION_TYPE_1,	/* type */ \
-	{					/* info */ \
-		{ \
-			0,	/* enable */ \
-			0,	/* num_hor_grids */ \
-			0,	/* num_ver_grids */ \
-			0,	/* bqs_per_grid_cell */ \
-			1,	/* bayer_scale_hor_ratio_in */ \
-			1,	/* bayer_scale_hor_ratio_out */ \
-			1,	/* bayer_scale_ver_ratio_in */ \
-			1,	/* bayer_scale_ver_ratio_out */ \
-			0,	/* sc_bayer_origin_x_bqs_on_shading_table */ \
-			0	/* sc_bayer_origin_y_bqs_on_shading_table */ \
+(struct ia_css_shading_info) { \
+	.type = IA_CSS_SHADING_CORRECTION_TYPE_1, \
+	.info = { \
+		.type_1 = { \
+			.enable					= 0, \
+			.num_hor_grids				= 0, \
+			.num_ver_grids				= 0, \
+			.bqs_per_grid_cell			= 0, \
+			.bayer_scale_hor_ratio_in		= 1, \
+			.bayer_scale_hor_ratio_out		= 1, \
+			.bayer_scale_ver_ratio_in		= 1, \
+			.bayer_scale_ver_ratio_out		= 1, \
+			.sc_bayer_origin_x_bqs_on_shading_table	= 0, \
+			.sc_bayer_origin_y_bqs_on_shading_table	= 0 \
 		} \
 	} \
 }
@@ -396,20 +396,20 @@ struct ia_css_shading_info {
 
 /** Default Shading Correction information of Shading Correction Type 1. */
 #define DEFAULT_SHADING_INFO_TYPE_1 \
-{ \
-	IA_CSS_SHADING_CORRECTION_TYPE_1,	/* type */ \
-	{					/* info */ \
-		{ \
-			0,			/* num_hor_grids */ \
-			0,			/* num_ver_grids */ \
-			0,			/* bqs_per_grid_cell */ \
-			1,			/* bayer_scale_hor_ratio_in */ \
-			1,			/* bayer_scale_hor_ratio_out */ \
-			1,			/* bayer_scale_ver_ratio_in */ \
-			1,			/* bayer_scale_ver_ratio_out */ \
-			{0, 0},			/* isp_input_sensor_data_res_bqs */ \
-			{0, 0},			/* sensor_data_res_bqs */ \
-			{0, 0}			/* sensor_data_origin_bqs_on_sctbl */ \
+(struct ia_css_shading_info) { \
+	.type = IA_CSS_SHADING_CORRECTION_TYPE_1, \
+	.info = { \
+		.type_1 = { \
+			.num_hor_grids				= 0, \
+			.num_ver_grids				= 0, \
+			.bqs_per_grid_cell			= 0, \
+			.bayer_scale_hor_ratio_in		= 1, \
+			.bayer_scale_hor_ratio_out		= 1, \
+			.bayer_scale_ver_ratio_in		= 1, \
+			.bayer_scale_ver_ratio_out		= 1, \
+			.isp_input_sensor_data_res_bqs		= {0, 0}, \
+			.sensor_data_res_bqs			= {0, 0}, \
+			.sensor_data_origin_bqs_on_sctbl	= {0, 0} \
 		} \
 	} \
 }
@@ -438,12 +438,12 @@ struct ia_css_grid_info {
 
 /** defaults for ia_css_grid_info structs */
 #define DEFAULT_GRID_INFO \
-{ \
-	0,				/* isp_in_width */ \
-	0,				/* isp_in_height */ \
-	DEFAULT_3A_GRID_INFO,		/* s3a_grid */ \
-	DEFAULT_DVS_GRID_INFO,		/* dvs_grid */ \
-	IA_CSS_VAMEM_TYPE_1		/* vamem_type */ \
+(struct ia_css_grid_info) { \
+	.isp_in_width	= 0, \
+	.isp_in_height	= 0, \
+	.s3a_grid	= DEFAULT_3A_GRID_INFO, \
+	.dvs_grid	= DEFAULT_DVS_GRID_INFO, \
+	.vamem_type	= IA_CSS_VAMEM_TYPE_1 \
 }
 
 /** Morphing table, used for geometric distortion and chromatic abberration
@@ -534,11 +534,11 @@ struct ia_css_capture_config {
 
 /** default settings for ia_css_capture_config structs */
 #define DEFAULT_CAPTURE_CONFIG \
-{ \
-	IA_CSS_CAPTURE_MODE_PRIMARY,	/* mode (capture) */ \
-	false,				/* enable_xnr */ \
-	false,				/* enable_raw_output */ \
-	false				/* enable_capture_pp_bli */ \
+(struct ia_css_capture_config) { \
+	.mode			= IA_CSS_CAPTURE_MODE_PRIMARY, \
+	.enable_xnr		= false, \
+	.enable_raw_output	= false, \
+	.enable_capture_pp_bli	= false \
 }
 
 
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h
index f57ed1ec5981..1975834dd927 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h
@@ -28,7 +28,7 @@
 /** 3A configuration. This configures the 3A statistics collection
  *  module.
  */
- 
+
 /** 3A statistics grid
  *
  *  ISP block: S3A1 (3A Support for 3A ver.1 (Histogram is not used for AE))
@@ -54,7 +54,7 @@ struct ia_css_3a_grid_info {
   	uint32_t awb_fr_enable;					/**< awb_fr enabled in binary,
 								   0:disabled, 1:enabled */
 	struct awb_fr_public_grid_config	awb_fr_grd_info;/**< see description in awb_fr_public.h*/
-  
+
         uint32_t elem_bit_depth;    /**< TODO:Taken from BYT  - need input from AIQ
 					if needed for SKC
 					Bit depth of element used
@@ -101,45 +101,113 @@ struct ia_css_3a_grid_info {
 #if defined(SYSTEM_css_skycam_c0_system)
 #if defined USE_NEW_AE_STRUCT || defined USE_NEW_AWB_STRUCT
 #define DEFAULT_3A_GRID_INFO \
-{ \
-	0,				/* ae_enable */ \
-	{0,0,0,0,0,0,0},	        /* AE:     width,height,b_width,b_height,x_start,y_start*/ \
-	0,				/* awb_enable */ \
-	{0,0,0,0,0,0},			/* AWB:    width,height,b_width,b_height,x_start,y_start*/ \
-	0,				/* af_enable */ \
-	{0,0,0,0,0,0,0},		/* AF:     width,height,b_width,b_height,x_start,y_start,ff_en*/ \
-	0,				/* awb_fr_enable */ \
-	{0,0,0,0,0,0,0},                  /* AWB_FR: width,height,b_width,b_height,x_start,y_start,ff_en*/ \
-	0,				/* elem_bit_depth */ \
+(struct ia_css_3a_grid_info) { \
+	.ae_enable		= 0, \
+	.ae_grd_info		= (struct ae_public_config_grid_config) { \
+					width = 0, \
+					height = 0, \
+					b_width = 0, \
+					b_height = 0, \
+					x_start = 0, \
+					y_start = 0, \
+					x_end = 0, \
+					y_end = 0 \
+			          } \
+	.awb_enable		= 0, \
+	.awb_grd_info		= (struct awb_public_config_grid_config) { \
+					width = 0, \
+					height = 0, \
+					b_width = 0, \
+					b_height = 0, \
+					x_start = 0, \
+					y_start = 0, \
+					x_end = 0, \
+					y_end = 0 \
+			          }	\
+	.af_enable		= 0, \
+	.af_grd_info		= (struct af_public_grid_config) { \
+					width = 0, \
+					height = 0, \
+					b_width = 0, \
+					b_height = 0, \
+					x_start = 0, \
+					y_start = 0, \
+					ff_en = 0 \
+				  } \
+	.awb_fr_enable		= 0, \
+	.awb_fr_grd_info	= (struct awb_fr_public_grid_config) { \
+					width = 0, \
+					height = 0, \
+					b_width = 0, \
+					b_height = 0, \
+					x_start = 0, \
+					y_start = 0, \
+					ff_en = 0 \
+				  } \
+	.elem_bit_depth		= 0, \
 }
 #else
 #define DEFAULT_3A_GRID_INFO \
 { \
-	0,				/* ae_enable */ \
-	{0,0,0,0,0,0,0,0,0},	        /* AE:     width,height,b_width,b_height,x_start,y_start,x_end,y_end*/ \
-	0,				/* awb_enable */ \
-	{0,0,0,0,0,0,0,0},              /* AWB:    width,height,b_width,b_height,x_start,y_start,x_end,y_end*/ \
-	0,				/* af_enable */ \
-	{0,0,0,0,0,0,0},		/* AF:     width,height,b_width,b_height,x_start,y_start,ff_en*/ \
-	0,				/* awb_fr_enable */ \
-	{0,0,0,0,0,0,0},                  /* AWB_FR: width,height,b_width,b_height,x_start,y_start,ff_en*/ \
-	0,				/* elem_bit_depth */ \
+	.ae_enable		= 0, \
+	.ae_grd_info		= (struct ae_public_config_grid_config) { \
+					width = 0, \
+					height = 0, \
+					b_width = 0, \
+					b_height = 0, \
+					x_start = 0, \
+					y_start = 0, \
+					x_end = 0, \
+					y_end = 0 \
+			          } \
+	.awb_enable		= 0, \
+	.awb_grd_info		= (struct awb_public_config_grid_config) { \
+					width = 0, \
+					height = 0, \
+					b_width = 0, \
+					b_height = 0, \
+					x_start = 0, \
+					y_start = 0, \
+					x_end = 0, \
+					y_end = 0 \
+			          }	\
+	.af_enable		= 0, \
+	.af_grd_info		= (struct af_public_grid_config) { \
+					width = 0, \
+					height = 0, \
+					b_width = 0, \
+					b_height = 0, \
+					x_start = 0, \
+					y_start = 0, \
+					ff_en = 0 \
+				  } \
+	.awb_fr_enable		= 0, \
+	.awb_fr_grd_info	= (struct awb_fr_public_grid_config) { \
+					width = 0, \
+					height = 0, \
+					b_width = 0, \
+					b_height = 0, \
+					x_start = 0, \
+					y_start = 0, \
+					ff_en = 0 \
+				  } \
+	.elem_bit_depth		= 0, \
 }
 #endif /* USE_NEW_AE_STRUCT || defined USE_NEW_AWB_STRUCT */
 
 #else
 #define DEFAULT_3A_GRID_INFO \
 { \
-	0,				/* enable */ \
-	0,				/* use_dmem */ \
-	0,				/* has_histogram */ \
-	0,				/* width */ \
-	0,				/* height */ \
-	0,				/* aligned_width */ \
-	0,				/* aligned_height */ \
-	0,				/* bqs_per_grid_cell */ \
-	0,				/* deci_factor_log2 */ \
-	0,				/* elem_bit_depth */ \
+	.enable			= 0, \
+	.use_dmem		= 0, \
+	.has_histogram		= 0, \
+	.width			= 0, \
+	.height			= 0, \
+	.aligned_width		= 0, \
+	.aligned_height		= 0, \
+	.bqs_per_grid_cell	= 0, \
+	.deci_factor_log2	= 0, \
+	.elem_bit_depth		= 0, \
 }
 
 #endif
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h
index 295dc60b778c..bcb1060e5ce0 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h
@@ -42,18 +42,21 @@ struct ia_css_sdis_info {
 };
 
 #define IA_CSS_DEFAULT_SDIS_INFO \
-	{	\
-		{	{ 0, 0 },	/* dim */ \
-			{ 0, 0 },	/* pad */ \
-		},	/* grid */ \
-		{	{ 0, 0 },	/* dim */ \
-			{ 0, 0 },	/* pad */ \
-		},	/* coef */ \
-		{	{ 0, 0 },	/* dim */ \
-			{ 0, 0 },	/* pad */ \
-		},	/* proj */ \
-		0,	/* dis_deci_factor_log2 */ \
-	}
+(struct ia_css_sdis_info) { \
+	.grid = { \
+		.dim = (struct ia_css_dvs_grid_dim) { .width = 0, .height = 0 }, \
+		.pad = (struct ia_css_dvs_grid_dim) { .width = 0, .height = 0 }, \
+	}, \
+	.coef = { \
+		.dim = (struct ia_css_dvs_grid_dim) { .width = 0, .height = 0 }, \
+		.pad = (struct ia_css_dvs_grid_dim) { .width = 0, .height = 0 }, \
+	}, \
+	.proj = { \
+		.dim = (struct ia_css_dvs_grid_dim) { .width = 0, .height = 0 }, \
+		.pad = (struct ia_css_dvs_grid_dim) { .width = 0, .height = 0 }, \
+	}, \
+	.deci_factor_log2 = 0, \
+}
 
 /** DVS statistics grid
  *
@@ -209,15 +212,59 @@ struct ia_css_dvs_stat_grid_info {
 
 /** DVS statistics generated by accelerator default grid info
  */
-#define DEFAULT_DVS_GRID_INFO { \
-{ \
-	{ 0, 0, 0},	/* GBL CFG reg: kappa, match_shifrt, binning mode*/ \
-	{{{0, 0, 0, 0}, {0, 0, 0}, {0, 0} }, \
-	{{0, 0, 0, 0}, {0, 0, 0}, {0, 0} }, \
-	{{0, 0, 0, 0}, {0, 0, 0}, {0, 0} } }, \
-	{{0, 0, 0, 0}, {4, 0, 0, 0}, {0, 0, 0, 0} } } \
+#define DEFAULT_DVS_STAT_PUBLIC_DVS_GLOBAL_CFG \
+(struct dvs_stat_public_dvs_global_cfg) { \
+	.kappa		= 0, \
+	.match_shift	= 0, \
+	.ybin_mode	= 0, \
+}
+
+#define DEFAULT_DVS_STAT_PUBLIC_DVS_GRD_CFG \
+(struct dvs_stat_public_dvs_grd_cfg) { \
+	.grd_cfg	= (struct dvs_stat_public_dvs_level_grid_cfg) { \
+				.grid_width = 0, \
+				.grid_height = 0, \
+				.block_width = 0, \
+				.block_height = 0 \
+			}, \
+	.grd_start	= (struct dvs_stat_public_dvs_level_grid_start) { \
+				.x_start = 0, \
+				.y_start = 0, \
+				.enable = 0 \
+			}, \
+	.grd_end	= (struct dvs_stat_public_dvs_level_grid_end) { \
+				.x_end = 0, \
+				.y_end = 0, \
+			}, \
+}
+
+#define DEFAULT_DVS_STAT_PUBLIC_DVS_LEVEL_FE_ROI_CFG(X_START) \
+(struct dvs_stat_public_dvs_level_fe_roi_cfg) { \
+	.x_start = X_START, \
+	.y_start = 0, \
+	.x_end   = 0, \
+	.y_end   = 0, \
+}
+
+#define DEFAULT_DVS_STAT_GRID_INFO \
+(struct ia_css_dvs_stat_grid_info) { \
+	.dvs_gbl_cfg = DEFAULT_DVS_STAT_PUBLIC_DVS_GLOBAL_CFG, \
+	.grd_cfg = { \
+		DEFAULT_DVS_STAT_PUBLIC_DVS_GRD_CFG, \
+		DEFAULT_DVS_STAT_PUBLIC_DVS_GRD_CFG, \
+		DEFAULT_DVS_STAT_PUBLIC_DVS_GRD_CFG \
+	}, \
+	.fe_roi_cfg = { \
+		DEFAULT_DVS_STAT_PUBLIC_DVS_LEVEL_FE_ROI_CFG(0), \
+		DEFAULT_DVS_STAT_PUBLIC_DVS_LEVEL_FE_ROI_CFG(4), \
+		DEFAULT_DVS_STAT_PUBLIC_DVS_LEVEL_FE_ROI_CFG(0), \
+	} \
 }
 
+#define DEFAULT_DVS_GRID_INFO \
+(union ia_css_dvs_grid_u) { \
+	.dvs_stat_grid_info = DEFAULT_DVS_STAT_GRID_INFO, \
+}
 
 /** Union that holds all types of DVS statistics grid info in
  *  CSS format
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c
index 9478c12abe89..e45a3c3fcf4a 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c
@@ -169,8 +169,7 @@ ia_css_sdis_init_info(
 	unsigned enabled)
 {
 	if (!enabled) {
-		struct ia_css_sdis_info default_dis = IA_CSS_DEFAULT_SDIS_INFO;
-		*dis = default_dis;
+		*dis = IA_CSS_DEFAULT_SDIS_INFO;
 		return;
 	}
 
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 c65194619a34..2bcb19b21714 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
@@ -94,14 +94,14 @@ struct ia_css_cas_binary_descr {
 };
 
 #define IA_CSS_DEFAULT_CAS_BINARY_DESCR \
-{ \
-	0,		\
-	0,		\
-	NULL,		\
-	NULL,		\
-	NULL,		\
-	NULL,		\
-	NULL,		\
+(struct ia_css_cas_binary_descr) {	\
+	.num_stage		= 0,	\
+	.num_output_stage	= 0,	\
+	.in_info		= NULL,	\
+	.internal_out_info	= NULL,	\
+	.out_info		= NULL,	\
+	.vf_info		= NULL,	\
+	.is_output_stage	= NULL,	\
 }
 
 struct ia_css_binary_descr {
@@ -174,73 +174,73 @@ struct ia_css_binary {
 #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) { \
+	.info				= NULL, \
+	.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}, \
+	.effective_in_frame_res		= { 0, 0 }, \
+	.vf_frame_info			= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
+	.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		= 0, \
+	.dis				= IA_CSS_DEFAULT_SDIS_INFO, \
+	.dvs_envelope			= { 0, 0 }, \
+	.online				= false, \
+	.uds_xc				= 0, \
+	.uds_yc				= 0, \
+	.left_padding			= 0, \
+	.metrics			= DEFAULT_BINARY_METRICS, \
+	.mem_params			= IA_CSS_DEFAULT_ISP_MEM_PARAMS, \
+	.css_params			= IA_CSS_DEFAULT_ISP_CSS_PARAMS, \
 }
 
 #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 */ \
+(struct ia_css_binary) { \
+	.info				= NULL, \
+	.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}, \
+	.effective_in_frame_res		= { 0, 0 }, \
+	.vf_frame_info			= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
+	.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, \
+	.dis				= IA_CSS_DEFAULT_SDIS_INFO, \
+	.dvs_envelope			= { 0, 0 }, \
+	.online				= false, \
+	.uds_xc				= 0, \
+	.uds_yc				= 0, \
+	.left_padding			= 0, \
+	.metrics			= DEFAULT_BINARY_METRICS, \
+	.mem_params			= IA_CSS_DEFAULT_ISP_MEM_PARAMS, \
+	.css_params			= IA_CSS_DEFAULT_ISP_CSS_PARAMS, \
 }
 
 #endif
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/binary/src/binary.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/binary/src/binary.c
index 9f8a125f0d74..934cfab60530 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/binary/src/binary.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/binary/src/binary.c
@@ -490,7 +490,6 @@ ia_css_binary_get_shading_info_type_1(const struct ia_css_binary *binary,	/* [in
 	struct sh_css_shading_table_bayer_origin_compute_results res;
 #else
 	struct sh_css_binary_sc_requirements scr;
-	struct ia_css_shading_info default_shading_info_type_1 = DEFAULT_SHADING_INFO_TYPE_1;
 #endif
 
 #ifndef ISP2401
@@ -542,7 +541,7 @@ ia_css_binary_get_shading_info_type_1(const struct ia_css_binary *binary,	/* [in
 		&res);
 	if (err != IA_CSS_SUCCESS)
 #else
-	*shading_info = default_shading_info_type_1;
+	*shading_info = DEFAULT_SHADING_INFO_TYPE_1;
 
 	err = sh_css_binary_get_sc_requirements(binary, required_bds_factor, stream_config, &scr);
 	if (err != IA_CSS_SUCCESS) {
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
index 8e651b80345a..cda540c012e7 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
@@ -95,13 +95,24 @@ union ia_css_all_memory_offsets {
 };
 
 #define IA_CSS_DEFAULT_ISP_MEM_PARAMS \
-		{ { { { 0, 0 } } } }
+	(struct ia_css_isp_param_host_segments) { \
+		.params = { { \
+			(struct ia_css_host_data) { .address = NULL, .size = 0 } \
+		} } \
+	}
 
 #define IA_CSS_DEFAULT_ISP_CSS_PARAMS \
-		{ { { { 0, 0 } } } }
+	(struct ia_css_isp_param_css_segments) { \
+		.params = { { \
+			(struct ia_css_data) { .address = 0, .size = 0 } \
+		} } \
+	}
 
 #define IA_CSS_DEFAULT_ISP_ISP_PARAMS \
-		{ { { { 0, 0 } } } }
+	(struct ia_css_isp_param_isp_segments) { \
+		.params = { { \
+			(struct ia_css_isp_data) { .address = 0, .size = 0 } \
+		} } \
+	}
 
 #endif /* _IA_CSS_ISP_PARAM_TYPES_H_ */
-
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/interface/ia_css_pipeline.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/interface/ia_css_pipeline.h
index 90646f5f8885..da74440d826d 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/interface/ia_css_pipeline.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/interface/ia_css_pipeline.h
@@ -74,21 +74,21 @@ struct ia_css_pipeline {
 };
 
 #define DEFAULT_PIPELINE \
-{ \
-	IA_CSS_PIPE_ID_PREVIEW, /* pipe_id */ \
-	0,			/* pipe_num */ \
-	false,			/* stop_requested */ \
-	NULL,                   /* stages */ \
-	NULL,                   /* current_stage */ \
-	0,                      /* num_stages */ \
-	DEFAULT_FRAME,          /* in_frame */ \
-	{DEFAULT_FRAME},          /* out_frame */ \
-	{DEFAULT_FRAME},          /* vf_frame */ \
-	IA_CSS_FRAME_DELAY_1,   /* frame_delay */ \
-	0,                      /* inout_port_config */ \
-	-1,                     /* num_execs */ \
-	true,					/* acquire_isp_each_stage */\
-	QOS_INVALID             /* pipe_qos_config */\
+(struct ia_css_pipeline) { \
+	.pipe_id		= IA_CSS_PIPE_ID_PREVIEW, \
+	.pipe_num		= 0, \
+	.stop_requested		= false, \
+	.stages			= NULL, \
+	.current_stage		= NULL, \
+	.num_stages		= 0, \
+	.in_frame		= DEFAULT_FRAME, \
+	.out_frame		= {DEFAULT_FRAME}, \
+	.vf_frame		= {DEFAULT_FRAME}, \
+	.dvs_frame_delay	= IA_CSS_FRAME_DELAY_1, \
+	.inout_port_config	= 0, \
+	.num_execs		= -1, \
+	.acquire_isp_each_stage	= true, \
+	.pipe_qos_config	= QOS_INVALID \
 }
 
 /* Stage descriptor used to create a new stage in the pipeline */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/src/pipeline.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/src/pipeline.c
index 95542fc82217..9e74df951d6a 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/src/pipeline.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/src/pipeline.c
@@ -692,17 +692,16 @@ static void pipeline_init_defaults(
 	unsigned int pipe_num,
 	unsigned int dvs_frame_delay)
 {
-	struct ia_css_frame init_frame = DEFAULT_FRAME;
 	unsigned int i;
 
 	pipeline->pipe_id = pipe_id;
 	pipeline->stages = NULL;
 	pipeline->stop_requested = false;
 	pipeline->current_stage = NULL;
-	pipeline->in_frame = init_frame;
+	pipeline->in_frame = DEFAULT_FRAME;
 	for (i = 0; i < IA_CSS_PIPE_MAX_OUTPUT_STAGE; i++) {
-		pipeline->out_frame[i] = init_frame;
-		pipeline->vf_frame[i] = init_frame;
+		pipeline->out_frame[i] = DEFAULT_FRAME;
+		pipeline->vf_frame[i] = DEFAULT_FRAME;
 	}
 	pipeline->num_execs = -1;
 	pipeline->acquire_isp_each_stage = true;
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
index e882b5596813..9439d643fd03 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
@@ -112,8 +112,6 @@ static int thread_alive;
 #define STATS_ENABLED(stage) (stage && stage->binary && stage->binary->info && \
         (stage->binary->info->sp.enable.s3a || stage->binary->info->sp.enable.dis))
 
-#define DEFAULT_PLANES { {0, 0, 0, 0} }
-
 struct sh_css my_css;
 
 int (*sh_css_printf) (const char *fmt, va_list args) = NULL;
@@ -2293,25 +2291,19 @@ init_pipe_defaults(enum ia_css_pipe_mode mode,
 	       struct ia_css_pipe *pipe,
 	       bool copy_pipe)
 {
-	static struct ia_css_pipe default_pipe = IA_CSS_DEFAULT_PIPE;
-	static struct ia_css_preview_settings prev  = IA_CSS_DEFAULT_PREVIEW_SETTINGS;
-	static struct ia_css_capture_settings capt  = IA_CSS_DEFAULT_CAPTURE_SETTINGS;
-	static struct ia_css_video_settings   video = IA_CSS_DEFAULT_VIDEO_SETTINGS;
-	static struct ia_css_yuvpp_settings   yuvpp = IA_CSS_DEFAULT_YUVPP_SETTINGS;
-
 	if (pipe == NULL) {
 		IA_CSS_ERROR("NULL pipe parameter");
 		return IA_CSS_ERR_INVALID_ARGUMENTS;
 	}
 
 	/* Initialize pipe to pre-defined defaults */
-	*pipe = default_pipe;
+	*pipe = IA_CSS_DEFAULT_PIPE;
 
 	/* TODO: JB should not be needed, but temporary backward reference */
 	switch (mode) {
 	case IA_CSS_PIPE_MODE_PREVIEW:
 		pipe->mode = IA_CSS_PIPE_ID_PREVIEW;
-		pipe->pipe_settings.preview = prev;
+		pipe->pipe_settings.preview = IA_CSS_DEFAULT_PREVIEW_SETTINGS;
 		break;
 	case IA_CSS_PIPE_MODE_CAPTURE:
 		if (copy_pipe) {
@@ -2319,11 +2311,11 @@ init_pipe_defaults(enum ia_css_pipe_mode mode,
 		} else {
 			pipe->mode = IA_CSS_PIPE_ID_CAPTURE;
 		}
-		pipe->pipe_settings.capture = capt;
+		pipe->pipe_settings.capture = IA_CSS_DEFAULT_CAPTURE_SETTINGS;
 		break;
 	case IA_CSS_PIPE_MODE_VIDEO:
 		pipe->mode = IA_CSS_PIPE_ID_VIDEO;
-		pipe->pipe_settings.video = video;
+		pipe->pipe_settings.video = IA_CSS_DEFAULT_VIDEO_SETTINGS;
 		break;
 	case IA_CSS_PIPE_MODE_ACC:
 		pipe->mode = IA_CSS_PIPE_ID_ACC;
@@ -2333,7 +2325,7 @@ init_pipe_defaults(enum ia_css_pipe_mode mode,
 		break;
 	case IA_CSS_PIPE_MODE_YUVPP:
 		pipe->mode = IA_CSS_PIPE_ID_YUVPP;
-		pipe->pipe_settings.yuvpp = yuvpp;
+		pipe->pipe_settings.yuvpp = IA_CSS_DEFAULT_YUVPP_SETTINGS;
 		break;
 	default:
 		return IA_CSS_ERR_INVALID_ARGUMENTS;
@@ -8827,10 +8819,8 @@ sh_css_init_host_sp_control_vars(void)
  */
 void ia_css_pipe_config_defaults(struct ia_css_pipe_config *pipe_config)
 {
-	struct ia_css_pipe_config def_config = DEFAULT_PIPE_CONFIG;
-
 	ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, "ia_css_pipe_config_defaults()\n");
-	*pipe_config = def_config;
+	*pipe_config = DEFAULT_PIPE_CONFIG;
 }
 
 void
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h
index e12789236bb9..09315ce9830f 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h
@@ -53,14 +53,14 @@ struct ia_css_pipe_extra_config {
 };
 
 #define DEFAULT_PIPE_EXTRA_CONFIG \
-{ \
-	false,				/* enable_raw_binning */ \
-	false,				/* enable_yuv_ds */ \
-	false,				/* enable_high_speed */ \
-	false,				/* enable_dvs_6axis */ \
-	false,				/* enable_reduced_pipe */ \
-	false,				/* enable_fractional_ds */ \
-	false,				/* disable_vf_pp */ \
+(struct ia_css_pipe_extra_config) { \
+	.enable_raw_binning	= false, \
+	.enable_yuv_ds		= false, \
+	.enable_high_speed	= false, \
+	.enable_dvs_6axis	= false, \
+	.enable_reduced_pipe	= false, \
+	.enable_fractional_ds	= false, \
+	.disable_vf_pp		= false, \
 }
 
 enum ia_css_err
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h
index 40840ea318ab..f90ac36a408a 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h
@@ -24,15 +24,13 @@ struct sh_css_pc_histogram {
 	unsigned *msink;
 };
 
-#if !defined(__USE_DESIGNATED_INITIALISERS__)
 #define DEFAULT_PC_HISTOGRAM \
-{ \
-	0, \
-	NULL, \
-	NULL, \
-	NULL \
+(struct sh_css_pc_histogram) { \
+	.length	= 0, \
+	.run	= NULL, \
+	.stall	= NULL, \
+	.msink	= NULL \
 }
-#endif
 
 struct sh_css_binary_metrics {
 	unsigned mode;
@@ -42,16 +40,14 @@ struct sh_css_binary_metrics {
 	struct sh_css_binary_metrics *next;
 };
 
-#if !defined(__USE_DESIGNATED_INITIALISERS__)
 #define DEFAULT_BINARY_METRICS \
-{ \
-	0, \
-	0, \
-	DEFAULT_PC_HISTOGRAM, \
-	DEFAULT_PC_HISTOGRAM, \
-	NULL \
+(struct sh_css_binary_metrics) { \
+	.mode		= 0, \
+	.id		= 0, \
+	.isp_histogram	= DEFAULT_PC_HISTOGRAM, \
+	.sp_histogram	= DEFAULT_PC_HISTOGRAM, \
+	.next		= NULL \
 }
-#endif
 
 struct ia_css_frame_metrics {
 	unsigned num_frames;
-- 
2.15.0

^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH 2/3] media: atomisp: delete zero-valued struct members.
  2017-11-30 21:40                 ` [PATCH 0/3] Clean up of data-structure initialization in the CSS API Jeremy Sowden
  2017-11-30 21:40                   ` [PATCH 1/3] media: atomisp: convert default struct values to use compound-literals with designated initializers Jeremy Sowden
@ 2017-11-30 21:40                   ` Jeremy Sowden
  2017-11-30 21:40                   ` [PATCH 3/3] media: atomisp: delete empty default struct values Jeremy Sowden
  2 siblings, 0 replies; 53+ messages in thread
From: Jeremy Sowden @ 2017-11-30 21:40 UTC (permalink / raw)
  To: linux-media, devel; +Cc: Jeremy Sowden

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 to be removed.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 .../hive_isp_css_common/input_formatter_global.h   |  17 ----
 .../pci/atomisp2/css2400/ia_css_frame_public.h     |  17 ----
 .../atomisp/pci/atomisp2/css2400/ia_css_pipe.h     |  42 +-------
 .../pci/atomisp2/css2400/ia_css_pipe_public.h      |  82 ---------------
 .../atomisp/pci/atomisp2/css2400/ia_css_types.h    |  47 +--------
 .../isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h     | 113 +--------------------
 .../kernels/sdis/common/ia_css_sdis_common_types.h |  48 +--------
 .../runtime/binary/interface/ia_css_binary.h       |  90 ++--------------
 .../isp_param/interface/ia_css_isp_param_types.h   |  18 +---
 .../runtime/pipeline/interface/ia_css_pipeline.h   |   6 --
 .../atomisp/pci/atomisp2/css2400/sh_css_legacy.h   |  11 +-
 .../atomisp/pci/atomisp2/css2400/sh_css_metrics.h  |  11 +-
 12 files changed, 29 insertions(+), 473 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/input_formatter_global.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/input_formatter_global.h
index d5a586b08955..7558f4964313 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/input_formatter_global.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/input_formatter_global.h
@@ -107,23 +107,6 @@ struct input_formatter_cfg_s {
 	uint32_t	block_no_reqs;
 };
 
-#define DEFAULT_IF_CONFIG \
-(struct input_formatter_cfg_s) \
-{ \
-	.start_line		= 0, \
-	.start_column		= 0, \
-	.left_padding		= 0, \
-	.cropped_height		= 0, \
-	.cropped_width		= 0, \
-	.deinterleaving		= 0, \
-	.buf_vecs		= 0, \
-	.buf_start_index	= 0, \
-	.buf_increment		= 0, \
-	.buf_eol_offset		= 0, \
-	.is_yuv420_format	= false, \
-	.block_no_reqs		= false \
-}
-
 extern const hrt_address HIVE_IF_SRST_ADDRESS[N_INPUT_FORMATTER_ID];
 extern const hrt_data HIVE_IF_SRST_MASK[N_INPUT_FORMATTER_ID];
 extern const uint8_t HIVE_IF_SWITCH_CODE[N_INPUT_FORMATTER_ID];
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_frame_public.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_frame_public.h
index 786585037af9..b0872f93b3fa 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_frame_public.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_frame_public.h
@@ -122,18 +122,8 @@ struct ia_css_frame_info {
 
 #define IA_CSS_BINARY_DEFAULT_FRAME_INFO \
 (struct ia_css_frame_info) { \
-	.res			= (struct ia_css_resolution) { \
-					.width = 0, \
-					.height = 0 \
-				}, \
-	.padded_width		= 0, \
 	.format			= IA_CSS_FRAME_FORMAT_NUM,  \
-	.raw_bit_depth		= 0, \
 	.raw_bayer_order	= IA_CSS_BAYER_ORDER_NUM, \
-	.crop_info		= (struct ia_css_crop_info) { \
-					.start_column	= 0, \
-					.start_line	= 0 \
-				}, \
 }
 
 /**
@@ -196,16 +186,9 @@ struct ia_css_frame {
 #define DEFAULT_FRAME \
 (struct ia_css_frame) { \
 	.info			= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
-	.data			= 0, \
-	.data_bytes		= 0, \
 	.dynamic_queue_id	= SH_CSS_INVALID_QUEUE_ID, \
 	.buf_type		= IA_CSS_BUFFER_TYPE_INVALID, \
 	.flash_state		= IA_CSS_FRAME_FLASH_STATE_NONE, \
-	.exp_id			= 0, \
-	.isp_config_id		= 0, \
-	.valid			= false, \
-	.contiguous		= false, \
-	.planes			= { 0 } \
 }
 
 /** @brief Fill a frame with zeros
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h
index 5d307679768e..a8f89866876d 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h
@@ -44,11 +44,6 @@ struct ia_css_preview_settings {
 	.copy_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
 	.preview_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
 	.vf_pp_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
-	.delay_frames	= { NULL }, \
-	.tnr_frames	= { NULL }, \
-	.copy_pipe	= NULL, \
-	.capture_pipe	= NULL, \
-	.acc_pipe	= NULL, \
 }
 
 struct ia_css_capture_settings {
@@ -73,17 +68,12 @@ struct ia_css_capture_settings {
 (struct ia_css_capture_settings) { \
 	.copy_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
 	.primary_binary		= {IA_CSS_BINARY_DEFAULT_SETTINGS}, \
-	.num_primary_stage	= 0, \
 	.pre_isp_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
 	.anr_gdc_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
 	.post_isp_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
 	.capture_pp_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
 	.vf_pp_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
 	.capture_ldc_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
-	.yuv_scaler_binary	= NULL, \
-	.delay_frames		= { NULL }, \
-	.is_output_stage	= NULL, \
-	.num_yuv_scaler		= 0, \
 }
 
 struct ia_css_video_settings {
@@ -106,17 +96,9 @@ struct ia_css_video_settings {
 
 #define IA_CSS_DEFAULT_VIDEO_SETTINGS \
 (struct ia_css_video_settings) { \
-	.copy_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
-	.video_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
-	.vf_pp_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
-	.yuv_scaler_binary	= NULL, \
-	.delay_frames		= { NULL }, \
-	.tnr_frames		= { NULL }, \
-	.vf_pp_in_frame		= NULL, \
-	.copy_pipe		= NULL, \
-	.capture_pipe		= NULL, \
-	.is_output_stage	= NULL, \
-	.num_yuv_scaler		= 0, \
+	.copy_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+	.video_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+	.vf_pp_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
 }
 
 struct ia_css_yuvpp_settings {
@@ -132,13 +114,7 @@ struct ia_css_yuvpp_settings {
 #define IA_CSS_DEFAULT_YUVPP_SETTINGS \
 (struct ia_css_yuvpp_settings) \
 { \
-	.copy_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
-	.yuv_scaler_binary	= NULL, \
-	.vf_pp_binary		= NULL, \
-	.is_output_stage	= NULL, \
-	.num_yuv_scaler		= 0, \
-	.num_vf_pp		= 0, \
-	.num_output		= 0, \
+	.copy_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
 }
 
 struct osys_object;
@@ -187,33 +163,23 @@ struct ia_css_pipe {
 
 #define IA_CSS_DEFAULT_PIPE \
 (struct ia_css_pipe) { \
-	.stop_requested		= false, \
 	.config			= DEFAULT_PIPE_CONFIG, \
 	.extra_config		= DEFAULT_PIPE_EXTRA_CONFIG, \
 	.info			= DEFAULT_PIPE_INFO, \
 	.mode			= IA_CSS_PIPE_ID_ACC, /* (pipe_id) */ \
-	.shading_table		= NULL, \
 	.pipeline		= DEFAULT_PIPELINE, \
 	.output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
 	.bds_output_info	= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
 	.vf_output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
 	.out_yuv_ds_input_info	= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
 	.vf_yuv_ds_input_info	= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
-	.output_stage		= NULL, \
-	.vf_stage		= NULL, \
 	.required_bds_factor	= SH_CSS_BDS_FACTOR_1_00, \
 	.dvs_frame_delay	= 1, \
-	.num_invalid_frames	= 0, \
 	.enable_viewfinder	= {true}, \
-	.stream			= NULL, \
 	.in_frame_struct	= DEFAULT_FRAME, \
 	.out_frame_struct	= DEFAULT_FRAME, \
 	.vf_frame_struct	= DEFAULT_FRAME, \
-	.continuous_frames	= { NULL }, \
-	.cont_md_buffers	= { NULL }, \
 	.pipe_settings		= { .preview = IA_CSS_DEFAULT_PREVIEW_SETTINGS }, \
-	.scaler_pp_lut		= 0, \
-	.osys_obj		= NULL, \
 	.pipe_num		= PIPE_ENTRY_EMPTY_TOKEN, \
 }
 
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe_public.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe_public.h
index 6012b44c9076..0f7b5ef38193 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe_public.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe_public.h
@@ -152,17 +152,6 @@ struct ia_css_pipe_config {
 };
 
 
-#ifdef ISP2401
-/**
- * Default origin of internal frame positioned on shading table.
- */
-#define IA_CSS_PIPE_DEFAULT_INTERNAL_FRAME_ORIGIN_BQS_ON_SCTBL \
-(struct ia_css_coordinate)
-{ \
-	.x = 0, \
-	.y = 0 \
-}
-
 /**
  * Default settings for newly created pipe configurations.
  */
@@ -170,66 +159,13 @@ struct ia_css_pipe_config {
 (struct ia_css_pipe_config) { \
 	.mode			= IA_CSS_PIPE_MODE_PREVIEW, \
 	.isp_pipe_version	= 1, \
-	.input_effective_res	= { 0, 0 }, \
-	.bayer_ds_out_res	= { 0, 0 }, \
-	.capt_pp_in_res		= { 0, 0 }, \
-	.vf_pp_in_res		= { 0, 0 }, \
-	.output_system_in_res	= { 0, 0 }, \
-	.dvs_crop_out_res	= { 0, 0 }, \
 	.output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
 	.vf_output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
-	.acc_extension		= NULL, \
-	.acc_stages		= NULL, \
-	.num_acc_stages		= 0, \
 	.default_capture_config	= DEFAULT_CAPTURE_CONFIG, \
-	.dvs_envelope		= { 0, 0 }, \
 	.dvs_frame_delay	= IA_CSS_FRAME_DELAY_1, \
 	.acc_num_execs		= -1, \
-	.enable_dz		= false, \
-	.enable_dpc		= false, \
-	.enable_vfpp_bci	= false, \
-	.enable_luma_only	= false, \
-	.enable_tnr		= false, \
-	.p_isp_config		= NULL, \
-	.gdc_in_buffer_res	= { 0, 0 }, \
-	.gdc_in_buffer_offset	= { 0, 0 }, \
-	.internal_frame_origin_bqs_on_sctbl \
-				= IA_CSS_PIPE_DEFAULT_INTERNAL_FRAME_ORIGIN_BQS_ON_SCTBL \
 }
 
-#else
-
-/**
- * Default settings for newly created pipe configurations.
- */
-#define DEFAULT_PIPE_CONFIG \
-(struct ia_css_pipe_config) { \
-	.mode			= IA_CSS_PIPE_MODE_PREVIEW, \
-	.isp_pipe_version	= 1, \
-	.input_effective_res	= { 0, 0 }, \
-	.bayer_ds_out_res	= { 0, 0 }, \
-	.capt_pp_in_res		= { 0, 0 }, \
-	.vf_pp_in_res		= { 0, 0 }, \
-	.dvs_crop_out_res	= { 0, 0 }, \
-	.output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
-	.vf_output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
-	.acc_extension		= NULL, \
-	.acc_stages		= NULL, \
-	.num_acc_stages		= 0, \
-	.default_capture_config	= DEFAULT_CAPTURE_CONFIG, \
-	.dvs_envelope		= { 0, 0 }, \
-	.dvs_frame_delay	= IA_CSS_FRAME_DELAY_1, \
-	.acc_num_execs		= -1, \
-	.enable_dz		= false, \
-	.enable_dpc		= false, \
-	.enable_vfpp_bci	= false, \
-	.p_isp_config		= NULL, \
-	.gdc_in_buffer_res	= { 0, 0 }, \
-	.gdc_in_buffer_offset	= { 0, 0 } \
-}
-
-#endif
-
 /** Pipe info, this struct describes properties of a pipe after it's stream has
  * been created.
  * ~~~** DO NOT ADD NEW FIELD **~~~ This structure will be deprecated.
@@ -274,21 +210,6 @@ struct ia_css_pipe_info {
 /**
  * Defaults for ia_css_pipe_info structs.
  */
-#ifdef ISP2401
-
-#define DEFAULT_PIPE_INFO \
-(struct ia_css_pipe_info) { \
-	.output_info			= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
-	.vf_output_info			= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
-	.raw_output_info		= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
-	.output_system_in_res_info	= { 0, 0 }, \
-	.shading_info			= DEFAULT_SHADING_INFO, \
-	.grid_info			= DEFAULT_GRID_INFO, \
-	.num_invalid_frames		= 0 \
-}
-
-#else
-
 #define DEFAULT_PIPE_INFO \
 (struct ia_css_pipe_info) { \
 	.output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
@@ -296,11 +217,8 @@ struct ia_css_pipe_info {
 	.raw_output_info	= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
 	.shading_info		= DEFAULT_SHADING_INFO, \
 	.grid_info		= DEFAULT_GRID_INFO, \
-	.num_invalid_frames	= 0 \
 }
 
-#endif
-
 /** @brief Load default pipe configuration
  * @param[out]	pipe_config The pipe configuration.
  * @return	None
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h
index 584eb3fb1f47..0ae60a3d0643 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h
@@ -370,52 +370,20 @@ struct ia_css_shading_info {
 	} info;
 };
 
-#ifndef ISP2401
-
-/** Default Shading Correction information of Shading Correction Type 1. */
-#define DEFAULT_SHADING_INFO_TYPE_1 \
-(struct ia_css_shading_info) { \
-	.type = IA_CSS_SHADING_CORRECTION_TYPE_1, \
-	.info = { \
-		.type_1 = { \
-			.enable					= 0, \
-			.num_hor_grids				= 0, \
-			.num_ver_grids				= 0, \
-			.bqs_per_grid_cell			= 0, \
-			.bayer_scale_hor_ratio_in		= 1, \
-			.bayer_scale_hor_ratio_out		= 1, \
-			.bayer_scale_ver_ratio_in		= 1, \
-			.bayer_scale_ver_ratio_out		= 1, \
-			.sc_bayer_origin_x_bqs_on_shading_table	= 0, \
-			.sc_bayer_origin_y_bqs_on_shading_table	= 0 \
-		} \
-	} \
-}
-
-#else
-
 /** Default Shading Correction information of Shading Correction Type 1. */
 #define DEFAULT_SHADING_INFO_TYPE_1 \
 (struct ia_css_shading_info) { \
 	.type = IA_CSS_SHADING_CORRECTION_TYPE_1, \
 	.info = { \
 		.type_1 = { \
-			.num_hor_grids				= 0, \
-			.num_ver_grids				= 0, \
-			.bqs_per_grid_cell			= 0, \
-			.bayer_scale_hor_ratio_in		= 1, \
-			.bayer_scale_hor_ratio_out		= 1, \
-			.bayer_scale_ver_ratio_in		= 1, \
-			.bayer_scale_ver_ratio_out		= 1, \
-			.isp_input_sensor_data_res_bqs		= {0, 0}, \
-			.sensor_data_res_bqs			= {0, 0}, \
-			.sensor_data_origin_bqs_on_sctbl	= {0, 0} \
+			.bayer_scale_hor_ratio_in	= 1, \
+			.bayer_scale_hor_ratio_out	= 1, \
+			.bayer_scale_ver_ratio_in	= 1, \
+			.bayer_scale_ver_ratio_out	= 1, \
 		} \
 	} \
 }
 
-#endif
-
 /** Default Shading Correction information. */
 #define DEFAULT_SHADING_INFO	DEFAULT_SHADING_INFO_TYPE_1
 
@@ -439,8 +407,6 @@ struct ia_css_grid_info {
 /** defaults for ia_css_grid_info structs */
 #define DEFAULT_GRID_INFO \
 (struct ia_css_grid_info) { \
-	.isp_in_width	= 0, \
-	.isp_in_height	= 0, \
 	.s3a_grid	= DEFAULT_3A_GRID_INFO, \
 	.dvs_grid	= DEFAULT_DVS_GRID_INFO, \
 	.vamem_type	= IA_CSS_VAMEM_TYPE_1 \
@@ -535,10 +501,7 @@ struct ia_css_capture_config {
 /** default settings for ia_css_capture_config structs */
 #define DEFAULT_CAPTURE_CONFIG \
 (struct ia_css_capture_config) { \
-	.mode			= IA_CSS_CAPTURE_MODE_PRIMARY, \
-	.enable_xnr		= false, \
-	.enable_raw_output	= false, \
-	.enable_capture_pp_bli	= false \
+	.mode	= IA_CSS_CAPTURE_MODE_PRIMARY, \
 }
 
 
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h
index 1975834dd927..1309b06747d0 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h
@@ -98,119 +98,8 @@ struct ia_css_3a_grid_info {
 };
 
 
-#if defined(SYSTEM_css_skycam_c0_system)
-#if defined USE_NEW_AE_STRUCT || defined USE_NEW_AWB_STRUCT
-#define DEFAULT_3A_GRID_INFO \
-(struct ia_css_3a_grid_info) { \
-	.ae_enable		= 0, \
-	.ae_grd_info		= (struct ae_public_config_grid_config) { \
-					width = 0, \
-					height = 0, \
-					b_width = 0, \
-					b_height = 0, \
-					x_start = 0, \
-					y_start = 0, \
-					x_end = 0, \
-					y_end = 0 \
-			          } \
-	.awb_enable		= 0, \
-	.awb_grd_info		= (struct awb_public_config_grid_config) { \
-					width = 0, \
-					height = 0, \
-					b_width = 0, \
-					b_height = 0, \
-					x_start = 0, \
-					y_start = 0, \
-					x_end = 0, \
-					y_end = 0 \
-			          }	\
-	.af_enable		= 0, \
-	.af_grd_info		= (struct af_public_grid_config) { \
-					width = 0, \
-					height = 0, \
-					b_width = 0, \
-					b_height = 0, \
-					x_start = 0, \
-					y_start = 0, \
-					ff_en = 0 \
-				  } \
-	.awb_fr_enable		= 0, \
-	.awb_fr_grd_info	= (struct awb_fr_public_grid_config) { \
-					width = 0, \
-					height = 0, \
-					b_width = 0, \
-					b_height = 0, \
-					x_start = 0, \
-					y_start = 0, \
-					ff_en = 0 \
-				  } \
-	.elem_bit_depth		= 0, \
-}
-#else
-#define DEFAULT_3A_GRID_INFO \
-{ \
-	.ae_enable		= 0, \
-	.ae_grd_info		= (struct ae_public_config_grid_config) { \
-					width = 0, \
-					height = 0, \
-					b_width = 0, \
-					b_height = 0, \
-					x_start = 0, \
-					y_start = 0, \
-					x_end = 0, \
-					y_end = 0 \
-			          } \
-	.awb_enable		= 0, \
-	.awb_grd_info		= (struct awb_public_config_grid_config) { \
-					width = 0, \
-					height = 0, \
-					b_width = 0, \
-					b_height = 0, \
-					x_start = 0, \
-					y_start = 0, \
-					x_end = 0, \
-					y_end = 0 \
-			          }	\
-	.af_enable		= 0, \
-	.af_grd_info		= (struct af_public_grid_config) { \
-					width = 0, \
-					height = 0, \
-					b_width = 0, \
-					b_height = 0, \
-					x_start = 0, \
-					y_start = 0, \
-					ff_en = 0 \
-				  } \
-	.awb_fr_enable		= 0, \
-	.awb_fr_grd_info	= (struct awb_fr_public_grid_config) { \
-					width = 0, \
-					height = 0, \
-					b_width = 0, \
-					b_height = 0, \
-					x_start = 0, \
-					y_start = 0, \
-					ff_en = 0 \
-				  } \
-	.elem_bit_depth		= 0, \
-}
-#endif /* USE_NEW_AE_STRUCT || defined USE_NEW_AWB_STRUCT */
+#define DEFAULT_3A_GRID_INFO (struct ia_css_3a_grid_info) { }
 
-#else
-#define DEFAULT_3A_GRID_INFO \
-{ \
-	.enable			= 0, \
-	.use_dmem		= 0, \
-	.has_histogram		= 0, \
-	.width			= 0, \
-	.height			= 0, \
-	.aligned_width		= 0, \
-	.aligned_height		= 0, \
-	.bqs_per_grid_cell	= 0, \
-	.deci_factor_log2	= 0, \
-	.elem_bit_depth		= 0, \
-}
-
-#endif
 
 /* This struct should be split into 3, for AE, AWB and AF.
  * However, that will require driver/ 3A lib modifications.
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h
index bcb1060e5ce0..a969384430aa 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h
@@ -41,22 +41,7 @@ struct ia_css_sdis_info {
 	uint32_t deci_factor_log2;
 };
 
-#define IA_CSS_DEFAULT_SDIS_INFO \
-(struct ia_css_sdis_info) { \
-	.grid = { \
-		.dim = (struct ia_css_dvs_grid_dim) { .width = 0, .height = 0 }, \
-		.pad = (struct ia_css_dvs_grid_dim) { .width = 0, .height = 0 }, \
-	}, \
-	.coef = { \
-		.dim = (struct ia_css_dvs_grid_dim) { .width = 0, .height = 0 }, \
-		.pad = (struct ia_css_dvs_grid_dim) { .width = 0, .height = 0 }, \
-	}, \
-	.proj = { \
-		.dim = (struct ia_css_dvs_grid_dim) { .width = 0, .height = 0 }, \
-		.pad = (struct ia_css_dvs_grid_dim) { .width = 0, .height = 0 }, \
-	}, \
-	.deci_factor_log2 = 0, \
-}
+#define IA_CSS_DEFAULT_SDIS_INFO (struct ia_css_sdis_info) { }
 
 /** DVS statistics grid
  *
@@ -213,38 +198,13 @@ struct ia_css_dvs_stat_grid_info {
 /** DVS statistics generated by accelerator default grid info
  */
 #define DEFAULT_DVS_STAT_PUBLIC_DVS_GLOBAL_CFG \
-(struct dvs_stat_public_dvs_global_cfg) { \
-	.kappa		= 0, \
-	.match_shift	= 0, \
-	.ybin_mode	= 0, \
-}
+(struct dvs_stat_public_dvs_global_cfg) { }
 
 #define DEFAULT_DVS_STAT_PUBLIC_DVS_GRD_CFG \
-(struct dvs_stat_public_dvs_grd_cfg) { \
-	.grd_cfg	= (struct dvs_stat_public_dvs_level_grid_cfg) { \
-				.grid_width = 0, \
-				.grid_height = 0, \
-				.block_width = 0, \
-				.block_height = 0 \
-			}, \
-	.grd_start	= (struct dvs_stat_public_dvs_level_grid_start) { \
-				.x_start = 0, \
-				.y_start = 0, \
-				.enable = 0 \
-			}, \
-	.grd_end	= (struct dvs_stat_public_dvs_level_grid_end) { \
-				.x_end = 0, \
-				.y_end = 0, \
-			}, \
-}
+(struct dvs_stat_public_dvs_grd_cfg) { }
 
 #define DEFAULT_DVS_STAT_PUBLIC_DVS_LEVEL_FE_ROI_CFG(X_START) \
-(struct dvs_stat_public_dvs_level_fe_roi_cfg) { \
-	.x_start = X_START, \
-	.y_start = 0, \
-	.x_end   = 0, \
-	.y_end   = 0, \
-}
+	(struct dvs_stat_public_dvs_level_fe_roi_cfg) { .x_start = X_START, }
 
 #define DEFAULT_DVS_STAT_GRID_INFO \
 (struct ia_css_dvs_stat_grid_info) { \
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 2bcb19b21714..dcde6efa4943 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,16 +93,7 @@ struct ia_css_cas_binary_descr {
 	bool *is_output_stage;
 };
 
-#define IA_CSS_DEFAULT_CAS_BINARY_DESCR \
-(struct ia_css_cas_binary_descr) {	\
-	.num_stage		= 0,	\
-	.num_output_stage	= 0,	\
-	.in_info		= NULL,	\
-	.internal_out_info	= NULL,	\
-	.out_info		= NULL,	\
-	.vf_info		= NULL,	\
-	.is_output_stage	= NULL,	\
-}
+#define IA_CSS_DEFAULT_CAS_BINARY_DESCR (struct ia_css_cas_binary_descr) { }
 
 struct ia_css_binary_descr {
 	int mode;
@@ -171,80 +162,19 @@ struct ia_css_binary {
 	struct ia_css_isp_param_css_segments  css_params;
 };
 
-#ifdef ISP2401
-
 #define IA_CSS_BINARY_DEFAULT_SETTINGS \
 (struct ia_css_binary) { \
-	.info				= NULL, \
-	.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}, \
-	.effective_in_frame_res		= { 0, 0 }, \
-	.vf_frame_info			= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
-	.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		= 0, \
-	.dis				= IA_CSS_DEFAULT_SDIS_INFO, \
-	.dvs_envelope			= { 0, 0 }, \
-	.online				= false, \
-	.uds_xc				= 0, \
-	.uds_yc				= 0, \
-	.left_padding			= 0, \
-	.metrics			= DEFAULT_BINARY_METRICS, \
-	.mem_params			= IA_CSS_DEFAULT_ISP_MEM_PARAMS, \
-	.css_params			= IA_CSS_DEFAULT_ISP_CSS_PARAMS, \
+	.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, \
+	.dis			= IA_CSS_DEFAULT_SDIS_INFO, \
+	.metrics		= DEFAULT_BINARY_METRICS, \
+	.mem_params		= IA_CSS_DEFAULT_ISP_MEM_PARAMS, \
+	.css_params		= IA_CSS_DEFAULT_ISP_CSS_PARAMS, \
 }
 
-#else
-
-#define IA_CSS_BINARY_DEFAULT_SETTINGS \
-(struct ia_css_binary) { \
-	.info				= NULL, \
-	.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}, \
-	.effective_in_frame_res		= { 0, 0 }, \
-	.vf_frame_info			= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
-	.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, \
-	.dis				= IA_CSS_DEFAULT_SDIS_INFO, \
-	.dvs_envelope			= { 0, 0 }, \
-	.online				= false, \
-	.uds_xc				= 0, \
-	.uds_yc				= 0, \
-	.left_padding			= 0, \
-	.metrics			= DEFAULT_BINARY_METRICS, \
-	.mem_params			= IA_CSS_DEFAULT_ISP_MEM_PARAMS, \
-	.css_params			= IA_CSS_DEFAULT_ISP_CSS_PARAMS, \
-}
-
-#endif
-
 enum ia_css_err
 ia_css_binary_init_infos(void);
 
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
index cda540c012e7..022db8a2a184 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
@@ -95,24 +95,12 @@ union ia_css_all_memory_offsets {
 };
 
 #define IA_CSS_DEFAULT_ISP_MEM_PARAMS \
-	(struct ia_css_isp_param_host_segments) { \
-		.params = { { \
-			(struct ia_css_host_data) { .address = NULL, .size = 0 } \
-		} } \
-	}
+	(struct ia_css_isp_param_host_segments) { }
 
 #define IA_CSS_DEFAULT_ISP_CSS_PARAMS \
-	(struct ia_css_isp_param_css_segments) { \
-		.params = { { \
-			(struct ia_css_data) { .address = 0, .size = 0 } \
-		} } \
-	}
+	(struct ia_css_isp_param_css_segments) { }
 
 #define IA_CSS_DEFAULT_ISP_ISP_PARAMS \
-	(struct ia_css_isp_param_isp_segments) { \
-		.params = { { \
-			(struct ia_css_isp_data) { .address = 0, .size = 0 } \
-		} } \
-	}
+	(struct ia_css_isp_param_isp_segments) { }
 
 #endif /* _IA_CSS_ISP_PARAM_TYPES_H_ */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/interface/ia_css_pipeline.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/interface/ia_css_pipeline.h
index da74440d826d..cdb483efad3e 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/interface/ia_css_pipeline.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/interface/ia_css_pipeline.h
@@ -76,16 +76,10 @@ struct ia_css_pipeline {
 #define DEFAULT_PIPELINE \
 (struct ia_css_pipeline) { \
 	.pipe_id		= IA_CSS_PIPE_ID_PREVIEW, \
-	.pipe_num		= 0, \
-	.stop_requested		= false, \
-	.stages			= NULL, \
-	.current_stage		= NULL, \
-	.num_stages		= 0, \
 	.in_frame		= DEFAULT_FRAME, \
 	.out_frame		= {DEFAULT_FRAME}, \
 	.vf_frame		= {DEFAULT_FRAME}, \
 	.dvs_frame_delay	= IA_CSS_FRAME_DELAY_1, \
-	.inout_port_config	= 0, \
 	.num_execs		= -1, \
 	.acquire_isp_each_stage	= true, \
 	.pipe_qos_config	= QOS_INVALID \
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h
index 09315ce9830f..cd95d46a6212 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h
@@ -52,16 +52,7 @@ struct ia_css_pipe_extra_config {
 	bool disable_vf_pp;
 };
 
-#define DEFAULT_PIPE_EXTRA_CONFIG \
-(struct ia_css_pipe_extra_config) { \
-	.enable_raw_binning	= false, \
-	.enable_yuv_ds		= false, \
-	.enable_high_speed	= false, \
-	.enable_dvs_6axis	= false, \
-	.enable_reduced_pipe	= false, \
-	.enable_fractional_ds	= false, \
-	.disable_vf_pp		= false, \
-}
+#define DEFAULT_PIPE_EXTRA_CONFIG (struct ia_css_pipe_extra_config) { }
 
 enum ia_css_err
 ia_css_pipe_create_extra(const struct ia_css_pipe_config *config,
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h
index f90ac36a408a..275d6e8decf9 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h
@@ -24,13 +24,7 @@ struct sh_css_pc_histogram {
 	unsigned *msink;
 };
 
-#define DEFAULT_PC_HISTOGRAM \
-(struct sh_css_pc_histogram) { \
-	.length	= 0, \
-	.run	= NULL, \
-	.stall	= NULL, \
-	.msink	= NULL \
-}
+#define DEFAULT_PC_HISTOGRAM (struct sh_css_pc_histogram) { }
 
 struct sh_css_binary_metrics {
 	unsigned mode;
@@ -42,11 +36,8 @@ struct sh_css_binary_metrics {
 
 #define DEFAULT_BINARY_METRICS \
 (struct sh_css_binary_metrics) { \
-	.mode		= 0, \
-	.id		= 0, \
 	.isp_histogram	= DEFAULT_PC_HISTOGRAM, \
 	.sp_histogram	= DEFAULT_PC_HISTOGRAM, \
-	.next		= NULL \
 }
 
 struct ia_css_frame_metrics {
-- 
2.15.0

^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH 3/3] media: atomisp: delete empty default struct values.
  2017-11-30 21:40                 ` [PATCH 0/3] Clean up of data-structure initialization in the CSS API Jeremy Sowden
  2017-11-30 21:40                   ` [PATCH 1/3] media: atomisp: convert default struct values to use compound-literals with designated initializers Jeremy Sowden
  2017-11-30 21:40                   ` [PATCH 2/3] media: atomisp: delete zero-valued struct members Jeremy Sowden
@ 2017-11-30 21:40                   ` Jeremy Sowden
  2 siblings, 0 replies; 53+ messages in thread
From: Jeremy Sowden @ 2017-11-30 21:40 UTC (permalink / raw)
  To: linux-media, devel; +Cc: Jeremy Sowden

Removing zero-valued struct-members left a number of the default
struct-values empty.  These values have now been removed.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 .../atomisp/pci/atomisp2/css2400/ia_css_pipe.h     |  1 -
 .../atomisp/pci/atomisp2/css2400/ia_css_types.h    |  1 -
 .../isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h     |  3 --
 .../kernels/sdis/common/ia_css_sdis_common_types.h | 34 +++++-----------------
 .../isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c   |  2 +-
 .../runtime/binary/interface/ia_css_binary.h       |  6 ----
 .../isp_param/interface/ia_css_isp_param_types.h   |  9 ------
 .../media/atomisp/pci/atomisp2/css2400/sh_css.c    |  9 +++---
 .../atomisp/pci/atomisp2/css2400/sh_css_legacy.h   |  2 --
 .../atomisp/pci/atomisp2/css2400/sh_css_metrics.h  |  8 -----
 10 files changed, 12 insertions(+), 63 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h
index a8f89866876d..9c6efaa66c93 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h
@@ -164,7 +164,6 @@ struct ia_css_pipe {
 #define IA_CSS_DEFAULT_PIPE \
 (struct ia_css_pipe) { \
 	.config			= DEFAULT_PIPE_CONFIG, \
-	.extra_config		= DEFAULT_PIPE_EXTRA_CONFIG, \
 	.info			= DEFAULT_PIPE_INFO, \
 	.mode			= IA_CSS_PIPE_ID_ACC, /* (pipe_id) */ \
 	.pipeline		= DEFAULT_PIPELINE, \
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h
index 0ae60a3d0643..e49fe5bc98b8 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h
@@ -407,7 +407,6 @@ struct ia_css_grid_info {
 /** defaults for ia_css_grid_info structs */
 #define DEFAULT_GRID_INFO \
 (struct ia_css_grid_info) { \
-	.s3a_grid	= DEFAULT_3A_GRID_INFO, \
 	.dvs_grid	= DEFAULT_DVS_GRID_INFO, \
 	.vamem_type	= IA_CSS_VAMEM_TYPE_1 \
 }
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h
index 1309b06747d0..4297c3addcb2 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h
@@ -98,9 +98,6 @@ struct ia_css_3a_grid_info {
 };
 
 
-#define DEFAULT_3A_GRID_INFO (struct ia_css_3a_grid_info) { }
-
-
 /* This struct should be split into 3, for AE, AWB and AF.
  * However, that will require driver/ 3A lib modifications.
  */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h
index a969384430aa..4cfd31bd3e5f 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h
@@ -41,8 +41,6 @@ struct ia_css_sdis_info {
 	uint32_t deci_factor_log2;
 };
 
-#define IA_CSS_DEFAULT_SDIS_INFO (struct ia_css_sdis_info) { }
-
 /** DVS statistics grid
  *
  *  ISP block: SDVS1 (DIS/DVS Support for DIS/DVS ver.1 (2-axes))
@@ -197,33 +195,15 @@ struct ia_css_dvs_stat_grid_info {
 
 /** DVS statistics generated by accelerator default grid info
  */
-#define DEFAULT_DVS_STAT_PUBLIC_DVS_GLOBAL_CFG \
-(struct dvs_stat_public_dvs_global_cfg) { }
-
-#define DEFAULT_DVS_STAT_PUBLIC_DVS_GRD_CFG \
-(struct dvs_stat_public_dvs_grd_cfg) { }
-
-#define DEFAULT_DVS_STAT_PUBLIC_DVS_LEVEL_FE_ROI_CFG(X_START) \
-	(struct dvs_stat_public_dvs_level_fe_roi_cfg) { .x_start = X_START, }
-
-#define DEFAULT_DVS_STAT_GRID_INFO \
-(struct ia_css_dvs_stat_grid_info) { \
-	.dvs_gbl_cfg = DEFAULT_DVS_STAT_PUBLIC_DVS_GLOBAL_CFG, \
-	.grd_cfg = { \
-		DEFAULT_DVS_STAT_PUBLIC_DVS_GRD_CFG, \
-		DEFAULT_DVS_STAT_PUBLIC_DVS_GRD_CFG, \
-		DEFAULT_DVS_STAT_PUBLIC_DVS_GRD_CFG \
-	}, \
-	.fe_roi_cfg = { \
-		DEFAULT_DVS_STAT_PUBLIC_DVS_LEVEL_FE_ROI_CFG(0), \
-		DEFAULT_DVS_STAT_PUBLIC_DVS_LEVEL_FE_ROI_CFG(4), \
-		DEFAULT_DVS_STAT_PUBLIC_DVS_LEVEL_FE_ROI_CFG(0), \
-	} \
-}
-
 #define DEFAULT_DVS_GRID_INFO \
 (union ia_css_dvs_grid_u) { \
-	.dvs_stat_grid_info = DEFAULT_DVS_STAT_GRID_INFO, \
+	.dvs_stat_grid_info = (struct ia_css_dvs_stat_grid_info) { \
+		.fe_roi_cfg = { \
+			[1] = (struct dvs_stat_public_dvs_level_fe_roi_cfg) { \
+				.x_start = 4 \
+			} \
+		} \
+	} \
 }
 
 /** Union that holds all types of DVS statistics grid info in
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c
index e45a3c3fcf4a..0fdd696bf654 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c
@@ -169,7 +169,7 @@ ia_css_sdis_init_info(
 	unsigned enabled)
 {
 	if (!enabled) {
-		*dis = IA_CSS_DEFAULT_SDIS_INFO;
+		*dis = (struct ia_css_sdis_info) { };
 		return;
 	}
 
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 dcde6efa4943..e83a2fa8413b 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,8 +93,6 @@ struct ia_css_cas_binary_descr {
 	bool *is_output_stage;
 };
 
-#define IA_CSS_DEFAULT_CAS_BINARY_DESCR (struct ia_css_cas_binary_descr) { }
-
 struct ia_css_binary_descr {
 	int mode;
 	bool online;
@@ -169,10 +167,6 @@ struct ia_css_binary {
 	.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, \
-	.dis			= IA_CSS_DEFAULT_SDIS_INFO, \
-	.metrics		= DEFAULT_BINARY_METRICS, \
-	.mem_params		= IA_CSS_DEFAULT_ISP_MEM_PARAMS, \
-	.css_params		= IA_CSS_DEFAULT_ISP_CSS_PARAMS, \
 }
 
 enum ia_css_err
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
index 022db8a2a184..2cb61811e53c 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
@@ -94,13 +94,4 @@ union ia_css_all_memory_offsets {
 	} array[IA_CSS_NUM_PARAM_CLASSES];
 };
 
-#define IA_CSS_DEFAULT_ISP_MEM_PARAMS \
-	(struct ia_css_isp_param_host_segments) { }
-
-#define IA_CSS_DEFAULT_ISP_CSS_PARAMS \
-	(struct ia_css_isp_param_css_segments) { }
-
-#define IA_CSS_DEFAULT_ISP_ISP_PARAMS \
-	(struct ia_css_isp_param_isp_segments) { }
-
 #endif /* _IA_CSS_ISP_PARAM_TYPES_H_ */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
index 9439d643fd03..59bf3402703f 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
@@ -5582,8 +5582,7 @@ static enum ia_css_err load_video_binaries(struct ia_css_pipe *pipe)
 	/* we build up the pipeline starting at the end */
 	/* YUV post-processing if needed */
 	if (need_scaler) {
-		struct ia_css_cas_binary_descr cas_scaler_descr
-			= IA_CSS_DEFAULT_CAS_BINARY_DESCR;
+		struct ia_css_cas_binary_descr cas_scaler_descr = { };
 
 		/* NV12 is the common format that is supported by both */
 		/* yuv_scaler and the video_xx_isp2_min binaries. */
@@ -6236,8 +6235,8 @@ static enum ia_css_err load_primary_binaries(
 						pipe_out_info->res);
 
 	if (need_extra_yuv_scaler) {
-		struct ia_css_cas_binary_descr cas_scaler_descr
-			= IA_CSS_DEFAULT_CAS_BINARY_DESCR;
+		struct ia_css_cas_binary_descr cas_scaler_descr = { };
+
 		err = ia_css_pipe_create_cas_scaler_desc_single_output(
 			&capt_pp_out_info,
 			pipe_out_info,
@@ -7224,7 +7223,7 @@ load_yuvpp_binaries(struct ia_css_pipe *pipe)
 	struct ia_css_frame_info *vf_pp_in_info[IA_CSS_PIPE_MAX_OUTPUT_STAGE];
 	struct ia_css_yuvpp_settings *mycs;
 	struct ia_css_binary *next_binary;
-	struct ia_css_cas_binary_descr cas_scaler_descr = IA_CSS_DEFAULT_CAS_BINARY_DESCR;
+	struct ia_css_cas_binary_descr cas_scaler_descr = { };
 	unsigned int i, j;
 	bool need_isp_copy_binary = false;
 
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h
index cd95d46a6212..c690a184ccd4 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h
@@ -52,8 +52,6 @@ struct ia_css_pipe_extra_config {
 	bool disable_vf_pp;
 };
 
-#define DEFAULT_PIPE_EXTRA_CONFIG (struct ia_css_pipe_extra_config) { }
-
 enum ia_css_err
 ia_css_pipe_create_extra(const struct ia_css_pipe_config *config,
 			 const struct ia_css_pipe_extra_config *extra_config,
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h
index 275d6e8decf9..2ef9238d95ad 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h
@@ -24,8 +24,6 @@ struct sh_css_pc_histogram {
 	unsigned *msink;
 };
 
-#define DEFAULT_PC_HISTOGRAM (struct sh_css_pc_histogram) { }
-
 struct sh_css_binary_metrics {
 	unsigned mode;
 	unsigned id;
@@ -34,12 +32,6 @@ struct sh_css_binary_metrics {
 	struct sh_css_binary_metrics *next;
 };
 
-#define DEFAULT_BINARY_METRICS \
-(struct sh_css_binary_metrics) { \
-	.isp_histogram	= DEFAULT_PC_HISTOGRAM, \
-	.sp_histogram	= DEFAULT_PC_HISTOGRAM, \
-}
-
 struct ia_css_frame_metrics {
 	unsigned num_frames;
 };
-- 
2.15.0

^ permalink raw reply related	[flat|nested] 53+ messages in thread

* Re: [PATCH 1/3] media: atomisp: convert default struct values to use compound-literals with designated initializers.
  2017-11-30 21:40                   ` [PATCH 1/3] media: atomisp: convert default struct values to use compound-literals with designated initializers Jeremy Sowden
@ 2017-12-01 15:07                     ` Dan Carpenter
  2017-12-01 15:31                       ` Jeremy Sowden
                                         ` (2 more replies)
  0 siblings, 3 replies; 53+ messages in thread
From: Dan Carpenter @ 2017-12-01 15:07 UTC (permalink / raw)
  To: Jeremy Sowden; +Cc: linux-media, devel

I can't apply this (to today's linux-next) but does this really work:

> +(struct ia_css_3a_grid_info) { \
> +	.ae_enable		= 0, \
> +	.ae_grd_info		= (struct ae_public_config_grid_config) { \
> +					width = 0, \
> +					height = 0, \
> +					b_width = 0, \
> +					b_height = 0, \
> +					x_start = 0, \
> +					y_start = 0, \
> +					x_end = 0, \
> +					y_end = 0 \

I'm pretty sure those lines should start with a period.

- 					width = 0, \
+					.width = 0, \

regards,
dan

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH 1/3] media: atomisp: convert default struct values to use compound-literals with designated initializers.
  2017-12-01 15:07                     ` Dan Carpenter
@ 2017-12-01 15:31                       ` Jeremy Sowden
  2017-12-01 17:19                       ` [PATCH v2 0/3] media: atomisp: clean up of data-structure initialization in the CSS API Jeremy Sowden
  2017-12-01 21:45                       ` [PATCH v3 0/3] media: atomisp: clean up of data-structure initialization in the CSS API Jeremy Sowden
  2 siblings, 0 replies; 53+ messages in thread
From: Jeremy Sowden @ 2017-12-01 15:31 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: linux-media, devel

[-- Attachment #1: Type: text/plain, Size: 618 bytes --]

On 2017-12-01, at 18:07:25 +0300, Dan Carpenter wrote:
> I can't apply this (to today's linux-next) but does this really work:
>
> > +(struct ia_css_3a_grid_info) { \
> > +	.ae_enable		= 0, \
> > +	.ae_grd_info		= (struct ae_public_config_grid_config) { \
> > +					width = 0, \
> > +					height = 0, \
> > +					b_width = 0, \
> > +					b_height = 0, \
> > +					x_start = 0, \
> > +					y_start = 0, \
> > +					x_end = 0, \
> > +					y_end = 0 \
>
> I'm pretty sure those lines should start with a period.
>
> - 					width = 0, \
> +					.width = 0, \

Indeed they should.  A second version is in the pipeline.

J.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 53+ messages in thread

* [PATCH v2 0/3] media: atomisp: clean up of data-structure initialization in the CSS API
  2017-12-01 15:07                     ` Dan Carpenter
  2017-12-01 15:31                       ` Jeremy Sowden
@ 2017-12-01 17:19                       ` Jeremy Sowden
  2017-12-01 17:19                         ` [PATCH v2 1/3] media: atomisp: convert default struct values to use compound-literals with designated initializers Jeremy Sowden
                                           ` (2 more replies)
  2017-12-01 21:45                       ` [PATCH v3 0/3] media: atomisp: clean up of data-structure initialization in the CSS API Jeremy Sowden
  2 siblings, 3 replies; 53+ messages in thread
From: Jeremy Sowden @ 2017-12-01 17:19 UTC (permalink / raw)
  To: linux-media, devel; +Cc: Jeremy Sowden

v2.

  Fixed a couple of bugs and addressed checkpatch errors.

v1.

  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 made it
  possible 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.

  The designated initializers also allow the removal of lots of
  struct-members initialized to zero values.

  I made the changes in three stages: firstly, I converted the default
  values to compound-literals and designated initializers and removed
  the temporary variables; secondly, I removed the zero-valued
  struct-members; finally, I removed some structs which had become
  empty.

Jeremy Sowden (3):
  media: atomisp: convert default struct values to use compound-literals
    with designated initializers.
  media: atomisp: delete zero-valued struct members.
  media: atomisp: delete empty default struct values.

 .../hive_isp_css_common/input_formatter_global.h   |  16 ---
 .../pci/atomisp2/css2400/ia_css_frame_public.h     |  39 +++---
 .../atomisp/pci/atomisp2/css2400/ia_css_pipe.h     | 138 ++++++++-------------
 .../pci/atomisp2/css2400/ia_css_pipe_public.h      | 118 +++---------------
 .../atomisp/pci/atomisp2/css2400/ia_css_types.h    |  79 ++++--------
 .../isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h     |  50 +-------
 .../kernels/sdis/common/ia_css_sdis_common_types.h |  34 ++---
 .../isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c   |   3 +-
 .../runtime/binary/interface/ia_css_binary.h       |  93 ++------------
 .../atomisp2/css2400/runtime/binary/src/binary.c   |   3 +-
 .../isp_param/interface/ia_css_isp_param_types.h   |  10 --
 .../runtime/pipeline/interface/ia_css_pipeline.h   |  29 ++---
 .../css2400/runtime/pipeline/src/pipeline.c        |   7 +-
 .../media/atomisp/pci/atomisp2/css2400/sh_css.c    |  31 ++---
 .../atomisp/pci/atomisp2/css2400/sh_css_legacy.h   |  11 --
 .../atomisp/pci/atomisp2/css2400/sh_css_metrics.h  |  21 ----
 16 files changed, 160 insertions(+), 522 deletions(-)


base-commit: 37cb8e1f8e10c6e9bd2a1b95cdda0620a21b0551
-- 
2.15.0

^ permalink raw reply	[flat|nested] 53+ messages in thread

* [PATCH v2 1/3] media: atomisp: convert default struct values to use compound-literals with designated initializers.
  2017-12-01 17:19                       ` [PATCH v2 0/3] media: atomisp: clean up of data-structure initialization in the CSS API Jeremy Sowden
@ 2017-12-01 17:19                         ` Jeremy Sowden
  2017-12-02 10:20                           ` Dan Carpenter
  2017-12-01 17:19                         ` [PATCH v2 2/3] media: atomisp: delete zero-valued struct members Jeremy Sowden
  2017-12-01 17:19                         ` [PATCH v2 3/3] media: atomisp: delete empty default struct values Jeremy Sowden
  2 siblings, 1 reply; 53+ messages in thread
From: Jeremy Sowden @ 2017-12-01 17:19 UTC (permalink / raw)
  To: linux-media, devel; +Cc: Jeremy Sowden

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.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 .../hive_isp_css_common/input_formatter_global.h   |  31 ++--
 .../pci/atomisp2/css2400/ia_css_frame_public.h     |  56 ++++---
 .../atomisp/pci/atomisp2/css2400/ia_css_pipe.h     | 173 +++++++++++----------
 .../pci/atomisp2/css2400/ia_css_pipe_public.h      | 159 +++++++++----------
 .../atomisp/pci/atomisp2/css2400/ia_css_types.h    |  98 ++++++------
 .../isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h     | 149 +++++++++++++-----
 .../kernels/sdis/common/ia_css_sdis_common_types.h |  96 +++++++++---
 .../isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c   |   3 +-
 .../runtime/binary/interface/ia_css_binary.h       | 155 +++++++++---------
 .../atomisp2/css2400/runtime/binary/src/binary.c   |   3 +-
 .../isp_param/interface/ia_css_isp_param_types.h   |  32 ++--
 .../runtime/pipeline/interface/ia_css_pipeline.h   |  35 +++--
 .../css2400/runtime/pipeline/src/pipeline.c        |   7 +-
 .../media/atomisp/pci/atomisp2/css2400/sh_css.c    |  22 +--
 .../atomisp/pci/atomisp2/css2400/sh_css_legacy.h   |  21 +--
 .../atomisp/pci/atomisp2/css2400/sh_css_metrics.h  |  36 ++---
 16 files changed, 613 insertions(+), 463 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/input_formatter_global.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/input_formatter_global.h
index 5654d911db65..5e19b5bd56e6 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/input_formatter_global.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/input_formatter_global.h
@@ -107,21 +107,22 @@ struct input_formatter_cfg_s {
 	uint32_t	block_no_reqs;
 };
 
-#define DEFAULT_IF_CONFIG \
-{ \
-	0,          /* start_line */\
-	0,          /* start_column */\
-	0,          /* left_padding */\
-	0,          /* cropped_height */\
-	0,          /* cropped_width */\
-	0,          /* deinterleaving */\
-	0,          /*.buf_vecs */\
-	0,          /* buf_start_index */\
-	0,          /* buf_increment */\
-	0,          /* buf_eol_offset */\
-	false,      /* is_yuv420_format */\
-	false       /* block_no_reqs */\
-}
+#define DEFAULT_IF_CONFIG ( \
+	(struct input_formatter_cfg_s) { \
+		.start_line		= 0, \
+		.start_column		= 0, \
+		.left_padding		= 0, \
+		.cropped_height		= 0, \
+		.cropped_width		= 0, \
+		.deinterleaving		= 0, \
+		.buf_vecs		= 0, \
+		.buf_start_index	= 0, \
+		.buf_increment		= 0, \
+		.buf_eol_offset		= 0, \
+		.is_yuv420_format	= false, \
+		.block_no_reqs		= false \
+	} \
+)
 
 extern const hrt_address HIVE_IF_SRST_ADDRESS[N_INPUT_FORMATTER_ID];
 extern const hrt_data HIVE_IF_SRST_MASK[N_INPUT_FORMATTER_ID];
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_frame_public.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_frame_public.h
index 92f2389176b2..56527feeb558 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_frame_public.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_frame_public.h
@@ -120,17 +120,22 @@ struct ia_css_frame_info {
 	struct ia_css_crop_info crop_info;
 };
 
-#define IA_CSS_BINARY_DEFAULT_FRAME_INFO \
-{ \
-	{0,                      /* width */ \
-	 0},                     /* height */ \
-	0,                       /* padded_width */ \
-	IA_CSS_FRAME_FORMAT_NUM, /* format */ \
-	0,                       /* raw_bit_depth */ \
-	IA_CSS_BAYER_ORDER_NUM,  /* raw_bayer_order */ \
-	{0,                       /*start col */ \
-	 0},                       /*start line */ \
-}
+#define IA_CSS_BINARY_DEFAULT_FRAME_INFO ( \
+	(struct ia_css_frame_info) { \
+		.res			= (struct ia_css_resolution) { \
+						.width = 0, \
+						.height = 0 \
+					}, \
+		.padded_width		= 0, \
+		.format			= IA_CSS_FRAME_FORMAT_NUM,  \
+		.raw_bit_depth		= 0, \
+		.raw_bayer_order	= IA_CSS_BAYER_ORDER_NUM, \
+		.crop_info		= (struct ia_css_crop_info) { \
+						.start_column	= 0, \
+						.start_line	= 0 \
+					}, \
+	} \
+)
 
 /**
  *  Specifies the DVS loop delay in "frame periods"
@@ -189,20 +194,21 @@ struct ia_css_frame {
 		       info.format */
 };
 
-#define DEFAULT_FRAME \
-{ \
-	IA_CSS_BINARY_DEFAULT_FRAME_INFO,	/* info */ \
-	0,					/* data */ \
-	0,					/* data_bytes */ \
-	SH_CSS_INVALID_QUEUE_ID,		/* dynamic_data_index */ \
-	IA_CSS_BUFFER_TYPE_INVALID,			/* buf_type */ \
-	IA_CSS_FRAME_FLASH_STATE_NONE,		/* flash_state */ \
-	0,					/* exp_id */ \
-	0,					/* isp_config_id */ \
-	false,					/* valid */ \
-	false,					/* contiguous  */ \
-	{ 0 }					/* planes */ \
-}
+#define DEFAULT_FRAME ( \
+	(struct ia_css_frame) { \
+		.info			= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
+		.data			= 0, \
+		.data_bytes		= 0, \
+		.dynamic_queue_id	= SH_CSS_INVALID_QUEUE_ID, \
+		.buf_type		= IA_CSS_BUFFER_TYPE_INVALID, \
+		.flash_state		= IA_CSS_FRAME_FLASH_STATE_NONE, \
+		.exp_id			= 0, \
+		.isp_config_id		= 0, \
+		.valid			= false, \
+		.contiguous		= false, \
+		.planes			= { 0 } \
+	} \
+)
 
 /** @brief Fill a frame with zeros
  *
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h
index d0c0e6b92025..bfebfd8d6e63 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h
@@ -33,23 +33,24 @@ struct ia_css_preview_settings {
 	/* 2401 only for these two - do we in fact use them for anything real */
 	struct ia_css_frame *delay_frames[MAX_NUM_DELAY_FRAMES];
 	struct ia_css_frame *tnr_frames[NUM_TNR_FRAMES];
-	
+
 	struct ia_css_pipe *copy_pipe;
 	struct ia_css_pipe *capture_pipe;
 	struct ia_css_pipe *acc_pipe;
 };
 
-#define IA_CSS_DEFAULT_PREVIEW_SETTINGS \
-{ \
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* copy_binary */\
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* preview_binary */\
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* vf_pp_binary */\
-	{ NULL },			/* dvs_frames */ \
-	{ NULL },			/* tnr_frames */ \
-	NULL,				/* copy_pipe */\
-	NULL,				/* capture_pipe */\
-	NULL,				/* acc_pipe */\
-}
+#define IA_CSS_DEFAULT_PREVIEW_SETTINGS  ( \
+	(struct ia_css_preview_settings) { \
+		.copy_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+		.preview_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+		.vf_pp_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+		.delay_frames	= { NULL }, \
+		.tnr_frames	= { NULL }, \
+		.copy_pipe	= NULL, \
+		.capture_pipe	= NULL, \
+		.acc_pipe	= NULL, \
+	} \
+)
 
 struct ia_css_capture_settings {
 	struct ia_css_binary copy_binary;
@@ -69,22 +70,23 @@ struct ia_css_capture_settings {
 	unsigned int num_yuv_scaler;
 };
 
-#define IA_CSS_DEFAULT_CAPTURE_SETTINGS \
-{ \
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* copy_binary */\
-	{IA_CSS_BINARY_DEFAULT_SETTINGS},	/* primary_binary */\
-	0,				/* num_primary_stage */\
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* pre_isp_binary */\
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* anr_gdc_binary */\
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* post_isp_binary */\
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* capture_pp_binary */\
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* vf_pp_binary */\
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* capture_ldc_binary */\
-	NULL,				/* yuv_scaler_binary */ \
-	{ NULL },			/* delay_frames[ref_frames] */ \
-	NULL,				/* is_output_stage */ \
-	0,				/* num_yuv_scaler */ \
-}
+#define IA_CSS_DEFAULT_CAPTURE_SETTINGS ( \
+	(struct ia_css_capture_settings) { \
+		.copy_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+		.primary_binary		= {IA_CSS_BINARY_DEFAULT_SETTINGS}, \
+		.num_primary_stage	= 0, \
+		.pre_isp_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+		.anr_gdc_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+		.post_isp_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+		.capture_pp_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+		.vf_pp_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+		.capture_ldc_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+		.yuv_scaler_binary	= NULL, \
+		.delay_frames		= { NULL }, \
+		.is_output_stage	= NULL, \
+		.num_yuv_scaler		= 0, \
+	} \
+)
 
 struct ia_css_video_settings {
 	struct ia_css_binary copy_binary;
@@ -104,20 +106,21 @@ struct ia_css_video_settings {
 	unsigned int num_yuv_scaler;
 };
 
-#define IA_CSS_DEFAULT_VIDEO_SETTINGS \
-{ \
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* copy_binary */ \
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* video_binary */ \
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* vf_pp_binary */ \
-	NULL,				/* yuv_scaler_binary */ \
-	{ NULL },			/* delay_frames */ \
-	{ NULL },			/* tnr_frames */ \
-	NULL,				/* vf_pp_in_frame */ \
-	NULL,				/* copy_pipe */ \
-	NULL,				/* capture_pipe */ \
-	NULL,				/* is_output_stage */ \
-	0,				/* num_yuv_scaler */ \
-}
+#define IA_CSS_DEFAULT_VIDEO_SETTINGS ( \
+	(struct ia_css_video_settings) { \
+		.copy_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+		.video_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+		.vf_pp_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+		.yuv_scaler_binary	= NULL, \
+		.delay_frames		= { NULL }, \
+		.tnr_frames		= { NULL }, \
+		.vf_pp_in_frame		= NULL, \
+		.copy_pipe		= NULL, \
+		.capture_pipe		= NULL, \
+		.is_output_stage	= NULL, \
+		.num_yuv_scaler		= 0, \
+	} \
+)
 
 struct ia_css_yuvpp_settings {
 	struct ia_css_binary copy_binary;
@@ -129,16 +132,17 @@ struct ia_css_yuvpp_settings {
 	unsigned int num_output;
 };
 
-#define IA_CSS_DEFAULT_YUVPP_SETTINGS \
-{ \
-	IA_CSS_BINARY_DEFAULT_SETTINGS,		/* copy_binary */ \
-	NULL,					/* yuv_scaler_binary */ \
-	NULL,					/* vf_pp_binary */ \
-	NULL,					/* is_output_stage */ \
-	0,					/* num_yuv_scaler */ \
-	0,					/* num_vf_pp */ \
-	0,					/* num_output */ \
-}
+#define IA_CSS_DEFAULT_YUVPP_SETTINGS ( \
+	(struct ia_css_yuvpp_settings) { \
+		.copy_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+		.yuv_scaler_binary	= NULL, \
+		.vf_pp_binary		= NULL, \
+		.is_output_stage	= NULL, \
+		.num_yuv_scaler		= 0, \
+		.num_vf_pp		= 0, \
+		.num_output		= 0, \
+	} \
+)
 
 struct osys_object;
 
@@ -184,37 +188,40 @@ struct ia_css_pipe {
 	unsigned int pipe_num;
 };
 
-#define IA_CSS_DEFAULT_PIPE \
-{ \
-	false,					/* stop_requested */ \
-	DEFAULT_PIPE_CONFIG,			/* config */ \
-	DEFAULT_PIPE_EXTRA_CONFIG,		/* extra_config */ \
-	DEFAULT_PIPE_INFO,			/* info */ \
-	IA_CSS_PIPE_ID_ACC,			/* mode (pipe_id) */ \
-	NULL,					/* shading_table */ \
-	DEFAULT_PIPELINE,			/* pipeline */ \
-	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* output_info */ \
-	IA_CSS_BINARY_DEFAULT_FRAME_INFO,	/* bds_output_info */ \
-	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* vf_output_info */ \
-	IA_CSS_BINARY_DEFAULT_FRAME_INFO,	/* out_yuv_ds_input_info */ \
-	IA_CSS_BINARY_DEFAULT_FRAME_INFO,	/* vf_yuv_ds_input_info */ \
-	NULL,					/* output_stage */ \
-	NULL,					/* vf_stage */ \
-	SH_CSS_BDS_FACTOR_1_00,			/* required_bds_factor */ \
-	1,					/* dvs_frame_delay */ \
-	0,					/* num_invalid_frames */ \
-	{true},					/* enable_viewfinder */ \
-	NULL,					/* stream */ \
-	DEFAULT_FRAME,				/* in_frame_struct */ \
-	DEFAULT_FRAME,				/* out_frame_struct */ \
-	DEFAULT_FRAME,				/* vf_frame_struct */ \
-	{ NULL },				/* continuous_frames */ \
-	{ NULL },				/* cont_md_buffers */ \
-	{ IA_CSS_DEFAULT_PREVIEW_SETTINGS },	/* pipe_settings */ \
-	0,					/* scaler_pp_lut */ \
-	NULL,					/* osys object */ \
-	PIPE_ENTRY_EMPTY_TOKEN,			/* pipe_num */\
-}
+#define IA_CSS_DEFAULT_PIPE ( \
+	(struct ia_css_pipe) { \
+		.stop_requested		= false, \
+		.config			= DEFAULT_PIPE_CONFIG, \
+		.extra_config		= DEFAULT_PIPE_EXTRA_CONFIG, \
+		.info			= DEFAULT_PIPE_INFO, \
+		.mode			= IA_CSS_PIPE_ID_ACC, /* (pipe_id) */ \
+		.shading_table		= NULL, \
+		.pipeline		= DEFAULT_PIPELINE, \
+		.output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
+		.bds_output_info	= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
+		.vf_output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
+		.out_yuv_ds_input_info	= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
+		.vf_yuv_ds_input_info	= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
+		.output_stage		= NULL, \
+		.vf_stage		= NULL, \
+		.required_bds_factor	= SH_CSS_BDS_FACTOR_1_00, \
+		.dvs_frame_delay	= 1, \
+		.num_invalid_frames	= 0, \
+		.enable_viewfinder	= {true}, \
+		.stream			= NULL, \
+		.in_frame_struct	= DEFAULT_FRAME, \
+		.out_frame_struct	= DEFAULT_FRAME, \
+		.vf_frame_struct	= DEFAULT_FRAME, \
+		.continuous_frames	= { NULL }, \
+		.cont_md_buffers	= { NULL }, \
+		.pipe_settings		= { \
+			.preview = IA_CSS_DEFAULT_PREVIEW_SETTINGS \
+		}, \
+		.scaler_pp_lut		= 0, \
+		.osys_obj		= NULL, \
+		.pipe_num		= PIPE_ENTRY_EMPTY_TOKEN, \
+	} \
+)
 
 void ia_css_pipe_map_queue(struct ia_css_pipe *pipe, bool map);
 
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe_public.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe_public.h
index 733e0ef3afe8..b23e23cdf086 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe_public.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe_public.h
@@ -156,75 +156,76 @@ struct ia_css_pipe_config {
 /**
  * Default origin of internal frame positioned on shading table.
  */
-#define IA_CSS_PIPE_DEFAULT_INTERNAL_FRAME_ORIGIN_BQS_ON_SCTBL \
-{ \
-	0,					/* x [bqs] */ \
-	0					/* y [bqs] */ \
-}
+#define IA_CSS_PIPE_DEFAULT_INTERNAL_FRAME_ORIGIN_BQS_ON_SCTBL ( \
+	(struct ia_css_coordinate) { .x = 0, .y = 0 } \
+)
 
 /**
  * Default settings for newly created pipe configurations.
  */
-#define DEFAULT_PIPE_CONFIG \
-{ \
-	IA_CSS_PIPE_MODE_PREVIEW,		/* mode */ \
-	1,					/* isp_pipe_version */ \
-	{ 0, 0 },				/* pipe_effective_input_res */ \
-	{ 0, 0 },				/* bayer_ds_out_res */ \
-	{ 0, 0 },				/* vf_pp_in_res */ \
-	{ 0, 0 },				/* capt_pp_in_res */ \
-	{ 0, 0 },				/* output_system_in_res */ \
-	{ 0, 0 },				/* dvs_crop_out_res */ \
-	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* output_info */ \
-	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* vf_output_info */ \
-	NULL,					/* acc_extension */ \
-	NULL,					/* acc_stages */ \
-	0,					/* num_acc_stages */ \
-	DEFAULT_CAPTURE_CONFIG,			/* default_capture_config */ \
-	{ 0, 0 },				/* dvs_envelope */ \
-	IA_CSS_FRAME_DELAY_1,			/* dvs_frame_delay */ \
-	-1,					/* acc_num_execs */ \
-	false,					/* enable_dz */ \
-	false,					/* enable_dpc */ \
-	false,					/* enable_vfpp_bci */ \
-	false,					/* enable_luma_only */ \
-	false,					/* enable_tnr */ \
-	NULL,					/* p_isp_config */\
-	{ 0, 0 },				/* gdc_in_buffer_res */ \
-	{ 0, 0 },				/* gdc_in_buffer_offset */ \
-	IA_CSS_PIPE_DEFAULT_INTERNAL_FRAME_ORIGIN_BQS_ON_SCTBL	/* internal_frame_origin_bqs_on_sctbl */ \
-}
+#define DEFAULT_PIPE_CONFIG ( \
+	(struct ia_css_pipe_config) { \
+		.mode			= IA_CSS_PIPE_MODE_PREVIEW, \
+		.isp_pipe_version	= 1, \
+		.input_effective_res	= { 0, 0 }, \
+		.bayer_ds_out_res	= { 0, 0 }, \
+		.capt_pp_in_res		= { 0, 0 }, \
+		.vf_pp_in_res		= { 0, 0 }, \
+		.output_system_in_res	= { 0, 0 }, \
+		.dvs_crop_out_res	= { 0, 0 }, \
+		.output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
+		.vf_output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
+		.acc_extension		= NULL, \
+		.acc_stages		= NULL, \
+		.num_acc_stages		= 0, \
+		.default_capture_config	= DEFAULT_CAPTURE_CONFIG, \
+		.dvs_envelope		= { 0, 0 }, \
+		.dvs_frame_delay	= IA_CSS_FRAME_DELAY_1, \
+		.acc_num_execs		= -1, \
+		.enable_dz		= false, \
+		.enable_dpc		= false, \
+		.enable_vfpp_bci	= false, \
+		.enable_luma_only	= false, \
+		.enable_tnr		= false, \
+		.p_isp_config		= NULL, \
+		.gdc_in_buffer_res	= { 0, 0 }, \
+		.gdc_in_buffer_offset	= { 0, 0 }, \
+		.internal_frame_origin_bqs_on_sctbl \
+					= IA_CSS_PIPE_DEFAULT_INTERNAL_FRAME_ORIGIN_BQS_ON_SCTBL \
+	} \
+)
 
 #else
 
 /**
  * Default settings for newly created pipe configurations.
  */
-#define DEFAULT_PIPE_CONFIG \
-{ \
-	IA_CSS_PIPE_MODE_PREVIEW,		/* mode */ \
-	1,					/* isp_pipe_version */ \
-	{ 0, 0 },				/* pipe_effective_input_res */ \
-	{ 0, 0 },				/* bayer_ds_out_res */ \
-	{ 0, 0 },				/* vf_pp_in_res */ \
-	{ 0, 0 },				/* capt_pp_in_res */ \
-	{ 0, 0 },				/* dvs_crop_out_res */ \
-	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* output_info */ \
-	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* vf_output_info */ \
-	NULL,					/* acc_extension */ \
-	NULL,					/* acc_stages */ \
-	0,					/* num_acc_stages */ \
-	DEFAULT_CAPTURE_CONFIG,			/* default_capture_config */ \
-	{ 0, 0 },				/* dvs_envelope */ \
-	IA_CSS_FRAME_DELAY_1,			/* dvs_frame_delay */ \
-	-1,					/* acc_num_execs */ \
-	false,					/* enable_dz */ \
-	false,					/* enable_dpc */ \
-	false,					/* enable_vfpp_bci */ \
-	NULL,					/* p_isp_config */\
-	{ 0, 0 },				/* gdc_in_buffer_res */ \
-	{ 0, 0 }				/* gdc_in_buffer_offset */ \
-}
+#define DEFAULT_PIPE_CONFIG ( \
+	(struct ia_css_pipe_config) { \
+		.mode			= IA_CSS_PIPE_MODE_PREVIEW, \
+		.isp_pipe_version	= 1, \
+		.input_effective_res	= { 0, 0 }, \
+		.bayer_ds_out_res	= { 0, 0 }, \
+		.capt_pp_in_res		= { 0, 0 }, \
+		.vf_pp_in_res		= { 0, 0 }, \
+		.dvs_crop_out_res	= { 0, 0 }, \
+		.output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
+		.vf_output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
+		.acc_extension		= NULL, \
+		.acc_stages		= NULL, \
+		.num_acc_stages		= 0, \
+		.default_capture_config	= DEFAULT_CAPTURE_CONFIG, \
+		.dvs_envelope		= { 0, 0 }, \
+		.dvs_frame_delay	= IA_CSS_FRAME_DELAY_1, \
+		.acc_num_execs		= -1, \
+		.enable_dz		= false, \
+		.enable_dpc		= false, \
+		.enable_vfpp_bci	= false, \
+		.p_isp_config		= NULL, \
+		.gdc_in_buffer_res	= { 0, 0 }, \
+		.gdc_in_buffer_offset	= { 0, 0 } \
+	} \
+)
 
 #endif
 
@@ -274,28 +275,30 @@ struct ia_css_pipe_info {
  */
 #ifdef ISP2401
 
-#define DEFAULT_PIPE_INFO \
-{ \
-	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* output_info */ \
-	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* vf_output_info */ \
-	IA_CSS_BINARY_DEFAULT_FRAME_INFO,	/* raw_output_info */ \
-	{ 0, 0},				/* output system in res */ \
-	DEFAULT_SHADING_INFO,			/* shading_info */ \
-	DEFAULT_GRID_INFO,			/* grid_info */ \
-	0					/* num_invalid_frames */ \
-}
+#define DEFAULT_PIPE_INFO ( \
+	(struct ia_css_pipe_info) { \
+		.output_info			= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
+		.vf_output_info			= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
+		.raw_output_info		= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
+		.output_system_in_res_info	= { 0, 0 }, \
+		.shading_info			= DEFAULT_SHADING_INFO, \
+		.grid_info			= DEFAULT_GRID_INFO, \
+		.num_invalid_frames		= 0 \
+	} \
+)
 
 #else
 
-#define DEFAULT_PIPE_INFO \
-{ \
-	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* output_info */ \
-	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* vf_output_info */ \
-	IA_CSS_BINARY_DEFAULT_FRAME_INFO,	/* raw_output_info */ \
-	DEFAULT_SHADING_INFO,			/* shading_info */ \
-	DEFAULT_GRID_INFO,			/* grid_info */ \
-	0					/* num_invalid_frames */ \
-}
+#define DEFAULT_PIPE_INFO ( \
+	(struct ia_css_pipe_info) { \
+		.output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
+		.vf_output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
+		.raw_output_info	= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
+		.shading_info		= DEFAULT_SHADING_INFO, \
+		.grid_info		= DEFAULT_GRID_INFO, \
+		.num_invalid_frames	= 0 \
+	} \
+)
 
 #endif
 
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h
index 5fec3d5c89d8..506f92bbc226 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h
@@ -373,46 +373,48 @@ struct ia_css_shading_info {
 #ifndef ISP2401
 
 /** Default Shading Correction information of Shading Correction Type 1. */
-#define DEFAULT_SHADING_INFO_TYPE_1 \
-{ \
-	IA_CSS_SHADING_CORRECTION_TYPE_1,	/* type */ \
-	{					/* info */ \
-		{ \
-			0,	/* enable */ \
-			0,	/* num_hor_grids */ \
-			0,	/* num_ver_grids */ \
-			0,	/* bqs_per_grid_cell */ \
-			1,	/* bayer_scale_hor_ratio_in */ \
-			1,	/* bayer_scale_hor_ratio_out */ \
-			1,	/* bayer_scale_ver_ratio_in */ \
-			1,	/* bayer_scale_ver_ratio_out */ \
-			0,	/* sc_bayer_origin_x_bqs_on_shading_table */ \
-			0	/* sc_bayer_origin_y_bqs_on_shading_table */ \
+#define DEFAULT_SHADING_INFO_TYPE_1 ( \
+	(struct ia_css_shading_info) { \
+		.type = IA_CSS_SHADING_CORRECTION_TYPE_1, \
+		.info = { \
+			.type_1 = { \
+				.enable					= 0, \
+				.num_hor_grids				= 0, \
+				.num_ver_grids				= 0, \
+				.bqs_per_grid_cell			= 0, \
+				.bayer_scale_hor_ratio_in		= 1, \
+				.bayer_scale_hor_ratio_out		= 1, \
+				.bayer_scale_ver_ratio_in		= 1, \
+				.bayer_scale_ver_ratio_out		= 1, \
+				.sc_bayer_origin_x_bqs_on_shading_table	= 0, \
+				.sc_bayer_origin_y_bqs_on_shading_table	= 0 \
+			} \
 		} \
 	} \
-}
+)
 
 #else
 
 /** Default Shading Correction information of Shading Correction Type 1. */
-#define DEFAULT_SHADING_INFO_TYPE_1 \
-{ \
-	IA_CSS_SHADING_CORRECTION_TYPE_1,	/* type */ \
-	{					/* info */ \
-		{ \
-			0,			/* num_hor_grids */ \
-			0,			/* num_ver_grids */ \
-			0,			/* bqs_per_grid_cell */ \
-			1,			/* bayer_scale_hor_ratio_in */ \
-			1,			/* bayer_scale_hor_ratio_out */ \
-			1,			/* bayer_scale_ver_ratio_in */ \
-			1,			/* bayer_scale_ver_ratio_out */ \
-			{0, 0},			/* isp_input_sensor_data_res_bqs */ \
-			{0, 0},			/* sensor_data_res_bqs */ \
-			{0, 0}			/* sensor_data_origin_bqs_on_sctbl */ \
+#define DEFAULT_SHADING_INFO_TYPE_1 ( \
+	(struct ia_css_shading_info) { \
+		.type = IA_CSS_SHADING_CORRECTION_TYPE_1, \
+		.info = { \
+			.type_1 = { \
+				.num_hor_grids				= 0, \
+				.num_ver_grids				= 0, \
+				.bqs_per_grid_cell			= 0, \
+				.bayer_scale_hor_ratio_in		= 1, \
+				.bayer_scale_hor_ratio_out		= 1, \
+				.bayer_scale_ver_ratio_in		= 1, \
+				.bayer_scale_ver_ratio_out		= 1, \
+				.isp_input_sensor_data_res_bqs		= {0, 0}, \
+				.sensor_data_res_bqs			= {0, 0}, \
+				.sensor_data_origin_bqs_on_sctbl	= {0, 0} \
+			} \
 		} \
 	} \
-}
+)
 
 #endif
 
@@ -437,14 +439,15 @@ struct ia_css_grid_info {
 };
 
 /** defaults for ia_css_grid_info structs */
-#define DEFAULT_GRID_INFO \
-{ \
-	0,				/* isp_in_width */ \
-	0,				/* isp_in_height */ \
-	DEFAULT_3A_GRID_INFO,		/* s3a_grid */ \
-	DEFAULT_DVS_GRID_INFO,		/* dvs_grid */ \
-	IA_CSS_VAMEM_TYPE_1		/* vamem_type */ \
-}
+#define DEFAULT_GRID_INFO ( \
+	(struct ia_css_grid_info) { \
+		.isp_in_width	= 0, \
+		.isp_in_height	= 0, \
+		.s3a_grid	= DEFAULT_3A_GRID_INFO, \
+		.dvs_grid	= DEFAULT_DVS_GRID_INFO, \
+		.vamem_type	= IA_CSS_VAMEM_TYPE_1 \
+	} \
+)
 
 /** Morphing table, used for geometric distortion and chromatic abberration
  *  correction (GDCAC, also called GDC).
@@ -533,13 +536,14 @@ struct ia_css_capture_config {
 };
 
 /** default settings for ia_css_capture_config structs */
-#define DEFAULT_CAPTURE_CONFIG \
-{ \
-	IA_CSS_CAPTURE_MODE_PRIMARY,	/* mode (capture) */ \
-	false,				/* enable_xnr */ \
-	false,				/* enable_raw_output */ \
-	false				/* enable_capture_pp_bli */ \
-}
+#define DEFAULT_CAPTURE_CONFIG ( \
+	(struct ia_css_capture_config) { \
+		.mode			= IA_CSS_CAPTURE_MODE_PRIMARY, \
+		.enable_xnr		= false, \
+		.enable_raw_output	= false, \
+		.enable_capture_pp_bli	= false \
+	} \
+)
 
 
 /** ISP filter configuration. This is a collection of configurations
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h
index f57ed1ec5981..76316fbabbd5 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h
@@ -28,7 +28,7 @@
 /** 3A configuration. This configures the 3A statistics collection
  *  module.
  */
- 
+
 /** 3A statistics grid
  *
  *  ISP block: S3A1 (3A Support for 3A ver.1 (Histogram is not used for AE))
@@ -54,7 +54,7 @@ struct ia_css_3a_grid_info {
   	uint32_t awb_fr_enable;					/**< awb_fr enabled in binary,
 								   0:disabled, 1:enabled */
 	struct awb_fr_public_grid_config	awb_fr_grd_info;/**< see description in awb_fr_public.h*/
-  
+
         uint32_t elem_bit_depth;    /**< TODO:Taken from BYT  - need input from AIQ
 					if needed for SKC
 					Bit depth of element used
@@ -100,47 +100,118 @@ struct ia_css_3a_grid_info {
 
 #if defined(SYSTEM_css_skycam_c0_system)
 #if defined USE_NEW_AE_STRUCT || defined USE_NEW_AWB_STRUCT
-#define DEFAULT_3A_GRID_INFO \
-{ \
-	0,				/* ae_enable */ \
-	{0,0,0,0,0,0,0},	        /* AE:     width,height,b_width,b_height,x_start,y_start*/ \
-	0,				/* awb_enable */ \
-	{0,0,0,0,0,0},			/* AWB:    width,height,b_width,b_height,x_start,y_start*/ \
-	0,				/* af_enable */ \
-	{0,0,0,0,0,0,0},		/* AF:     width,height,b_width,b_height,x_start,y_start,ff_en*/ \
-	0,				/* awb_fr_enable */ \
-	{0,0,0,0,0,0,0},                  /* AWB_FR: width,height,b_width,b_height,x_start,y_start,ff_en*/ \
-	0,				/* elem_bit_depth */ \
-}
+#define DEFAULT_3A_GRID_INFO ( \
+	(struct ia_css_3a_grid_info) { \
+		.ae_enable		= 0, \
+		.ae_grd_info		= (struct ae_public_config_grid_config) { \
+						.width = 0, \
+						.height = 0, \
+						.b_width = 0, \
+						.b_height = 0, \
+						.x_start = 0, \
+						.y_start = 0, \
+						.x_end = 0, \
+						.y_end = 0 \
+					  } \
+		.awb_enable		= 0, \
+		.awb_grd_info		= (struct awb_public_config_grid_config) { \
+						.width = 0, \
+						.height = 0, \
+						.b_width = 0, \
+						.b_height = 0, \
+						.x_start = 0, \
+						.y_start = 0, \
+						.x_end = 0, \
+						.y_end = 0 \
+					  }	\
+		.af_enable		= 0, \
+		.af_grd_info		= (struct af_public_grid_config) { \
+						.width = 0, \
+						.height = 0, \
+						.b_width = 0, \
+						.b_height = 0, \
+						.x_start = 0, \
+						.y_start = 0, \
+						.ff_en = 0 \
+					  } \
+		.awb_fr_enable		= 0, \
+		.awb_fr_grd_info	= (struct awb_fr_public_grid_config) { \
+						.width = 0, \
+						.height = 0, \
+						.b_width = 0, \
+						.b_height = 0, \
+						.x_start = 0, \
+						.y_start = 0, \
+						.ff_en = 0 \
+					  } \
+		.elem_bit_depth		= 0, \
+	} \
+)
 #else
-#define DEFAULT_3A_GRID_INFO \
-{ \
-	0,				/* ae_enable */ \
-	{0,0,0,0,0,0,0,0,0},	        /* AE:     width,height,b_width,b_height,x_start,y_start,x_end,y_end*/ \
-	0,				/* awb_enable */ \
-	{0,0,0,0,0,0,0,0},              /* AWB:    width,height,b_width,b_height,x_start,y_start,x_end,y_end*/ \
-	0,				/* af_enable */ \
-	{0,0,0,0,0,0,0},		/* AF:     width,height,b_width,b_height,x_start,y_start,ff_en*/ \
-	0,				/* awb_fr_enable */ \
-	{0,0,0,0,0,0,0},                  /* AWB_FR: width,height,b_width,b_height,x_start,y_start,ff_en*/ \
-	0,				/* elem_bit_depth */ \
-}
+#define DEFAULT_3A_GRID_INFO ( \
+	(struct ia_css_3a_grid_info) { \
+		.ae_enable		= 0, \
+		.ae_grd_info		= (struct ae_public_config_grid_config) { \
+						.width = 0, \
+						.height = 0, \
+						.b_width = 0, \
+						.b_height = 0, \
+						.x_start = 0, \
+						.y_start = 0, \
+						.x_end = 0, \
+						.y_end = 0 \
+					  } \
+		.awb_enable		= 0, \
+		.awb_grd_info		= (struct awb_public_config_grid_config) { \
+						.width = 0, \
+						.height = 0, \
+						.b_width = 0, \
+						.b_height = 0, \
+						.x_start = 0, \
+						.y_start = 0, \
+						.x_end = 0, \
+						.y_end = 0 \
+					  }	\
+		.af_enable		= 0, \
+		.af_grd_info		= (struct af_public_grid_config) { \
+						.width = 0, \
+						.height = 0, \
+						.b_width = 0, \
+						.b_height = 0, \
+						.x_start = 0, \
+						.y_start = 0, \
+						.ff_en = 0 \
+					  } \
+		.awb_fr_enable		= 0, \
+		.awb_fr_grd_info	= (struct awb_fr_public_grid_config) { \
+						.width = 0, \
+						.height = 0, \
+						.b_width = 0, \
+						.b_height = 0, \
+						.x_start = 0, \
+						.y_start = 0, \
+						.ff_en = 0 \
+					  } \
+		.elem_bit_depth		= 0, \
+	} \
+)
 #endif /* USE_NEW_AE_STRUCT || defined USE_NEW_AWB_STRUCT */
 
 #else
-#define DEFAULT_3A_GRID_INFO \
-{ \
-	0,				/* enable */ \
-	0,				/* use_dmem */ \
-	0,				/* has_histogram */ \
-	0,				/* width */ \
-	0,				/* height */ \
-	0,				/* aligned_width */ \
-	0,				/* aligned_height */ \
-	0,				/* bqs_per_grid_cell */ \
-	0,				/* deci_factor_log2 */ \
-	0,				/* elem_bit_depth */ \
-}
+#define DEFAULT_3A_GRID_INFO ( \
+	(struct ia_css_3a_grid_info) { \
+		.enable			= 0, \
+		.use_dmem		= 0, \
+		.has_histogram		= 0, \
+		.width			= 0, \
+		.height			= 0, \
+		.aligned_width		= 0, \
+		.aligned_height		= 0, \
+		.bqs_per_grid_cell	= 0, \
+		.deci_factor_log2	= 0, \
+		.elem_bit_depth		= 0, \
+	} \
+)
 
 #endif
 
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h
index 295dc60b778c..4365049f0049 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h
@@ -41,19 +41,24 @@ struct ia_css_sdis_info {
 	uint32_t deci_factor_log2;
 };
 
-#define IA_CSS_DEFAULT_SDIS_INFO \
-	{	\
-		{	{ 0, 0 },	/* dim */ \
-			{ 0, 0 },	/* pad */ \
-		},	/* grid */ \
-		{	{ 0, 0 },	/* dim */ \
-			{ 0, 0 },	/* pad */ \
-		},	/* coef */ \
-		{	{ 0, 0 },	/* dim */ \
-			{ 0, 0 },	/* pad */ \
-		},	/* proj */ \
-		0,	/* dis_deci_factor_log2 */ \
-	}
+#define IA_CSS_DEFAULT_SDIS_INFO ( \
+	(struct ia_css_sdis_info) { \
+		.grid = { \
+			.dim = (struct ia_css_dvs_grid_dim) { .width = 0, .height = 0 }, \
+			.pad = (struct ia_css_dvs_grid_dim) { .width = 0, .height = 0 }, \
+		}, \
+		.coef = { \
+			.dim = (struct ia_css_dvs_grid_dim) { .width = 0, .height = 0 }, \
+			.pad = (struct ia_css_dvs_grid_dim) { .width = 0, .height = 0 }, \
+		}, \
+		.proj = { \
+			.dim = (struct ia_css_dvs_grid_dim) { .width = 0, .height = 0 }, \
+			.pad = (struct ia_css_dvs_grid_dim) { .width = 0, .height = 0 }, \
+		}, \
+		.deci_factor_log2 = 0, \
+	} \
+)
+
 
 /** DVS statistics grid
  *
@@ -209,15 +214,64 @@ struct ia_css_dvs_stat_grid_info {
 
 /** DVS statistics generated by accelerator default grid info
  */
-#define DEFAULT_DVS_GRID_INFO { \
-{ \
-	{ 0, 0, 0},	/* GBL CFG reg: kappa, match_shifrt, binning mode*/ \
-	{{{0, 0, 0, 0}, {0, 0, 0}, {0, 0} }, \
-	{{0, 0, 0, 0}, {0, 0, 0}, {0, 0} }, \
-	{{0, 0, 0, 0}, {0, 0, 0}, {0, 0} } }, \
-	{{0, 0, 0, 0}, {4, 0, 0, 0}, {0, 0, 0, 0} } } \
-}
+#define DEFAULT_DVS_STAT_PUBLIC_DVS_GLOBAL_CFG ( \
+	(struct dvs_stat_public_dvs_global_cfg) { \
+		.kappa		= 0, \
+		.match_shift	= 0, \
+		.ybin_mode	= 0, \
+	} \
+)
+
+#define DEFAULT_DVS_STAT_PUBLIC_DVS_GRD_CFG ( \
+	(struct dvs_stat_public_dvs_grd_cfg) { \
+		.grd_cfg	= (struct dvs_stat_public_dvs_level_grid_cfg) { \
+					.grid_width = 0, \
+					.grid_height = 0, \
+					.block_width = 0, \
+					.block_height = 0 \
+				}, \
+		.grd_start	= (struct dvs_stat_public_dvs_level_grid_start) { \
+					.x_start = 0, \
+					.y_start = 0, \
+					.enable = 0 \
+				}, \
+		.grd_end	= (struct dvs_stat_public_dvs_level_grid_end) { \
+					.x_end = 0, \
+					.y_end = 0, \
+				}, \
+	} \
+)
+
+#define DEFAULT_DVS_STAT_PUBLIC_DVS_LEVEL_FE_ROI_CFG(X_START) ( \
+	(struct dvs_stat_public_dvs_level_fe_roi_cfg) { \
+		.x_start = X_START, \
+		.y_start = 0, \
+		.x_end   = 0, \
+		.y_end   = 0, \
+	} \
+)
+
+#define DEFAULT_DVS_STAT_GRID_INFO ( \
+	(struct ia_css_dvs_stat_grid_info) { \
+		.dvs_gbl_cfg = DEFAULT_DVS_STAT_PUBLIC_DVS_GLOBAL_CFG, \
+		.grd_cfg = { \
+			DEFAULT_DVS_STAT_PUBLIC_DVS_GRD_CFG, \
+			DEFAULT_DVS_STAT_PUBLIC_DVS_GRD_CFG, \
+			DEFAULT_DVS_STAT_PUBLIC_DVS_GRD_CFG \
+		}, \
+		.fe_roi_cfg = { \
+			DEFAULT_DVS_STAT_PUBLIC_DVS_LEVEL_FE_ROI_CFG(0), \
+			DEFAULT_DVS_STAT_PUBLIC_DVS_LEVEL_FE_ROI_CFG(4), \
+			DEFAULT_DVS_STAT_PUBLIC_DVS_LEVEL_FE_ROI_CFG(0), \
+		} \
+	} \
+)
 
+#define DEFAULT_DVS_GRID_INFO ( \
+	(union ia_css_dvs_grid_u) { \
+		.dvs_stat_grid_info = DEFAULT_DVS_STAT_GRID_INFO, \
+	} \
+)
 
 /** Union that holds all types of DVS statistics grid info in
  *  CSS format
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c
index 9478c12abe89..e45a3c3fcf4a 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c
@@ -169,8 +169,7 @@ ia_css_sdis_init_info(
 	unsigned enabled)
 {
 	if (!enabled) {
-		struct ia_css_sdis_info default_dis = IA_CSS_DEFAULT_SDIS_INFO;
-		*dis = default_dis;
+		*dis = IA_CSS_DEFAULT_SDIS_INFO;
 		return;
 	}
 
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 c65194619a34..b2934149f76a 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,16 +93,17 @@ struct ia_css_cas_binary_descr {
 	bool *is_output_stage;
 };
 
-#define IA_CSS_DEFAULT_CAS_BINARY_DESCR \
-{ \
-	0,		\
-	0,		\
-	NULL,		\
-	NULL,		\
-	NULL,		\
-	NULL,		\
-	NULL,		\
-}
+#define IA_CSS_DEFAULT_CAS_BINARY_DESCR ( \
+	(struct ia_css_cas_binary_descr) {	\
+		.num_stage		= 0,	\
+		.num_output_stage	= 0,	\
+		.in_info		= NULL,	\
+		.internal_out_info	= NULL,	\
+		.out_info		= NULL,	\
+		.vf_info		= NULL,	\
+		.is_output_stage	= NULL,	\
+	} \
+)
 
 struct ia_css_binary_descr {
 	int mode;
@@ -173,75 +174,77 @@ struct ia_css_binary {
 
 #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 */ \
-}
+#define IA_CSS_BINARY_DEFAULT_SETTINGS ( \
+	(struct ia_css_binary) { \
+		.info				= NULL, \
+		.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}, \
+		.effective_in_frame_res		= { 0, 0 }, \
+		.vf_frame_info			= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
+		.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		= 0, \
+		.dis				= IA_CSS_DEFAULT_SDIS_INFO, \
+		.dvs_envelope			= { 0, 0 }, \
+		.online				= false, \
+		.uds_xc				= 0, \
+		.uds_yc				= 0, \
+		.left_padding			= 0, \
+		.metrics			= DEFAULT_BINARY_METRICS, \
+		.mem_params			= IA_CSS_DEFAULT_ISP_MEM_PARAMS, \
+		.css_params			= IA_CSS_DEFAULT_ISP_CSS_PARAMS, \
+	} \
+)
 
 #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 */ \
-}
+#define IA_CSS_BINARY_DEFAULT_SETTINGS ( \
+	(struct ia_css_binary) { \
+		.info				= NULL, \
+		.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}, \
+		.effective_in_frame_res		= { 0, 0 }, \
+		.vf_frame_info			= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
+		.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, \
+		.dis				= IA_CSS_DEFAULT_SDIS_INFO, \
+		.dvs_envelope			= { 0, 0 }, \
+		.online				= false, \
+		.uds_xc				= 0, \
+		.uds_yc				= 0, \
+		.left_padding			= 0, \
+		.metrics			= DEFAULT_BINARY_METRICS, \
+		.mem_params			= IA_CSS_DEFAULT_ISP_MEM_PARAMS, \
+		.css_params			= IA_CSS_DEFAULT_ISP_CSS_PARAMS, \
+	} \
+)
 
 #endif
 
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/binary/src/binary.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/binary/src/binary.c
index 9f8a125f0d74..934cfab60530 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/binary/src/binary.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/binary/src/binary.c
@@ -490,7 +490,6 @@ ia_css_binary_get_shading_info_type_1(const struct ia_css_binary *binary,	/* [in
 	struct sh_css_shading_table_bayer_origin_compute_results res;
 #else
 	struct sh_css_binary_sc_requirements scr;
-	struct ia_css_shading_info default_shading_info_type_1 = DEFAULT_SHADING_INFO_TYPE_1;
 #endif
 
 #ifndef ISP2401
@@ -542,7 +541,7 @@ ia_css_binary_get_shading_info_type_1(const struct ia_css_binary *binary,	/* [in
 		&res);
 	if (err != IA_CSS_SUCCESS)
 #else
-	*shading_info = default_shading_info_type_1;
+	*shading_info = DEFAULT_SHADING_INFO_TYPE_1;
 
 	err = sh_css_binary_get_sc_requirements(binary, required_bds_factor, stream_config, &scr);
 	if (err != IA_CSS_SUCCESS) {
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
index 8e651b80345a..f88c23f38e38 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
@@ -94,14 +94,28 @@ union ia_css_all_memory_offsets {
 	} array[IA_CSS_NUM_PARAM_CLASSES];
 };
 
-#define IA_CSS_DEFAULT_ISP_MEM_PARAMS \
-		{ { { { 0, 0 } } } }
-
-#define IA_CSS_DEFAULT_ISP_CSS_PARAMS \
-		{ { { { 0, 0 } } } }
-
-#define IA_CSS_DEFAULT_ISP_ISP_PARAMS \
-		{ { { { 0, 0 } } } }
+#define IA_CSS_DEFAULT_ISP_MEM_PARAMS ( \
+	(struct ia_css_isp_param_host_segments) { \
+		.params = { { \
+			(struct ia_css_host_data) { .address = NULL, .size = 0 } \
+		} } \
+	} \
+)
+
+#define IA_CSS_DEFAULT_ISP_CSS_PARAMS ( \
+	(struct ia_css_isp_param_css_segments) { \
+		.params = { { \
+			(struct ia_css_data) { .address = 0, .size = 0 } \
+		} } \
+	} \
+)
+
+#define IA_CSS_DEFAULT_ISP_ISP_PARAMS ( \
+	(struct ia_css_isp_param_isp_segments) { \
+		.params = { { \
+			(struct ia_css_isp_data) { .address = 0, .size = 0 } \
+		} } \
+	} \
+)
 
 #endif /* _IA_CSS_ISP_PARAM_TYPES_H_ */
-
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/interface/ia_css_pipeline.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/interface/ia_css_pipeline.h
index 90646f5f8885..4a2dd996364f 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/interface/ia_css_pipeline.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/interface/ia_css_pipeline.h
@@ -73,23 +73,24 @@ struct ia_css_pipeline {
 	uint32_t pipe_qos_config;
 };
 
-#define DEFAULT_PIPELINE \
-{ \
-	IA_CSS_PIPE_ID_PREVIEW, /* pipe_id */ \
-	0,			/* pipe_num */ \
-	false,			/* stop_requested */ \
-	NULL,                   /* stages */ \
-	NULL,                   /* current_stage */ \
-	0,                      /* num_stages */ \
-	DEFAULT_FRAME,          /* in_frame */ \
-	{DEFAULT_FRAME},          /* out_frame */ \
-	{DEFAULT_FRAME},          /* vf_frame */ \
-	IA_CSS_FRAME_DELAY_1,   /* frame_delay */ \
-	0,                      /* inout_port_config */ \
-	-1,                     /* num_execs */ \
-	true,					/* acquire_isp_each_stage */\
-	QOS_INVALID             /* pipe_qos_config */\
-}
+#define DEFAULT_PIPELINE ( \
+	(struct ia_css_pipeline) { \
+		.pipe_id		= IA_CSS_PIPE_ID_PREVIEW, \
+		.pipe_num		= 0, \
+		.stop_requested		= false, \
+		.stages			= NULL, \
+		.current_stage		= NULL, \
+		.num_stages		= 0, \
+		.in_frame		= DEFAULT_FRAME, \
+		.out_frame		= {DEFAULT_FRAME}, \
+		.vf_frame		= {DEFAULT_FRAME}, \
+		.dvs_frame_delay	= IA_CSS_FRAME_DELAY_1, \
+		.inout_port_config	= 0, \
+		.num_execs		= -1, \
+		.acquire_isp_each_stage	= true, \
+		.pipe_qos_config	= QOS_INVALID \
+	} \
+)
 
 /* Stage descriptor used to create a new stage in the pipeline */
 struct ia_css_pipeline_stage_desc {
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/src/pipeline.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/src/pipeline.c
index 95542fc82217..9e74df951d6a 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/src/pipeline.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/src/pipeline.c
@@ -692,17 +692,16 @@ static void pipeline_init_defaults(
 	unsigned int pipe_num,
 	unsigned int dvs_frame_delay)
 {
-	struct ia_css_frame init_frame = DEFAULT_FRAME;
 	unsigned int i;
 
 	pipeline->pipe_id = pipe_id;
 	pipeline->stages = NULL;
 	pipeline->stop_requested = false;
 	pipeline->current_stage = NULL;
-	pipeline->in_frame = init_frame;
+	pipeline->in_frame = DEFAULT_FRAME;
 	for (i = 0; i < IA_CSS_PIPE_MAX_OUTPUT_STAGE; i++) {
-		pipeline->out_frame[i] = init_frame;
-		pipeline->vf_frame[i] = init_frame;
+		pipeline->out_frame[i] = DEFAULT_FRAME;
+		pipeline->vf_frame[i] = DEFAULT_FRAME;
 	}
 	pipeline->num_execs = -1;
 	pipeline->acquire_isp_each_stage = true;
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
index e882b5596813..9439d643fd03 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
@@ -112,8 +112,6 @@ static int thread_alive;
 #define STATS_ENABLED(stage) (stage && stage->binary && stage->binary->info && \
         (stage->binary->info->sp.enable.s3a || stage->binary->info->sp.enable.dis))
 
-#define DEFAULT_PLANES { {0, 0, 0, 0} }
-
 struct sh_css my_css;
 
 int (*sh_css_printf) (const char *fmt, va_list args) = NULL;
@@ -2293,25 +2291,19 @@ init_pipe_defaults(enum ia_css_pipe_mode mode,
 	       struct ia_css_pipe *pipe,
 	       bool copy_pipe)
 {
-	static struct ia_css_pipe default_pipe = IA_CSS_DEFAULT_PIPE;
-	static struct ia_css_preview_settings prev  = IA_CSS_DEFAULT_PREVIEW_SETTINGS;
-	static struct ia_css_capture_settings capt  = IA_CSS_DEFAULT_CAPTURE_SETTINGS;
-	static struct ia_css_video_settings   video = IA_CSS_DEFAULT_VIDEO_SETTINGS;
-	static struct ia_css_yuvpp_settings   yuvpp = IA_CSS_DEFAULT_YUVPP_SETTINGS;
-
 	if (pipe == NULL) {
 		IA_CSS_ERROR("NULL pipe parameter");
 		return IA_CSS_ERR_INVALID_ARGUMENTS;
 	}
 
 	/* Initialize pipe to pre-defined defaults */
-	*pipe = default_pipe;
+	*pipe = IA_CSS_DEFAULT_PIPE;
 
 	/* TODO: JB should not be needed, but temporary backward reference */
 	switch (mode) {
 	case IA_CSS_PIPE_MODE_PREVIEW:
 		pipe->mode = IA_CSS_PIPE_ID_PREVIEW;
-		pipe->pipe_settings.preview = prev;
+		pipe->pipe_settings.preview = IA_CSS_DEFAULT_PREVIEW_SETTINGS;
 		break;
 	case IA_CSS_PIPE_MODE_CAPTURE:
 		if (copy_pipe) {
@@ -2319,11 +2311,11 @@ init_pipe_defaults(enum ia_css_pipe_mode mode,
 		} else {
 			pipe->mode = IA_CSS_PIPE_ID_CAPTURE;
 		}
-		pipe->pipe_settings.capture = capt;
+		pipe->pipe_settings.capture = IA_CSS_DEFAULT_CAPTURE_SETTINGS;
 		break;
 	case IA_CSS_PIPE_MODE_VIDEO:
 		pipe->mode = IA_CSS_PIPE_ID_VIDEO;
-		pipe->pipe_settings.video = video;
+		pipe->pipe_settings.video = IA_CSS_DEFAULT_VIDEO_SETTINGS;
 		break;
 	case IA_CSS_PIPE_MODE_ACC:
 		pipe->mode = IA_CSS_PIPE_ID_ACC;
@@ -2333,7 +2325,7 @@ init_pipe_defaults(enum ia_css_pipe_mode mode,
 		break;
 	case IA_CSS_PIPE_MODE_YUVPP:
 		pipe->mode = IA_CSS_PIPE_ID_YUVPP;
-		pipe->pipe_settings.yuvpp = yuvpp;
+		pipe->pipe_settings.yuvpp = IA_CSS_DEFAULT_YUVPP_SETTINGS;
 		break;
 	default:
 		return IA_CSS_ERR_INVALID_ARGUMENTS;
@@ -8827,10 +8819,8 @@ sh_css_init_host_sp_control_vars(void)
  */
 void ia_css_pipe_config_defaults(struct ia_css_pipe_config *pipe_config)
 {
-	struct ia_css_pipe_config def_config = DEFAULT_PIPE_CONFIG;
-
 	ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, "ia_css_pipe_config_defaults()\n");
-	*pipe_config = def_config;
+	*pipe_config = DEFAULT_PIPE_CONFIG;
 }
 
 void
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h
index e12789236bb9..cc9b432b63ef 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h
@@ -52,16 +52,17 @@ struct ia_css_pipe_extra_config {
 	bool disable_vf_pp;
 };
 
-#define DEFAULT_PIPE_EXTRA_CONFIG \
-{ \
-	false,				/* enable_raw_binning */ \
-	false,				/* enable_yuv_ds */ \
-	false,				/* enable_high_speed */ \
-	false,				/* enable_dvs_6axis */ \
-	false,				/* enable_reduced_pipe */ \
-	false,				/* enable_fractional_ds */ \
-	false,				/* disable_vf_pp */ \
-}
+#define DEFAULT_PIPE_EXTRA_CONFIG ( \
+	(struct ia_css_pipe_extra_config) { \
+		.enable_raw_binning	= false, \
+		.enable_yuv_ds		= false, \
+		.enable_high_speed	= false, \
+		.enable_dvs_6axis	= false, \
+		.enable_reduced_pipe	= false, \
+		.enable_fractional_ds	= false, \
+		.disable_vf_pp		= false, \
+	} \
+)
 
 enum ia_css_err
 ia_css_pipe_create_extra(const struct ia_css_pipe_config *config,
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h
index 40840ea318ab..e5f49d1f5390 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h
@@ -24,15 +24,14 @@ struct sh_css_pc_histogram {
 	unsigned *msink;
 };
 
-#if !defined(__USE_DESIGNATED_INITIALISERS__)
-#define DEFAULT_PC_HISTOGRAM \
-{ \
-	0, \
-	NULL, \
-	NULL, \
-	NULL \
-}
-#endif
+#define DEFAULT_PC_HISTOGRAM ( \
+	(struct sh_css_pc_histogram) { \
+		.length	= 0, \
+		.run	= NULL, \
+		.stall	= NULL, \
+		.msink	= NULL \
+	} \
+)
 
 struct sh_css_binary_metrics {
 	unsigned mode;
@@ -42,16 +41,15 @@ struct sh_css_binary_metrics {
 	struct sh_css_binary_metrics *next;
 };
 
-#if !defined(__USE_DESIGNATED_INITIALISERS__)
-#define DEFAULT_BINARY_METRICS \
-{ \
-	0, \
-	0, \
-	DEFAULT_PC_HISTOGRAM, \
-	DEFAULT_PC_HISTOGRAM, \
-	NULL \
-}
-#endif
+#define DEFAULT_BINARY_METRICS ( \
+	(struct sh_css_binary_metrics) { \
+		.mode		= 0, \
+		.id		= 0, \
+		.isp_histogram	= DEFAULT_PC_HISTOGRAM, \
+		.sp_histogram	= DEFAULT_PC_HISTOGRAM, \
+		.next		= NULL \
+	} \
+)
 
 struct ia_css_frame_metrics {
 	unsigned num_frames;

base-commit: 37cb8e1f8e10c6e9bd2a1b95cdda0620a21b0551
-- 
2.15.0

^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 2/3] media: atomisp: delete zero-valued struct members.
  2017-12-01 17:19                       ` [PATCH v2 0/3] media: atomisp: clean up of data-structure initialization in the CSS API Jeremy Sowden
  2017-12-01 17:19                         ` [PATCH v2 1/3] media: atomisp: convert default struct values to use compound-literals with designated initializers Jeremy Sowden
@ 2017-12-01 17:19                         ` Jeremy Sowden
  2017-12-01 17:41                           ` Alan Cox
  2017-12-01 17:19                         ` [PATCH v2 3/3] media: atomisp: delete empty default struct values Jeremy Sowden
  2 siblings, 1 reply; 53+ messages in thread
From: Jeremy Sowden @ 2017-12-01 17:19 UTC (permalink / raw)
  To: linux-media, devel; +Cc: Jeremy Sowden

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 to be removed.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 .../hive_isp_css_common/input_formatter_global.h   |  17 ----
 .../pci/atomisp2/css2400/ia_css_frame_public.h     |  17 ----
 .../atomisp/pci/atomisp2/css2400/ia_css_pipe.h     |  44 +-------
 .../pci/atomisp2/css2400/ia_css_pipe_public.h      |  81 ---------------
 .../atomisp/pci/atomisp2/css2400/ia_css_types.h    |  48 +--------
 .../isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h     | 111 ---------------------
 .../kernels/sdis/common/ia_css_sdis_common_types.h |  35 -------
 .../runtime/binary/interface/ia_css_binary.h       |  89 ++---------------
 .../isp_param/interface/ia_css_isp_param_types.h   |   9 --
 .../runtime/pipeline/interface/ia_css_pipeline.h   |   6 --
 .../atomisp/pci/atomisp2/css2400/sh_css_legacy.h   |   7 --
 .../atomisp/pci/atomisp2/css2400/sh_css_metrics.h  |   7 --
 12 files changed, 20 insertions(+), 451 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/input_formatter_global.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/input_formatter_global.h
index 5e19b5bd56e6..7558f4964313 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/input_formatter_global.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/input_formatter_global.h
@@ -107,23 +107,6 @@ struct input_formatter_cfg_s {
 	uint32_t	block_no_reqs;
 };
 
-#define DEFAULT_IF_CONFIG ( \
-	(struct input_formatter_cfg_s) { \
-		.start_line		= 0, \
-		.start_column		= 0, \
-		.left_padding		= 0, \
-		.cropped_height		= 0, \
-		.cropped_width		= 0, \
-		.deinterleaving		= 0, \
-		.buf_vecs		= 0, \
-		.buf_start_index	= 0, \
-		.buf_increment		= 0, \
-		.buf_eol_offset		= 0, \
-		.is_yuv420_format	= false, \
-		.block_no_reqs		= false \
-	} \
-)
-
 extern const hrt_address HIVE_IF_SRST_ADDRESS[N_INPUT_FORMATTER_ID];
 extern const hrt_data HIVE_IF_SRST_MASK[N_INPUT_FORMATTER_ID];
 extern const uint8_t HIVE_IF_SWITCH_CODE[N_INPUT_FORMATTER_ID];
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_frame_public.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_frame_public.h
index 56527feeb558..980b36171ca7 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_frame_public.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_frame_public.h
@@ -122,18 +122,8 @@ struct ia_css_frame_info {
 
 #define IA_CSS_BINARY_DEFAULT_FRAME_INFO ( \
 	(struct ia_css_frame_info) { \
-		.res			= (struct ia_css_resolution) { \
-						.width = 0, \
-						.height = 0 \
-					}, \
-		.padded_width		= 0, \
 		.format			= IA_CSS_FRAME_FORMAT_NUM,  \
-		.raw_bit_depth		= 0, \
 		.raw_bayer_order	= IA_CSS_BAYER_ORDER_NUM, \
-		.crop_info		= (struct ia_css_crop_info) { \
-						.start_column	= 0, \
-						.start_line	= 0 \
-					}, \
 	} \
 )
 
@@ -197,16 +187,9 @@ struct ia_css_frame {
 #define DEFAULT_FRAME ( \
 	(struct ia_css_frame) { \
 		.info			= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
-		.data			= 0, \
-		.data_bytes		= 0, \
 		.dynamic_queue_id	= SH_CSS_INVALID_QUEUE_ID, \
 		.buf_type		= IA_CSS_BUFFER_TYPE_INVALID, \
 		.flash_state		= IA_CSS_FRAME_FLASH_STATE_NONE, \
-		.exp_id			= 0, \
-		.isp_config_id		= 0, \
-		.valid			= false, \
-		.contiguous		= false, \
-		.planes			= { 0 } \
 	} \
 )
 
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h
index bfebfd8d6e63..a68eac6de36a 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h
@@ -39,16 +39,11 @@ struct ia_css_preview_settings {
 	struct ia_css_pipe *acc_pipe;
 };
 
-#define IA_CSS_DEFAULT_PREVIEW_SETTINGS  ( \
+#define IA_CSS_DEFAULT_PREVIEW_SETTINGS ( \
 	(struct ia_css_preview_settings) { \
 		.copy_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
 		.preview_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
 		.vf_pp_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
-		.delay_frames	= { NULL }, \
-		.tnr_frames	= { NULL }, \
-		.copy_pipe	= NULL, \
-		.capture_pipe	= NULL, \
-		.acc_pipe	= NULL, \
 	} \
 )
 
@@ -74,17 +69,12 @@ struct ia_css_capture_settings {
 	(struct ia_css_capture_settings) { \
 		.copy_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
 		.primary_binary		= {IA_CSS_BINARY_DEFAULT_SETTINGS}, \
-		.num_primary_stage	= 0, \
 		.pre_isp_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
 		.anr_gdc_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
 		.post_isp_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
 		.capture_pp_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
 		.vf_pp_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
 		.capture_ldc_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
-		.yuv_scaler_binary	= NULL, \
-		.delay_frames		= { NULL }, \
-		.is_output_stage	= NULL, \
-		.num_yuv_scaler		= 0, \
 	} \
 )
 
@@ -108,17 +98,9 @@ struct ia_css_video_settings {
 
 #define IA_CSS_DEFAULT_VIDEO_SETTINGS ( \
 	(struct ia_css_video_settings) { \
-		.copy_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
-		.video_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
-		.vf_pp_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
-		.yuv_scaler_binary	= NULL, \
-		.delay_frames		= { NULL }, \
-		.tnr_frames		= { NULL }, \
-		.vf_pp_in_frame		= NULL, \
-		.copy_pipe		= NULL, \
-		.capture_pipe		= NULL, \
-		.is_output_stage	= NULL, \
-		.num_yuv_scaler		= 0, \
+		.copy_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+		.video_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+		.vf_pp_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
 	} \
 )
 
@@ -134,13 +116,7 @@ struct ia_css_yuvpp_settings {
 
 #define IA_CSS_DEFAULT_YUVPP_SETTINGS ( \
 	(struct ia_css_yuvpp_settings) { \
-		.copy_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
-		.yuv_scaler_binary	= NULL, \
-		.vf_pp_binary		= NULL, \
-		.is_output_stage	= NULL, \
-		.num_yuv_scaler		= 0, \
-		.num_vf_pp		= 0, \
-		.num_output		= 0, \
+		.copy_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
 	} \
 )
 
@@ -190,35 +166,25 @@ struct ia_css_pipe {
 
 #define IA_CSS_DEFAULT_PIPE ( \
 	(struct ia_css_pipe) { \
-		.stop_requested		= false, \
 		.config			= DEFAULT_PIPE_CONFIG, \
 		.extra_config		= DEFAULT_PIPE_EXTRA_CONFIG, \
 		.info			= DEFAULT_PIPE_INFO, \
 		.mode			= IA_CSS_PIPE_ID_ACC, /* (pipe_id) */ \
-		.shading_table		= NULL, \
 		.pipeline		= DEFAULT_PIPELINE, \
 		.output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
 		.bds_output_info	= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
 		.vf_output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
 		.out_yuv_ds_input_info	= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
 		.vf_yuv_ds_input_info	= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
-		.output_stage		= NULL, \
-		.vf_stage		= NULL, \
 		.required_bds_factor	= SH_CSS_BDS_FACTOR_1_00, \
 		.dvs_frame_delay	= 1, \
-		.num_invalid_frames	= 0, \
 		.enable_viewfinder	= {true}, \
-		.stream			= NULL, \
 		.in_frame_struct	= DEFAULT_FRAME, \
 		.out_frame_struct	= DEFAULT_FRAME, \
 		.vf_frame_struct	= DEFAULT_FRAME, \
-		.continuous_frames	= { NULL }, \
-		.cont_md_buffers	= { NULL }, \
 		.pipe_settings		= { \
 			.preview = IA_CSS_DEFAULT_PREVIEW_SETTINGS \
 		}, \
-		.scaler_pp_lut		= 0, \
-		.osys_obj		= NULL, \
 		.pipe_num		= PIPE_ENTRY_EMPTY_TOKEN, \
 	} \
 )
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe_public.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe_public.h
index b23e23cdf086..89300886ee4e 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe_public.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe_public.h
@@ -152,14 +152,6 @@ struct ia_css_pipe_config {
 };
 
 
-#ifdef ISP2401
-/**
- * Default origin of internal frame positioned on shading table.
- */
-#define IA_CSS_PIPE_DEFAULT_INTERNAL_FRAME_ORIGIN_BQS_ON_SCTBL ( \
-	(struct ia_css_coordinate) { .x = 0, .y = 0 } \
-)
-
 /**
  * Default settings for newly created pipe configurations.
  */
@@ -167,68 +159,14 @@ struct ia_css_pipe_config {
 	(struct ia_css_pipe_config) { \
 		.mode			= IA_CSS_PIPE_MODE_PREVIEW, \
 		.isp_pipe_version	= 1, \
-		.input_effective_res	= { 0, 0 }, \
-		.bayer_ds_out_res	= { 0, 0 }, \
-		.capt_pp_in_res		= { 0, 0 }, \
-		.vf_pp_in_res		= { 0, 0 }, \
-		.output_system_in_res	= { 0, 0 }, \
-		.dvs_crop_out_res	= { 0, 0 }, \
 		.output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
 		.vf_output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
-		.acc_extension		= NULL, \
-		.acc_stages		= NULL, \
-		.num_acc_stages		= 0, \
 		.default_capture_config	= DEFAULT_CAPTURE_CONFIG, \
-		.dvs_envelope		= { 0, 0 }, \
 		.dvs_frame_delay	= IA_CSS_FRAME_DELAY_1, \
 		.acc_num_execs		= -1, \
-		.enable_dz		= false, \
-		.enable_dpc		= false, \
-		.enable_vfpp_bci	= false, \
-		.enable_luma_only	= false, \
-		.enable_tnr		= false, \
-		.p_isp_config		= NULL, \
-		.gdc_in_buffer_res	= { 0, 0 }, \
-		.gdc_in_buffer_offset	= { 0, 0 }, \
-		.internal_frame_origin_bqs_on_sctbl \
-					= IA_CSS_PIPE_DEFAULT_INTERNAL_FRAME_ORIGIN_BQS_ON_SCTBL \
 	} \
 )
 
-#else
-
-/**
- * Default settings for newly created pipe configurations.
- */
-#define DEFAULT_PIPE_CONFIG ( \
-	(struct ia_css_pipe_config) { \
-		.mode			= IA_CSS_PIPE_MODE_PREVIEW, \
-		.isp_pipe_version	= 1, \
-		.input_effective_res	= { 0, 0 }, \
-		.bayer_ds_out_res	= { 0, 0 }, \
-		.capt_pp_in_res		= { 0, 0 }, \
-		.vf_pp_in_res		= { 0, 0 }, \
-		.dvs_crop_out_res	= { 0, 0 }, \
-		.output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
-		.vf_output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
-		.acc_extension		= NULL, \
-		.acc_stages		= NULL, \
-		.num_acc_stages		= 0, \
-		.default_capture_config	= DEFAULT_CAPTURE_CONFIG, \
-		.dvs_envelope		= { 0, 0 }, \
-		.dvs_frame_delay	= IA_CSS_FRAME_DELAY_1, \
-		.acc_num_execs		= -1, \
-		.enable_dz		= false, \
-		.enable_dpc		= false, \
-		.enable_vfpp_bci	= false, \
-		.p_isp_config		= NULL, \
-		.gdc_in_buffer_res	= { 0, 0 }, \
-		.gdc_in_buffer_offset	= { 0, 0 } \
-	} \
-)
-
-#endif
-
 /** Pipe info, this struct describes properties of a pipe after it's stream has
  * been created.
  * ~~~** DO NOT ADD NEW FIELD **~~~ This structure will be deprecated.
@@ -273,22 +211,6 @@ struct ia_css_pipe_info {
 /**
  * Defaults for ia_css_pipe_info structs.
  */
-#ifdef ISP2401
-
-#define DEFAULT_PIPE_INFO ( \
-	(struct ia_css_pipe_info) { \
-		.output_info			= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
-		.vf_output_info			= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
-		.raw_output_info		= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
-		.output_system_in_res_info	= { 0, 0 }, \
-		.shading_info			= DEFAULT_SHADING_INFO, \
-		.grid_info			= DEFAULT_GRID_INFO, \
-		.num_invalid_frames		= 0 \
-	} \
-)
-
-#else
-
 #define DEFAULT_PIPE_INFO ( \
 	(struct ia_css_pipe_info) { \
 		.output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
@@ -296,12 +218,9 @@ struct ia_css_pipe_info {
 		.raw_output_info	= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
 		.shading_info		= DEFAULT_SHADING_INFO, \
 		.grid_info		= DEFAULT_GRID_INFO, \
-		.num_invalid_frames	= 0 \
 	} \
 )
 
-#endif
-
 /** @brief Load default pipe configuration
  * @param[out]	pipe_config The pipe configuration.
  * @return	None
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h
index 506f92bbc226..afde2d10ad70 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h
@@ -370,54 +370,21 @@ struct ia_css_shading_info {
 	} info;
 };
 
-#ifndef ISP2401
-
 /** Default Shading Correction information of Shading Correction Type 1. */
 #define DEFAULT_SHADING_INFO_TYPE_1 ( \
 	(struct ia_css_shading_info) { \
 		.type = IA_CSS_SHADING_CORRECTION_TYPE_1, \
 		.info = { \
 			.type_1 = { \
-				.enable					= 0, \
-				.num_hor_grids				= 0, \
-				.num_ver_grids				= 0, \
-				.bqs_per_grid_cell			= 0, \
-				.bayer_scale_hor_ratio_in		= 1, \
-				.bayer_scale_hor_ratio_out		= 1, \
-				.bayer_scale_ver_ratio_in		= 1, \
-				.bayer_scale_ver_ratio_out		= 1, \
-				.sc_bayer_origin_x_bqs_on_shading_table	= 0, \
-				.sc_bayer_origin_y_bqs_on_shading_table	= 0 \
+				.bayer_scale_hor_ratio_in	= 1, \
+				.bayer_scale_hor_ratio_out	= 1, \
+				.bayer_scale_ver_ratio_in	= 1, \
+				.bayer_scale_ver_ratio_out	= 1, \
 			} \
 		} \
 	} \
 )
 
-#else
-
-/** Default Shading Correction information of Shading Correction Type 1. */
-#define DEFAULT_SHADING_INFO_TYPE_1 ( \
-	(struct ia_css_shading_info) { \
-		.type = IA_CSS_SHADING_CORRECTION_TYPE_1, \
-		.info = { \
-			.type_1 = { \
-				.num_hor_grids				= 0, \
-				.num_ver_grids				= 0, \
-				.bqs_per_grid_cell			= 0, \
-				.bayer_scale_hor_ratio_in		= 1, \
-				.bayer_scale_hor_ratio_out		= 1, \
-				.bayer_scale_ver_ratio_in		= 1, \
-				.bayer_scale_ver_ratio_out		= 1, \
-				.isp_input_sensor_data_res_bqs		= {0, 0}, \
-				.sensor_data_res_bqs			= {0, 0}, \
-				.sensor_data_origin_bqs_on_sctbl	= {0, 0} \
-			} \
-		} \
-	} \
-)
-
-#endif
-
 /** Default Shading Correction information. */
 #define DEFAULT_SHADING_INFO	DEFAULT_SHADING_INFO_TYPE_1
 
@@ -441,8 +408,6 @@ struct ia_css_grid_info {
 /** defaults for ia_css_grid_info structs */
 #define DEFAULT_GRID_INFO ( \
 	(struct ia_css_grid_info) { \
-		.isp_in_width	= 0, \
-		.isp_in_height	= 0, \
 		.s3a_grid	= DEFAULT_3A_GRID_INFO, \
 		.dvs_grid	= DEFAULT_DVS_GRID_INFO, \
 		.vamem_type	= IA_CSS_VAMEM_TYPE_1 \
@@ -538,10 +503,7 @@ struct ia_css_capture_config {
 /** default settings for ia_css_capture_config structs */
 #define DEFAULT_CAPTURE_CONFIG ( \
 	(struct ia_css_capture_config) { \
-		.mode			= IA_CSS_CAPTURE_MODE_PRIMARY, \
-		.enable_xnr		= false, \
-		.enable_raw_output	= false, \
-		.enable_capture_pp_bli	= false \
+		.mode	= IA_CSS_CAPTURE_MODE_PRIMARY, \
 	} \
 )
 
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h
index 76316fbabbd5..e62410cdb282 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h
@@ -98,122 +98,11 @@ struct ia_css_3a_grid_info {
 };
 
 
-#if defined(SYSTEM_css_skycam_c0_system)
-#if defined USE_NEW_AE_STRUCT || defined USE_NEW_AWB_STRUCT
 #define DEFAULT_3A_GRID_INFO ( \
 	(struct ia_css_3a_grid_info) { \
-		.ae_enable		= 0, \
-		.ae_grd_info		= (struct ae_public_config_grid_config) { \
-						.width = 0, \
-						.height = 0, \
-						.b_width = 0, \
-						.b_height = 0, \
-						.x_start = 0, \
-						.y_start = 0, \
-						.x_end = 0, \
-						.y_end = 0 \
-					  } \
-		.awb_enable		= 0, \
-		.awb_grd_info		= (struct awb_public_config_grid_config) { \
-						.width = 0, \
-						.height = 0, \
-						.b_width = 0, \
-						.b_height = 0, \
-						.x_start = 0, \
-						.y_start = 0, \
-						.x_end = 0, \
-						.y_end = 0 \
-					  }	\
-		.af_enable		= 0, \
-		.af_grd_info		= (struct af_public_grid_config) { \
-						.width = 0, \
-						.height = 0, \
-						.b_width = 0, \
-						.b_height = 0, \
-						.x_start = 0, \
-						.y_start = 0, \
-						.ff_en = 0 \
-					  } \
-		.awb_fr_enable		= 0, \
-		.awb_fr_grd_info	= (struct awb_fr_public_grid_config) { \
-						.width = 0, \
-						.height = 0, \
-						.b_width = 0, \
-						.b_height = 0, \
-						.x_start = 0, \
-						.y_start = 0, \
-						.ff_en = 0 \
-					  } \
-		.elem_bit_depth		= 0, \
 	} \
 )
-#else
-#define DEFAULT_3A_GRID_INFO ( \
-	(struct ia_css_3a_grid_info) { \
-		.ae_enable		= 0, \
-		.ae_grd_info		= (struct ae_public_config_grid_config) { \
-						.width = 0, \
-						.height = 0, \
-						.b_width = 0, \
-						.b_height = 0, \
-						.x_start = 0, \
-						.y_start = 0, \
-						.x_end = 0, \
-						.y_end = 0 \
-					  } \
-		.awb_enable		= 0, \
-		.awb_grd_info		= (struct awb_public_config_grid_config) { \
-						.width = 0, \
-						.height = 0, \
-						.b_width = 0, \
-						.b_height = 0, \
-						.x_start = 0, \
-						.y_start = 0, \
-						.x_end = 0, \
-						.y_end = 0 \
-					  }	\
-		.af_enable		= 0, \
-		.af_grd_info		= (struct af_public_grid_config) { \
-						.width = 0, \
-						.height = 0, \
-						.b_width = 0, \
-						.b_height = 0, \
-						.x_start = 0, \
-						.y_start = 0, \
-						.ff_en = 0 \
-					  } \
-		.awb_fr_enable		= 0, \
-		.awb_fr_grd_info	= (struct awb_fr_public_grid_config) { \
-						.width = 0, \
-						.height = 0, \
-						.b_width = 0, \
-						.b_height = 0, \
-						.x_start = 0, \
-						.y_start = 0, \
-						.ff_en = 0 \
-					  } \
-		.elem_bit_depth		= 0, \
-	} \
-)
-#endif /* USE_NEW_AE_STRUCT || defined USE_NEW_AWB_STRUCT */
 
-#else
-#define DEFAULT_3A_GRID_INFO ( \
-	(struct ia_css_3a_grid_info) { \
-		.enable			= 0, \
-		.use_dmem		= 0, \
-		.has_histogram		= 0, \
-		.width			= 0, \
-		.height			= 0, \
-		.aligned_width		= 0, \
-		.aligned_height		= 0, \
-		.bqs_per_grid_cell	= 0, \
-		.deci_factor_log2	= 0, \
-		.elem_bit_depth		= 0, \
-	} \
-)
-
-#endif
 
 /* This struct should be split into 3, for AE, AWB and AF.
  * However, that will require driver/ 3A lib modifications.
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h
index 4365049f0049..4319e0191f6d 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h
@@ -43,23 +43,9 @@ struct ia_css_sdis_info {
 
 #define IA_CSS_DEFAULT_SDIS_INFO ( \
 	(struct ia_css_sdis_info) { \
-		.grid = { \
-			.dim = (struct ia_css_dvs_grid_dim) { .width = 0, .height = 0 }, \
-			.pad = (struct ia_css_dvs_grid_dim) { .width = 0, .height = 0 }, \
-		}, \
-		.coef = { \
-			.dim = (struct ia_css_dvs_grid_dim) { .width = 0, .height = 0 }, \
-			.pad = (struct ia_css_dvs_grid_dim) { .width = 0, .height = 0 }, \
-		}, \
-		.proj = { \
-			.dim = (struct ia_css_dvs_grid_dim) { .width = 0, .height = 0 }, \
-			.pad = (struct ia_css_dvs_grid_dim) { .width = 0, .height = 0 }, \
-		}, \
-		.deci_factor_log2 = 0, \
 	} \
 )
 
-
 /** DVS statistics grid
  *
  *  ISP block: SDVS1 (DIS/DVS Support for DIS/DVS ver.1 (2-axes))
@@ -216,38 +202,17 @@ struct ia_css_dvs_stat_grid_info {
  */
 #define DEFAULT_DVS_STAT_PUBLIC_DVS_GLOBAL_CFG ( \
 	(struct dvs_stat_public_dvs_global_cfg) { \
-		.kappa		= 0, \
-		.match_shift	= 0, \
-		.ybin_mode	= 0, \
 	} \
 )
 
 #define DEFAULT_DVS_STAT_PUBLIC_DVS_GRD_CFG ( \
 	(struct dvs_stat_public_dvs_grd_cfg) { \
-		.grd_cfg	= (struct dvs_stat_public_dvs_level_grid_cfg) { \
-					.grid_width = 0, \
-					.grid_height = 0, \
-					.block_width = 0, \
-					.block_height = 0 \
-				}, \
-		.grd_start	= (struct dvs_stat_public_dvs_level_grid_start) { \
-					.x_start = 0, \
-					.y_start = 0, \
-					.enable = 0 \
-				}, \
-		.grd_end	= (struct dvs_stat_public_dvs_level_grid_end) { \
-					.x_end = 0, \
-					.y_end = 0, \
-				}, \
 	} \
 )
 
 #define DEFAULT_DVS_STAT_PUBLIC_DVS_LEVEL_FE_ROI_CFG(X_START) ( \
 	(struct dvs_stat_public_dvs_level_fe_roi_cfg) { \
 		.x_start = X_START, \
-		.y_start = 0, \
-		.x_end   = 0, \
-		.y_end   = 0, \
 	} \
 )
 
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 b2934149f76a..ee1df8f9172d 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
@@ -94,14 +94,7 @@ struct ia_css_cas_binary_descr {
 };
 
 #define IA_CSS_DEFAULT_CAS_BINARY_DESCR ( \
-	(struct ia_css_cas_binary_descr) {	\
-		.num_stage		= 0,	\
-		.num_output_stage	= 0,	\
-		.in_info		= NULL,	\
-		.internal_out_info	= NULL,	\
-		.out_info		= NULL,	\
-		.vf_info		= NULL,	\
-		.is_output_stage	= NULL,	\
+	(struct ia_css_cas_binary_descr) { \
 	} \
 )
 
@@ -172,82 +165,20 @@ struct ia_css_binary {
 	struct ia_css_isp_param_css_segments  css_params;
 };
 
-#ifdef ISP2401
-
 #define IA_CSS_BINARY_DEFAULT_SETTINGS ( \
 	(struct ia_css_binary) { \
-		.info				= NULL, \
-		.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}, \
-		.effective_in_frame_res		= { 0, 0 }, \
-		.vf_frame_info			= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
-		.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		= 0, \
-		.dis				= IA_CSS_DEFAULT_SDIS_INFO, \
-		.dvs_envelope			= { 0, 0 }, \
-		.online				= false, \
-		.uds_xc				= 0, \
-		.uds_yc				= 0, \
-		.left_padding			= 0, \
-		.metrics			= DEFAULT_BINARY_METRICS, \
-		.mem_params			= IA_CSS_DEFAULT_ISP_MEM_PARAMS, \
-		.css_params			= IA_CSS_DEFAULT_ISP_CSS_PARAMS, \
+		.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, \
+		.dis			= IA_CSS_DEFAULT_SDIS_INFO, \
+		.metrics		= DEFAULT_BINARY_METRICS, \
+		.mem_params		= IA_CSS_DEFAULT_ISP_MEM_PARAMS, \
+		.css_params		= IA_CSS_DEFAULT_ISP_CSS_PARAMS, \
 	} \
 )
 
-#else
-
-#define IA_CSS_BINARY_DEFAULT_SETTINGS ( \
-	(struct ia_css_binary) { \
-		.info				= NULL, \
-		.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}, \
-		.effective_in_frame_res		= { 0, 0 }, \
-		.vf_frame_info			= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
-		.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, \
-		.dis				= IA_CSS_DEFAULT_SDIS_INFO, \
-		.dvs_envelope			= { 0, 0 }, \
-		.online				= false, \
-		.uds_xc				= 0, \
-		.uds_yc				= 0, \
-		.left_padding			= 0, \
-		.metrics			= DEFAULT_BINARY_METRICS, \
-		.mem_params			= IA_CSS_DEFAULT_ISP_MEM_PARAMS, \
-		.css_params			= IA_CSS_DEFAULT_ISP_CSS_PARAMS, \
-	} \
-)
-
-#endif
-
 enum ia_css_err
 ia_css_binary_init_infos(void);
 
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
index f88c23f38e38..76ae006cb173 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
@@ -96,25 +96,16 @@ union ia_css_all_memory_offsets {
 
 #define IA_CSS_DEFAULT_ISP_MEM_PARAMS ( \
 	(struct ia_css_isp_param_host_segments) { \
-		.params = { { \
-			(struct ia_css_host_data) { .address = NULL, .size = 0 } \
-		} } \
 	} \
 )
 
 #define IA_CSS_DEFAULT_ISP_CSS_PARAMS ( \
 	(struct ia_css_isp_param_css_segments) { \
-		.params = { { \
-			(struct ia_css_data) { .address = 0, .size = 0 } \
-		} } \
 	} \
 )
 
 #define IA_CSS_DEFAULT_ISP_ISP_PARAMS ( \
 	(struct ia_css_isp_param_isp_segments) { \
-		.params = { { \
-			(struct ia_css_isp_data) { .address = 0, .size = 0 } \
-		} } \
 	} \
 )
 
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/interface/ia_css_pipeline.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/interface/ia_css_pipeline.h
index 4a2dd996364f..f44eb5bf112e 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/interface/ia_css_pipeline.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/interface/ia_css_pipeline.h
@@ -76,16 +76,10 @@ struct ia_css_pipeline {
 #define DEFAULT_PIPELINE ( \
 	(struct ia_css_pipeline) { \
 		.pipe_id		= IA_CSS_PIPE_ID_PREVIEW, \
-		.pipe_num		= 0, \
-		.stop_requested		= false, \
-		.stages			= NULL, \
-		.current_stage		= NULL, \
-		.num_stages		= 0, \
 		.in_frame		= DEFAULT_FRAME, \
 		.out_frame		= {DEFAULT_FRAME}, \
 		.vf_frame		= {DEFAULT_FRAME}, \
 		.dvs_frame_delay	= IA_CSS_FRAME_DELAY_1, \
-		.inout_port_config	= 0, \
 		.num_execs		= -1, \
 		.acquire_isp_each_stage	= true, \
 		.pipe_qos_config	= QOS_INVALID \
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h
index cc9b432b63ef..18f2027aeb86 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h
@@ -54,13 +54,6 @@ struct ia_css_pipe_extra_config {
 
 #define DEFAULT_PIPE_EXTRA_CONFIG ( \
 	(struct ia_css_pipe_extra_config) { \
-		.enable_raw_binning	= false, \
-		.enable_yuv_ds		= false, \
-		.enable_high_speed	= false, \
-		.enable_dvs_6axis	= false, \
-		.enable_reduced_pipe	= false, \
-		.enable_fractional_ds	= false, \
-		.disable_vf_pp		= false, \
 	} \
 )
 
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h
index e5f49d1f5390..aa3badd7e9da 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h
@@ -26,10 +26,6 @@ struct sh_css_pc_histogram {
 
 #define DEFAULT_PC_HISTOGRAM ( \
 	(struct sh_css_pc_histogram) { \
-		.length	= 0, \
-		.run	= NULL, \
-		.stall	= NULL, \
-		.msink	= NULL \
 	} \
 )
 
@@ -43,11 +39,8 @@ struct sh_css_binary_metrics {
 
 #define DEFAULT_BINARY_METRICS ( \
 	(struct sh_css_binary_metrics) { \
-		.mode		= 0, \
-		.id		= 0, \
 		.isp_histogram	= DEFAULT_PC_HISTOGRAM, \
 		.sp_histogram	= DEFAULT_PC_HISTOGRAM, \
-		.next		= NULL \
 	} \
 )
 
-- 
2.15.0

^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 3/3] media: atomisp: delete empty default struct values.
  2017-12-01 17:19                       ` [PATCH v2 0/3] media: atomisp: clean up of data-structure initialization in the CSS API Jeremy Sowden
  2017-12-01 17:19                         ` [PATCH v2 1/3] media: atomisp: convert default struct values to use compound-literals with designated initializers Jeremy Sowden
  2017-12-01 17:19                         ` [PATCH v2 2/3] media: atomisp: delete zero-valued struct members Jeremy Sowden
@ 2017-12-01 17:19                         ` Jeremy Sowden
  2 siblings, 0 replies; 53+ messages in thread
From: Jeremy Sowden @ 2017-12-01 17:19 UTC (permalink / raw)
  To: linux-media, devel; +Cc: Jeremy Sowden

Removing zero-valued struct-members left a number of the default
struct-values empty.  These values have now been removed.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 .../atomisp/pci/atomisp2/css2400/ia_css_pipe.h     |  1 -
 .../atomisp/pci/atomisp2/css2400/ia_css_types.h    |  1 -
 .../isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h     |  6 ---
 .../kernels/sdis/common/ia_css_sdis_common_types.h | 45 ++++------------------
 .../isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c   |  2 +-
 .../runtime/binary/interface/ia_css_binary.h       |  9 -----
 .../isp_param/interface/ia_css_isp_param_types.h   | 15 --------
 .../media/atomisp/pci/atomisp2/css2400/sh_css.c    |  9 ++---
 .../atomisp/pci/atomisp2/css2400/sh_css_legacy.h   |  5 ---
 .../atomisp/pci/atomisp2/css2400/sh_css_metrics.h  | 12 ------
 10 files changed, 12 insertions(+), 93 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h
index a68eac6de36a..3f3c85c2f360 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h
@@ -167,7 +167,6 @@ struct ia_css_pipe {
 #define IA_CSS_DEFAULT_PIPE ( \
 	(struct ia_css_pipe) { \
 		.config			= DEFAULT_PIPE_CONFIG, \
-		.extra_config		= DEFAULT_PIPE_EXTRA_CONFIG, \
 		.info			= DEFAULT_PIPE_INFO, \
 		.mode			= IA_CSS_PIPE_ID_ACC, /* (pipe_id) */ \
 		.pipeline		= DEFAULT_PIPELINE, \
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h
index afde2d10ad70..4a77c61a9fdb 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h
@@ -408,7 +408,6 @@ struct ia_css_grid_info {
 /** defaults for ia_css_grid_info structs */
 #define DEFAULT_GRID_INFO ( \
 	(struct ia_css_grid_info) { \
-		.s3a_grid	= DEFAULT_3A_GRID_INFO, \
 		.dvs_grid	= DEFAULT_DVS_GRID_INFO, \
 		.vamem_type	= IA_CSS_VAMEM_TYPE_1 \
 	} \
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h
index e62410cdb282..4297c3addcb2 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h
@@ -98,12 +98,6 @@ struct ia_css_3a_grid_info {
 };
 
 
-#define DEFAULT_3A_GRID_INFO ( \
-	(struct ia_css_3a_grid_info) { \
-	} \
-)
-
-
 /* This struct should be split into 3, for AE, AWB and AF.
  * However, that will require driver/ 3A lib modifications.
  */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h
index 4319e0191f6d..2eca83d88c14 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h
@@ -41,11 +41,6 @@ struct ia_css_sdis_info {
 	uint32_t deci_factor_log2;
 };
 
-#define IA_CSS_DEFAULT_SDIS_INFO ( \
-	(struct ia_css_sdis_info) { \
-	} \
-)
-
 /** DVS statistics grid
  *
  *  ISP block: SDVS1 (DIS/DVS Support for DIS/DVS ver.1 (2-axes))
@@ -200,41 +195,15 @@ struct ia_css_dvs_stat_grid_info {
 
 /** DVS statistics generated by accelerator default grid info
  */
-#define DEFAULT_DVS_STAT_PUBLIC_DVS_GLOBAL_CFG ( \
-	(struct dvs_stat_public_dvs_global_cfg) { \
-	} \
-)
-
-#define DEFAULT_DVS_STAT_PUBLIC_DVS_GRD_CFG ( \
-	(struct dvs_stat_public_dvs_grd_cfg) { \
-	} \
-)
-
-#define DEFAULT_DVS_STAT_PUBLIC_DVS_LEVEL_FE_ROI_CFG(X_START) ( \
-	(struct dvs_stat_public_dvs_level_fe_roi_cfg) { \
-		.x_start = X_START, \
-	} \
-)
-
-#define DEFAULT_DVS_STAT_GRID_INFO ( \
-	(struct ia_css_dvs_stat_grid_info) { \
-		.dvs_gbl_cfg = DEFAULT_DVS_STAT_PUBLIC_DVS_GLOBAL_CFG, \
-		.grd_cfg = { \
-			DEFAULT_DVS_STAT_PUBLIC_DVS_GRD_CFG, \
-			DEFAULT_DVS_STAT_PUBLIC_DVS_GRD_CFG, \
-			DEFAULT_DVS_STAT_PUBLIC_DVS_GRD_CFG \
-		}, \
-		.fe_roi_cfg = { \
-			DEFAULT_DVS_STAT_PUBLIC_DVS_LEVEL_FE_ROI_CFG(0), \
-			DEFAULT_DVS_STAT_PUBLIC_DVS_LEVEL_FE_ROI_CFG(4), \
-			DEFAULT_DVS_STAT_PUBLIC_DVS_LEVEL_FE_ROI_CFG(0), \
-		} \
-	} \
-)
-
 #define DEFAULT_DVS_GRID_INFO ( \
 	(union ia_css_dvs_grid_u) { \
-		.dvs_stat_grid_info = DEFAULT_DVS_STAT_GRID_INFO, \
+		.dvs_stat_grid_info = (struct ia_css_dvs_stat_grid_info) { \
+			.fe_roi_cfg = { \
+				[1] = (struct dvs_stat_public_dvs_level_fe_roi_cfg) { \
+					.x_start = 4 \
+				} \
+			} \
+		} \
 	} \
 )
 
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c
index e45a3c3fcf4a..0fdd696bf654 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c
@@ -169,7 +169,7 @@ ia_css_sdis_init_info(
 	unsigned enabled)
 {
 	if (!enabled) {
-		*dis = IA_CSS_DEFAULT_SDIS_INFO;
+		*dis = (struct ia_css_sdis_info) { };
 		return;
 	}
 
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 ee1df8f9172d..ae34b68a3d10 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,11 +93,6 @@ struct ia_css_cas_binary_descr {
 	bool *is_output_stage;
 };
 
-#define IA_CSS_DEFAULT_CAS_BINARY_DESCR ( \
-	(struct ia_css_cas_binary_descr) { \
-	} \
-)
-
 struct ia_css_binary_descr {
 	int mode;
 	bool online;
@@ -172,10 +167,6 @@ struct ia_css_binary {
 		.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, \
-		.dis			= IA_CSS_DEFAULT_SDIS_INFO, \
-		.metrics		= DEFAULT_BINARY_METRICS, \
-		.mem_params		= IA_CSS_DEFAULT_ISP_MEM_PARAMS, \
-		.css_params		= IA_CSS_DEFAULT_ISP_CSS_PARAMS, \
 	} \
 )
 
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
index 76ae006cb173..2cb61811e53c 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
@@ -94,19 +94,4 @@ union ia_css_all_memory_offsets {
 	} array[IA_CSS_NUM_PARAM_CLASSES];
 };
 
-#define IA_CSS_DEFAULT_ISP_MEM_PARAMS ( \
-	(struct ia_css_isp_param_host_segments) { \
-	} \
-)
-
-#define IA_CSS_DEFAULT_ISP_CSS_PARAMS ( \
-	(struct ia_css_isp_param_css_segments) { \
-	} \
-)
-
-#define IA_CSS_DEFAULT_ISP_ISP_PARAMS ( \
-	(struct ia_css_isp_param_isp_segments) { \
-	} \
-)
-
 #endif /* _IA_CSS_ISP_PARAM_TYPES_H_ */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
index 9439d643fd03..59bf3402703f 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
@@ -5582,8 +5582,7 @@ static enum ia_css_err load_video_binaries(struct ia_css_pipe *pipe)
 	/* we build up the pipeline starting at the end */
 	/* YUV post-processing if needed */
 	if (need_scaler) {
-		struct ia_css_cas_binary_descr cas_scaler_descr
-			= IA_CSS_DEFAULT_CAS_BINARY_DESCR;
+		struct ia_css_cas_binary_descr cas_scaler_descr = { };
 
 		/* NV12 is the common format that is supported by both */
 		/* yuv_scaler and the video_xx_isp2_min binaries. */
@@ -6236,8 +6235,8 @@ static enum ia_css_err load_primary_binaries(
 						pipe_out_info->res);
 
 	if (need_extra_yuv_scaler) {
-		struct ia_css_cas_binary_descr cas_scaler_descr
-			= IA_CSS_DEFAULT_CAS_BINARY_DESCR;
+		struct ia_css_cas_binary_descr cas_scaler_descr = { };
+
 		err = ia_css_pipe_create_cas_scaler_desc_single_output(
 			&capt_pp_out_info,
 			pipe_out_info,
@@ -7224,7 +7223,7 @@ load_yuvpp_binaries(struct ia_css_pipe *pipe)
 	struct ia_css_frame_info *vf_pp_in_info[IA_CSS_PIPE_MAX_OUTPUT_STAGE];
 	struct ia_css_yuvpp_settings *mycs;
 	struct ia_css_binary *next_binary;
-	struct ia_css_cas_binary_descr cas_scaler_descr = IA_CSS_DEFAULT_CAS_BINARY_DESCR;
+	struct ia_css_cas_binary_descr cas_scaler_descr = { };
 	unsigned int i, j;
 	bool need_isp_copy_binary = false;
 
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h
index 18f2027aeb86..c690a184ccd4 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h
@@ -52,11 +52,6 @@ struct ia_css_pipe_extra_config {
 	bool disable_vf_pp;
 };
 
-#define DEFAULT_PIPE_EXTRA_CONFIG ( \
-	(struct ia_css_pipe_extra_config) { \
-	} \
-)
-
 enum ia_css_err
 ia_css_pipe_create_extra(const struct ia_css_pipe_config *config,
 			 const struct ia_css_pipe_extra_config *extra_config,
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h
index aa3badd7e9da..2ef9238d95ad 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h
@@ -24,11 +24,6 @@ struct sh_css_pc_histogram {
 	unsigned *msink;
 };
 
-#define DEFAULT_PC_HISTOGRAM ( \
-	(struct sh_css_pc_histogram) { \
-	} \
-)
-
 struct sh_css_binary_metrics {
 	unsigned mode;
 	unsigned id;
@@ -37,13 +32,6 @@ struct sh_css_binary_metrics {
 	struct sh_css_binary_metrics *next;
 };
 
-#define DEFAULT_BINARY_METRICS ( \
-	(struct sh_css_binary_metrics) { \
-		.isp_histogram	= DEFAULT_PC_HISTOGRAM, \
-		.sp_histogram	= DEFAULT_PC_HISTOGRAM, \
-	} \
-)
-
 struct ia_css_frame_metrics {
 	unsigned num_frames;
 };
-- 
2.15.0

^ permalink raw reply related	[flat|nested] 53+ messages in thread

* Re: [PATCH v2 2/3] media: atomisp: delete zero-valued struct members.
  2017-12-01 17:19                         ` [PATCH v2 2/3] media: atomisp: delete zero-valued struct members Jeremy Sowden
@ 2017-12-01 17:41                           ` Alan Cox
  2017-12-02 15:00                             ` Jeremy Sowden
  0 siblings, 1 reply; 53+ messages in thread
From: Alan Cox @ 2017-12-01 17:41 UTC (permalink / raw)
  To: Jeremy Sowden; +Cc: linux-media, devel


> --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe_public.h
> +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe_public.h
> @@ -152,14 +152,6 @@ struct ia_css_pipe_config {
>  };
>  


Thani you that's a really good cleanup.

Alan

^ permalink raw reply	[flat|nested] 53+ messages in thread

* [PATCH v3 0/3] media: atomisp: clean up of data-structure initialization in the CSS API
  2017-12-01 15:07                     ` Dan Carpenter
  2017-12-01 15:31                       ` Jeremy Sowden
  2017-12-01 17:19                       ` [PATCH v2 0/3] media: atomisp: clean up of data-structure initialization in the CSS API Jeremy Sowden
@ 2017-12-01 21:45                       ` Jeremy Sowden
  2017-12-01 21:45                         ` [PATCH v3 1/3] media: atomisp: convert default struct values to use compound-literals with designated initializers Jeremy Sowden
                                           ` (2 more replies)
  2 siblings, 3 replies; 53+ messages in thread
From: Jeremy Sowden @ 2017-12-01 21:45 UTC (permalink / raw)
  To: linux-media

v3.

  Rebased on to git://linuxtv.org/media_tree.git.  Patch-set applies cleanly to
  linux-next as of 20171201.

v2.

  Fixed a couple of bugs and addressed checkpatch errors.

v1.

  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 made it
  possible 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.

  The designated initializers also allow the removal of lots of
  struct-members initialized to zero values.

  I made the changes in three stages: firstly, I converted the default
  values to compound-literals and designated initializers and removed
  the temporary variables; secondly, I removed the zero-valued
  struct-members; finally, I removed some structs which had become
  empty.

Jeremy Sowden (3):
  media: atomisp: convert default struct values to use compound-literals
    with designated initializers.
  media: atomisp: delete zero-valued struct members.
  media: atomisp: delete empty default struct values.

 .../hive_isp_css_common/input_formatter_global.h   |  16 ---
 .../pci/atomisp2/css2400/ia_css_frame_public.h     |  39 +++---
 .../atomisp/pci/atomisp2/css2400/ia_css_pipe.h     | 138 ++++++++-------------
 .../pci/atomisp2/css2400/ia_css_pipe_public.h      | 118 +++---------------
 .../atomisp/pci/atomisp2/css2400/ia_css_types.h    |  79 ++++--------
 .../isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h     |  50 +-------
 .../kernels/sdis/common/ia_css_sdis_common_types.h |  34 ++---
 .../isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c   |   3 +-
 .../runtime/binary/interface/ia_css_binary.h       |  93 ++------------
 .../atomisp2/css2400/runtime/binary/src/binary.c   |   3 +-
 .../isp_param/interface/ia_css_isp_param_types.h   |  10 --
 .../runtime/pipeline/interface/ia_css_pipeline.h   |  29 ++---
 .../css2400/runtime/pipeline/src/pipeline.c        |   7 +-
 .../media/atomisp/pci/atomisp2/css2400/sh_css.c    |  31 ++---
 .../atomisp/pci/atomisp2/css2400/sh_css_legacy.h   |  11 --
 .../atomisp/pci/atomisp2/css2400/sh_css_metrics.h  |  21 ----
 16 files changed, 160 insertions(+), 522 deletions(-)


base-commit: 781b045baefdabf7e0bc9f33672ca830d3db9f27
-- 
2.15.0

^ permalink raw reply	[flat|nested] 53+ messages in thread

* [PATCH v3 1/3] media: atomisp: convert default struct values to use compound-literals with designated initializers.
  2017-12-01 21:45                       ` [PATCH v3 0/3] media: atomisp: clean up of data-structure initialization in the CSS API Jeremy Sowden
@ 2017-12-01 21:45                         ` Jeremy Sowden
  2017-12-01 21:45                         ` [PATCH v3 2/3] media: atomisp: delete zero-valued struct members Jeremy Sowden
  2017-12-01 21:45                         ` [PATCH v3 3/3] media: atomisp: delete empty default struct values Jeremy Sowden
  2 siblings, 0 replies; 53+ messages in thread
From: Jeremy Sowden @ 2017-12-01 21:45 UTC (permalink / raw)
  To: linux-media

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.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 .../hive_isp_css_common/input_formatter_global.h   |  31 ++--
 .../pci/atomisp2/css2400/ia_css_frame_public.h     |  56 ++++---
 .../atomisp/pci/atomisp2/css2400/ia_css_pipe.h     | 173 +++++++++++----------
 .../pci/atomisp2/css2400/ia_css_pipe_public.h      | 159 +++++++++----------
 .../atomisp/pci/atomisp2/css2400/ia_css_types.h    |  98 ++++++------
 .../isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h     | 149 +++++++++++++-----
 .../kernels/sdis/common/ia_css_sdis_common_types.h |  96 +++++++++---
 .../isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c   |   3 +-
 .../runtime/binary/interface/ia_css_binary.h       | 155 +++++++++---------
 .../atomisp2/css2400/runtime/binary/src/binary.c   |   3 +-
 .../isp_param/interface/ia_css_isp_param_types.h   |  32 ++--
 .../runtime/pipeline/interface/ia_css_pipeline.h   |  35 +++--
 .../css2400/runtime/pipeline/src/pipeline.c        |   7 +-
 .../media/atomisp/pci/atomisp2/css2400/sh_css.c    |  22 +--
 .../atomisp/pci/atomisp2/css2400/sh_css_legacy.h   |  21 +--
 .../atomisp/pci/atomisp2/css2400/sh_css_metrics.h  |  36 ++---
 16 files changed, 613 insertions(+), 463 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/input_formatter_global.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/input_formatter_global.h
index 5654d911db65..5e19b5bd56e6 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/input_formatter_global.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/input_formatter_global.h
@@ -107,21 +107,22 @@ struct input_formatter_cfg_s {
 	uint32_t	block_no_reqs;
 };
 
-#define DEFAULT_IF_CONFIG \
-{ \
-	0,          /* start_line */\
-	0,          /* start_column */\
-	0,          /* left_padding */\
-	0,          /* cropped_height */\
-	0,          /* cropped_width */\
-	0,          /* deinterleaving */\
-	0,          /*.buf_vecs */\
-	0,          /* buf_start_index */\
-	0,          /* buf_increment */\
-	0,          /* buf_eol_offset */\
-	false,      /* is_yuv420_format */\
-	false       /* block_no_reqs */\
-}
+#define DEFAULT_IF_CONFIG ( \
+	(struct input_formatter_cfg_s) { \
+		.start_line		= 0, \
+		.start_column		= 0, \
+		.left_padding		= 0, \
+		.cropped_height		= 0, \
+		.cropped_width		= 0, \
+		.deinterleaving		= 0, \
+		.buf_vecs		= 0, \
+		.buf_start_index	= 0, \
+		.buf_increment		= 0, \
+		.buf_eol_offset		= 0, \
+		.is_yuv420_format	= false, \
+		.block_no_reqs		= false \
+	} \
+)
 
 extern const hrt_address HIVE_IF_SRST_ADDRESS[N_INPUT_FORMATTER_ID];
 extern const hrt_data HIVE_IF_SRST_MASK[N_INPUT_FORMATTER_ID];
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_frame_public.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_frame_public.h
index ba7a076c3afa..d0408884c524 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_frame_public.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_frame_public.h
@@ -120,17 +120,22 @@ struct ia_css_frame_info {
 	struct ia_css_crop_info crop_info;
 };
 
-#define IA_CSS_BINARY_DEFAULT_FRAME_INFO \
-{ \
-	{0,                      /* width */ \
-	 0},                     /* height */ \
-	0,                       /* padded_width */ \
-	IA_CSS_FRAME_FORMAT_NUM, /* format */ \
-	0,                       /* raw_bit_depth */ \
-	IA_CSS_BAYER_ORDER_NUM,  /* raw_bayer_order */ \
-	{0,                       /*start col */ \
-	 0},                       /*start line */ \
-}
+#define IA_CSS_BINARY_DEFAULT_FRAME_INFO ( \
+	(struct ia_css_frame_info) { \
+		.res			= (struct ia_css_resolution) { \
+						.width = 0, \
+						.height = 0 \
+					}, \
+		.padded_width		= 0, \
+		.format			= IA_CSS_FRAME_FORMAT_NUM,  \
+		.raw_bit_depth		= 0, \
+		.raw_bayer_order	= IA_CSS_BAYER_ORDER_NUM, \
+		.crop_info		= (struct ia_css_crop_info) { \
+						.start_column	= 0, \
+						.start_line	= 0 \
+					}, \
+	} \
+)
 
 /**
  *  Specifies the DVS loop delay in "frame periods"
@@ -189,20 +194,21 @@ struct ia_css_frame {
 		       info.format */
 };
 
-#define DEFAULT_FRAME \
-{ \
-	IA_CSS_BINARY_DEFAULT_FRAME_INFO,	/* info */ \
-	0,					/* data */ \
-	0,					/* data_bytes */ \
-	SH_CSS_INVALID_QUEUE_ID,		/* dynamic_data_index */ \
-	IA_CSS_BUFFER_TYPE_INVALID,			/* buf_type */ \
-	IA_CSS_FRAME_FLASH_STATE_NONE,		/* flash_state */ \
-	0,					/* exp_id */ \
-	0,					/* isp_config_id */ \
-	false,					/* valid */ \
-	false,					/* contiguous  */ \
-	{ 0 }					/* planes */ \
-}
+#define DEFAULT_FRAME ( \
+	(struct ia_css_frame) { \
+		.info			= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
+		.data			= 0, \
+		.data_bytes		= 0, \
+		.dynamic_queue_id	= SH_CSS_INVALID_QUEUE_ID, \
+		.buf_type		= IA_CSS_BUFFER_TYPE_INVALID, \
+		.flash_state		= IA_CSS_FRAME_FLASH_STATE_NONE, \
+		.exp_id			= 0, \
+		.isp_config_id		= 0, \
+		.valid			= false, \
+		.contiguous		= false, \
+		.planes			= { 0 } \
+	} \
+)
 
 /* @brief Fill a frame with zeros
  *
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h
index d0c0e6b92025..bfebfd8d6e63 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h
@@ -33,23 +33,24 @@ struct ia_css_preview_settings {
 	/* 2401 only for these two - do we in fact use them for anything real */
 	struct ia_css_frame *delay_frames[MAX_NUM_DELAY_FRAMES];
 	struct ia_css_frame *tnr_frames[NUM_TNR_FRAMES];
-	
+
 	struct ia_css_pipe *copy_pipe;
 	struct ia_css_pipe *capture_pipe;
 	struct ia_css_pipe *acc_pipe;
 };
 
-#define IA_CSS_DEFAULT_PREVIEW_SETTINGS \
-{ \
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* copy_binary */\
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* preview_binary */\
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* vf_pp_binary */\
-	{ NULL },			/* dvs_frames */ \
-	{ NULL },			/* tnr_frames */ \
-	NULL,				/* copy_pipe */\
-	NULL,				/* capture_pipe */\
-	NULL,				/* acc_pipe */\
-}
+#define IA_CSS_DEFAULT_PREVIEW_SETTINGS  ( \
+	(struct ia_css_preview_settings) { \
+		.copy_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+		.preview_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+		.vf_pp_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+		.delay_frames	= { NULL }, \
+		.tnr_frames	= { NULL }, \
+		.copy_pipe	= NULL, \
+		.capture_pipe	= NULL, \
+		.acc_pipe	= NULL, \
+	} \
+)
 
 struct ia_css_capture_settings {
 	struct ia_css_binary copy_binary;
@@ -69,22 +70,23 @@ struct ia_css_capture_settings {
 	unsigned int num_yuv_scaler;
 };
 
-#define IA_CSS_DEFAULT_CAPTURE_SETTINGS \
-{ \
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* copy_binary */\
-	{IA_CSS_BINARY_DEFAULT_SETTINGS},	/* primary_binary */\
-	0,				/* num_primary_stage */\
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* pre_isp_binary */\
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* anr_gdc_binary */\
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* post_isp_binary */\
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* capture_pp_binary */\
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* vf_pp_binary */\
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* capture_ldc_binary */\
-	NULL,				/* yuv_scaler_binary */ \
-	{ NULL },			/* delay_frames[ref_frames] */ \
-	NULL,				/* is_output_stage */ \
-	0,				/* num_yuv_scaler */ \
-}
+#define IA_CSS_DEFAULT_CAPTURE_SETTINGS ( \
+	(struct ia_css_capture_settings) { \
+		.copy_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+		.primary_binary		= {IA_CSS_BINARY_DEFAULT_SETTINGS}, \
+		.num_primary_stage	= 0, \
+		.pre_isp_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+		.anr_gdc_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+		.post_isp_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+		.capture_pp_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+		.vf_pp_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+		.capture_ldc_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+		.yuv_scaler_binary	= NULL, \
+		.delay_frames		= { NULL }, \
+		.is_output_stage	= NULL, \
+		.num_yuv_scaler		= 0, \
+	} \
+)
 
 struct ia_css_video_settings {
 	struct ia_css_binary copy_binary;
@@ -104,20 +106,21 @@ struct ia_css_video_settings {
 	unsigned int num_yuv_scaler;
 };
 
-#define IA_CSS_DEFAULT_VIDEO_SETTINGS \
-{ \
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* copy_binary */ \
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* video_binary */ \
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* vf_pp_binary */ \
-	NULL,				/* yuv_scaler_binary */ \
-	{ NULL },			/* delay_frames */ \
-	{ NULL },			/* tnr_frames */ \
-	NULL,				/* vf_pp_in_frame */ \
-	NULL,				/* copy_pipe */ \
-	NULL,				/* capture_pipe */ \
-	NULL,				/* is_output_stage */ \
-	0,				/* num_yuv_scaler */ \
-}
+#define IA_CSS_DEFAULT_VIDEO_SETTINGS ( \
+	(struct ia_css_video_settings) { \
+		.copy_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+		.video_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+		.vf_pp_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+		.yuv_scaler_binary	= NULL, \
+		.delay_frames		= { NULL }, \
+		.tnr_frames		= { NULL }, \
+		.vf_pp_in_frame		= NULL, \
+		.copy_pipe		= NULL, \
+		.capture_pipe		= NULL, \
+		.is_output_stage	= NULL, \
+		.num_yuv_scaler		= 0, \
+	} \
+)
 
 struct ia_css_yuvpp_settings {
 	struct ia_css_binary copy_binary;
@@ -129,16 +132,17 @@ struct ia_css_yuvpp_settings {
 	unsigned int num_output;
 };
 
-#define IA_CSS_DEFAULT_YUVPP_SETTINGS \
-{ \
-	IA_CSS_BINARY_DEFAULT_SETTINGS,		/* copy_binary */ \
-	NULL,					/* yuv_scaler_binary */ \
-	NULL,					/* vf_pp_binary */ \
-	NULL,					/* is_output_stage */ \
-	0,					/* num_yuv_scaler */ \
-	0,					/* num_vf_pp */ \
-	0,					/* num_output */ \
-}
+#define IA_CSS_DEFAULT_YUVPP_SETTINGS ( \
+	(struct ia_css_yuvpp_settings) { \
+		.copy_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+		.yuv_scaler_binary	= NULL, \
+		.vf_pp_binary		= NULL, \
+		.is_output_stage	= NULL, \
+		.num_yuv_scaler		= 0, \
+		.num_vf_pp		= 0, \
+		.num_output		= 0, \
+	} \
+)
 
 struct osys_object;
 
@@ -184,37 +188,40 @@ struct ia_css_pipe {
 	unsigned int pipe_num;
 };
 
-#define IA_CSS_DEFAULT_PIPE \
-{ \
-	false,					/* stop_requested */ \
-	DEFAULT_PIPE_CONFIG,			/* config */ \
-	DEFAULT_PIPE_EXTRA_CONFIG,		/* extra_config */ \
-	DEFAULT_PIPE_INFO,			/* info */ \
-	IA_CSS_PIPE_ID_ACC,			/* mode (pipe_id) */ \
-	NULL,					/* shading_table */ \
-	DEFAULT_PIPELINE,			/* pipeline */ \
-	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* output_info */ \
-	IA_CSS_BINARY_DEFAULT_FRAME_INFO,	/* bds_output_info */ \
-	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* vf_output_info */ \
-	IA_CSS_BINARY_DEFAULT_FRAME_INFO,	/* out_yuv_ds_input_info */ \
-	IA_CSS_BINARY_DEFAULT_FRAME_INFO,	/* vf_yuv_ds_input_info */ \
-	NULL,					/* output_stage */ \
-	NULL,					/* vf_stage */ \
-	SH_CSS_BDS_FACTOR_1_00,			/* required_bds_factor */ \
-	1,					/* dvs_frame_delay */ \
-	0,					/* num_invalid_frames */ \
-	{true},					/* enable_viewfinder */ \
-	NULL,					/* stream */ \
-	DEFAULT_FRAME,				/* in_frame_struct */ \
-	DEFAULT_FRAME,				/* out_frame_struct */ \
-	DEFAULT_FRAME,				/* vf_frame_struct */ \
-	{ NULL },				/* continuous_frames */ \
-	{ NULL },				/* cont_md_buffers */ \
-	{ IA_CSS_DEFAULT_PREVIEW_SETTINGS },	/* pipe_settings */ \
-	0,					/* scaler_pp_lut */ \
-	NULL,					/* osys object */ \
-	PIPE_ENTRY_EMPTY_TOKEN,			/* pipe_num */\
-}
+#define IA_CSS_DEFAULT_PIPE ( \
+	(struct ia_css_pipe) { \
+		.stop_requested		= false, \
+		.config			= DEFAULT_PIPE_CONFIG, \
+		.extra_config		= DEFAULT_PIPE_EXTRA_CONFIG, \
+		.info			= DEFAULT_PIPE_INFO, \
+		.mode			= IA_CSS_PIPE_ID_ACC, /* (pipe_id) */ \
+		.shading_table		= NULL, \
+		.pipeline		= DEFAULT_PIPELINE, \
+		.output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
+		.bds_output_info	= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
+		.vf_output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
+		.out_yuv_ds_input_info	= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
+		.vf_yuv_ds_input_info	= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
+		.output_stage		= NULL, \
+		.vf_stage		= NULL, \
+		.required_bds_factor	= SH_CSS_BDS_FACTOR_1_00, \
+		.dvs_frame_delay	= 1, \
+		.num_invalid_frames	= 0, \
+		.enable_viewfinder	= {true}, \
+		.stream			= NULL, \
+		.in_frame_struct	= DEFAULT_FRAME, \
+		.out_frame_struct	= DEFAULT_FRAME, \
+		.vf_frame_struct	= DEFAULT_FRAME, \
+		.continuous_frames	= { NULL }, \
+		.cont_md_buffers	= { NULL }, \
+		.pipe_settings		= { \
+			.preview = IA_CSS_DEFAULT_PREVIEW_SETTINGS \
+		}, \
+		.scaler_pp_lut		= 0, \
+		.osys_obj		= NULL, \
+		.pipe_num		= PIPE_ENTRY_EMPTY_TOKEN, \
+	} \
+)
 
 void ia_css_pipe_map_queue(struct ia_css_pipe *pipe, bool map);
 
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe_public.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe_public.h
index df0aad9a6ab9..5c8830486aec 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe_public.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe_public.h
@@ -156,75 +156,76 @@ struct ia_css_pipe_config {
 /**
  * Default origin of internal frame positioned on shading table.
  */
-#define IA_CSS_PIPE_DEFAULT_INTERNAL_FRAME_ORIGIN_BQS_ON_SCTBL \
-{ \
-	0,					/* x [bqs] */ \
-	0					/* y [bqs] */ \
-}
+#define IA_CSS_PIPE_DEFAULT_INTERNAL_FRAME_ORIGIN_BQS_ON_SCTBL ( \
+	(struct ia_css_coordinate) { .x = 0, .y = 0 } \
+)
 
 /**
  * Default settings for newly created pipe configurations.
  */
-#define DEFAULT_PIPE_CONFIG \
-{ \
-	IA_CSS_PIPE_MODE_PREVIEW,		/* mode */ \
-	1,					/* isp_pipe_version */ \
-	{ 0, 0 },				/* pipe_effective_input_res */ \
-	{ 0, 0 },				/* bayer_ds_out_res */ \
-	{ 0, 0 },				/* vf_pp_in_res */ \
-	{ 0, 0 },				/* capt_pp_in_res */ \
-	{ 0, 0 },				/* output_system_in_res */ \
-	{ 0, 0 },				/* dvs_crop_out_res */ \
-	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* output_info */ \
-	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* vf_output_info */ \
-	NULL,					/* acc_extension */ \
-	NULL,					/* acc_stages */ \
-	0,					/* num_acc_stages */ \
-	DEFAULT_CAPTURE_CONFIG,			/* default_capture_config */ \
-	{ 0, 0 },				/* dvs_envelope */ \
-	IA_CSS_FRAME_DELAY_1,			/* dvs_frame_delay */ \
-	-1,					/* acc_num_execs */ \
-	false,					/* enable_dz */ \
-	false,					/* enable_dpc */ \
-	false,					/* enable_vfpp_bci */ \
-	false,					/* enable_luma_only */ \
-	false,					/* enable_tnr */ \
-	NULL,					/* p_isp_config */\
-	{ 0, 0 },				/* gdc_in_buffer_res */ \
-	{ 0, 0 },				/* gdc_in_buffer_offset */ \
-	IA_CSS_PIPE_DEFAULT_INTERNAL_FRAME_ORIGIN_BQS_ON_SCTBL	/* internal_frame_origin_bqs_on_sctbl */ \
-}
+#define DEFAULT_PIPE_CONFIG ( \
+	(struct ia_css_pipe_config) { \
+		.mode			= IA_CSS_PIPE_MODE_PREVIEW, \
+		.isp_pipe_version	= 1, \
+		.input_effective_res	= { 0, 0 }, \
+		.bayer_ds_out_res	= { 0, 0 }, \
+		.capt_pp_in_res		= { 0, 0 }, \
+		.vf_pp_in_res		= { 0, 0 }, \
+		.output_system_in_res	= { 0, 0 }, \
+		.dvs_crop_out_res	= { 0, 0 }, \
+		.output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
+		.vf_output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
+		.acc_extension		= NULL, \
+		.acc_stages		= NULL, \
+		.num_acc_stages		= 0, \
+		.default_capture_config	= DEFAULT_CAPTURE_CONFIG, \
+		.dvs_envelope		= { 0, 0 }, \
+		.dvs_frame_delay	= IA_CSS_FRAME_DELAY_1, \
+		.acc_num_execs		= -1, \
+		.enable_dz		= false, \
+		.enable_dpc		= false, \
+		.enable_vfpp_bci	= false, \
+		.enable_luma_only	= false, \
+		.enable_tnr		= false, \
+		.p_isp_config		= NULL, \
+		.gdc_in_buffer_res	= { 0, 0 }, \
+		.gdc_in_buffer_offset	= { 0, 0 }, \
+		.internal_frame_origin_bqs_on_sctbl \
+					= IA_CSS_PIPE_DEFAULT_INTERNAL_FRAME_ORIGIN_BQS_ON_SCTBL \
+	} \
+)
 
 #else
 
 /**
  * Default settings for newly created pipe configurations.
  */
-#define DEFAULT_PIPE_CONFIG \
-{ \
-	IA_CSS_PIPE_MODE_PREVIEW,		/* mode */ \
-	1,					/* isp_pipe_version */ \
-	{ 0, 0 },				/* pipe_effective_input_res */ \
-	{ 0, 0 },				/* bayer_ds_out_res */ \
-	{ 0, 0 },				/* vf_pp_in_res */ \
-	{ 0, 0 },				/* capt_pp_in_res */ \
-	{ 0, 0 },				/* dvs_crop_out_res */ \
-	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* output_info */ \
-	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* vf_output_info */ \
-	NULL,					/* acc_extension */ \
-	NULL,					/* acc_stages */ \
-	0,					/* num_acc_stages */ \
-	DEFAULT_CAPTURE_CONFIG,			/* default_capture_config */ \
-	{ 0, 0 },				/* dvs_envelope */ \
-	IA_CSS_FRAME_DELAY_1,			/* dvs_frame_delay */ \
-	-1,					/* acc_num_execs */ \
-	false,					/* enable_dz */ \
-	false,					/* enable_dpc */ \
-	false,					/* enable_vfpp_bci */ \
-	NULL,					/* p_isp_config */\
-	{ 0, 0 },				/* gdc_in_buffer_res */ \
-	{ 0, 0 }				/* gdc_in_buffer_offset */ \
-}
+#define DEFAULT_PIPE_CONFIG ( \
+	(struct ia_css_pipe_config) { \
+		.mode			= IA_CSS_PIPE_MODE_PREVIEW, \
+		.isp_pipe_version	= 1, \
+		.input_effective_res	= { 0, 0 }, \
+		.bayer_ds_out_res	= { 0, 0 }, \
+		.capt_pp_in_res		= { 0, 0 }, \
+		.vf_pp_in_res		= { 0, 0 }, \
+		.dvs_crop_out_res	= { 0, 0 }, \
+		.output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
+		.vf_output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
+		.acc_extension		= NULL, \
+		.acc_stages		= NULL, \
+		.num_acc_stages		= 0, \
+		.default_capture_config	= DEFAULT_CAPTURE_CONFIG, \
+		.dvs_envelope		= { 0, 0 }, \
+		.dvs_frame_delay	= IA_CSS_FRAME_DELAY_1, \
+		.acc_num_execs		= -1, \
+		.enable_dz		= false, \
+		.enable_dpc		= false, \
+		.enable_vfpp_bci	= false, \
+		.p_isp_config		= NULL, \
+		.gdc_in_buffer_res	= { 0, 0 }, \
+		.gdc_in_buffer_offset	= { 0, 0 } \
+	} \
+)
 
 #endif
 
@@ -274,28 +275,30 @@ struct ia_css_pipe_info {
  */
 #ifdef ISP2401
 
-#define DEFAULT_PIPE_INFO \
-{ \
-	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* output_info */ \
-	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* vf_output_info */ \
-	IA_CSS_BINARY_DEFAULT_FRAME_INFO,	/* raw_output_info */ \
-	{ 0, 0},				/* output system in res */ \
-	DEFAULT_SHADING_INFO,			/* shading_info */ \
-	DEFAULT_GRID_INFO,			/* grid_info */ \
-	0					/* num_invalid_frames */ \
-}
+#define DEFAULT_PIPE_INFO ( \
+	(struct ia_css_pipe_info) { \
+		.output_info			= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
+		.vf_output_info			= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
+		.raw_output_info		= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
+		.output_system_in_res_info	= { 0, 0 }, \
+		.shading_info			= DEFAULT_SHADING_INFO, \
+		.grid_info			= DEFAULT_GRID_INFO, \
+		.num_invalid_frames		= 0 \
+	} \
+)
 
 #else
 
-#define DEFAULT_PIPE_INFO \
-{ \
-	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* output_info */ \
-	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* vf_output_info */ \
-	IA_CSS_BINARY_DEFAULT_FRAME_INFO,	/* raw_output_info */ \
-	DEFAULT_SHADING_INFO,			/* shading_info */ \
-	DEFAULT_GRID_INFO,			/* grid_info */ \
-	0					/* num_invalid_frames */ \
-}
+#define DEFAULT_PIPE_INFO ( \
+	(struct ia_css_pipe_info) { \
+		.output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
+		.vf_output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
+		.raw_output_info	= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
+		.shading_info		= DEFAULT_SHADING_INFO, \
+		.grid_info		= DEFAULT_GRID_INFO, \
+		.num_invalid_frames	= 0 \
+	} \
+)
 
 #endif
 
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h
index 725b90072cfe..95e77da5c464 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h
@@ -373,46 +373,48 @@ struct ia_css_shading_info {
 #ifndef ISP2401
 
 /* Default Shading Correction information of Shading Correction Type 1. */
-#define DEFAULT_SHADING_INFO_TYPE_1 \
-{ \
-	IA_CSS_SHADING_CORRECTION_TYPE_1,	/* type */ \
-	{					/* info */ \
-		{ \
-			0,	/* enable */ \
-			0,	/* num_hor_grids */ \
-			0,	/* num_ver_grids */ \
-			0,	/* bqs_per_grid_cell */ \
-			1,	/* bayer_scale_hor_ratio_in */ \
-			1,	/* bayer_scale_hor_ratio_out */ \
-			1,	/* bayer_scale_ver_ratio_in */ \
-			1,	/* bayer_scale_ver_ratio_out */ \
-			0,	/* sc_bayer_origin_x_bqs_on_shading_table */ \
-			0	/* sc_bayer_origin_y_bqs_on_shading_table */ \
+#define DEFAULT_SHADING_INFO_TYPE_1 ( \
+	(struct ia_css_shading_info) { \
+		.type = IA_CSS_SHADING_CORRECTION_TYPE_1, \
+		.info = { \
+			.type_1 = { \
+				.enable					= 0, \
+				.num_hor_grids				= 0, \
+				.num_ver_grids				= 0, \
+				.bqs_per_grid_cell			= 0, \
+				.bayer_scale_hor_ratio_in		= 1, \
+				.bayer_scale_hor_ratio_out		= 1, \
+				.bayer_scale_ver_ratio_in		= 1, \
+				.bayer_scale_ver_ratio_out		= 1, \
+				.sc_bayer_origin_x_bqs_on_shading_table	= 0, \
+				.sc_bayer_origin_y_bqs_on_shading_table	= 0 \
+			} \
 		} \
 	} \
-}
+)
 
 #else
 
 /* Default Shading Correction information of Shading Correction Type 1. */
-#define DEFAULT_SHADING_INFO_TYPE_1 \
-{ \
-	IA_CSS_SHADING_CORRECTION_TYPE_1,	/* type */ \
-	{					/* info */ \
-		{ \
-			0,			/* num_hor_grids */ \
-			0,			/* num_ver_grids */ \
-			0,			/* bqs_per_grid_cell */ \
-			1,			/* bayer_scale_hor_ratio_in */ \
-			1,			/* bayer_scale_hor_ratio_out */ \
-			1,			/* bayer_scale_ver_ratio_in */ \
-			1,			/* bayer_scale_ver_ratio_out */ \
-			{0, 0},			/* isp_input_sensor_data_res_bqs */ \
-			{0, 0},			/* sensor_data_res_bqs */ \
-			{0, 0}			/* sensor_data_origin_bqs_on_sctbl */ \
+#define DEFAULT_SHADING_INFO_TYPE_1 ( \
+	(struct ia_css_shading_info) { \
+		.type = IA_CSS_SHADING_CORRECTION_TYPE_1, \
+		.info = { \
+			.type_1 = { \
+				.num_hor_grids				= 0, \
+				.num_ver_grids				= 0, \
+				.bqs_per_grid_cell			= 0, \
+				.bayer_scale_hor_ratio_in		= 1, \
+				.bayer_scale_hor_ratio_out		= 1, \
+				.bayer_scale_ver_ratio_in		= 1, \
+				.bayer_scale_ver_ratio_out		= 1, \
+				.isp_input_sensor_data_res_bqs		= {0, 0}, \
+				.sensor_data_res_bqs			= {0, 0}, \
+				.sensor_data_origin_bqs_on_sctbl	= {0, 0} \
+			} \
 		} \
 	} \
-}
+)
 
 #endif
 
@@ -437,14 +439,15 @@ struct ia_css_grid_info {
 };
 
 /* defaults for ia_css_grid_info structs */
-#define DEFAULT_GRID_INFO \
-{ \
-	0,				/* isp_in_width */ \
-	0,				/* isp_in_height */ \
-	DEFAULT_3A_GRID_INFO,		/* s3a_grid */ \
-	DEFAULT_DVS_GRID_INFO,		/* dvs_grid */ \
-	IA_CSS_VAMEM_TYPE_1		/* vamem_type */ \
-}
+#define DEFAULT_GRID_INFO ( \
+	(struct ia_css_grid_info) { \
+		.isp_in_width	= 0, \
+		.isp_in_height	= 0, \
+		.s3a_grid	= DEFAULT_3A_GRID_INFO, \
+		.dvs_grid	= DEFAULT_DVS_GRID_INFO, \
+		.vamem_type	= IA_CSS_VAMEM_TYPE_1 \
+	} \
+)
 
 /* Morphing table, used for geometric distortion and chromatic abberration
  *  correction (GDCAC, also called GDC).
@@ -533,13 +536,14 @@ struct ia_css_capture_config {
 };
 
 /* default settings for ia_css_capture_config structs */
-#define DEFAULT_CAPTURE_CONFIG \
-{ \
-	IA_CSS_CAPTURE_MODE_PRIMARY,	/* mode (capture) */ \
-	false,				/* enable_xnr */ \
-	false,				/* enable_raw_output */ \
-	false				/* enable_capture_pp_bli */ \
-}
+#define DEFAULT_CAPTURE_CONFIG ( \
+	(struct ia_css_capture_config) { \
+		.mode			= IA_CSS_CAPTURE_MODE_PRIMARY, \
+		.enable_xnr		= false, \
+		.enable_raw_output	= false, \
+		.enable_capture_pp_bli	= false \
+	} \
+)
 
 
 /* ISP filter configuration. This is a collection of configurations
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h
index 8d674d2c6427..19fb0b885c72 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h
@@ -28,7 +28,7 @@
 /* 3A configuration. This configures the 3A statistics collection
  *  module.
  */
- 
+
 /* 3A statistics grid
  *
  *  ISP block: S3A1 (3A Support for 3A ver.1 (Histogram is not used for AE))
@@ -54,7 +54,7 @@ struct ia_css_3a_grid_info {
   	uint32_t awb_fr_enable;					/** awb_fr enabled in binary,
 								   0:disabled, 1:enabled */
 	struct awb_fr_public_grid_config	awb_fr_grd_info;/** see description in awb_fr_public.h*/
-  
+
         uint32_t elem_bit_depth;    /** TODO:Taken from BYT  - need input from AIQ
 					if needed for SKC
 					Bit depth of element used
@@ -100,47 +100,118 @@ struct ia_css_3a_grid_info {
 
 #if defined(SYSTEM_css_skycam_c0_system)
 #if defined USE_NEW_AE_STRUCT || defined USE_NEW_AWB_STRUCT
-#define DEFAULT_3A_GRID_INFO \
-{ \
-	0,				/* ae_enable */ \
-	{0,0,0,0,0,0,0},	        /* AE:     width,height,b_width,b_height,x_start,y_start*/ \
-	0,				/* awb_enable */ \
-	{0,0,0,0,0,0},			/* AWB:    width,height,b_width,b_height,x_start,y_start*/ \
-	0,				/* af_enable */ \
-	{0,0,0,0,0,0,0},		/* AF:     width,height,b_width,b_height,x_start,y_start,ff_en*/ \
-	0,				/* awb_fr_enable */ \
-	{0,0,0,0,0,0,0},                  /* AWB_FR: width,height,b_width,b_height,x_start,y_start,ff_en*/ \
-	0,				/* elem_bit_depth */ \
-}
+#define DEFAULT_3A_GRID_INFO ( \
+	(struct ia_css_3a_grid_info) { \
+		.ae_enable		= 0, \
+		.ae_grd_info		= (struct ae_public_config_grid_config) { \
+						.width = 0, \
+						.height = 0, \
+						.b_width = 0, \
+						.b_height = 0, \
+						.x_start = 0, \
+						.y_start = 0, \
+						.x_end = 0, \
+						.y_end = 0 \
+					  } \
+		.awb_enable		= 0, \
+		.awb_grd_info		= (struct awb_public_config_grid_config) { \
+						.width = 0, \
+						.height = 0, \
+						.b_width = 0, \
+						.b_height = 0, \
+						.x_start = 0, \
+						.y_start = 0, \
+						.x_end = 0, \
+						.y_end = 0 \
+					  }	\
+		.af_enable		= 0, \
+		.af_grd_info		= (struct af_public_grid_config) { \
+						.width = 0, \
+						.height = 0, \
+						.b_width = 0, \
+						.b_height = 0, \
+						.x_start = 0, \
+						.y_start = 0, \
+						.ff_en = 0 \
+					  } \
+		.awb_fr_enable		= 0, \
+		.awb_fr_grd_info	= (struct awb_fr_public_grid_config) { \
+						.width = 0, \
+						.height = 0, \
+						.b_width = 0, \
+						.b_height = 0, \
+						.x_start = 0, \
+						.y_start = 0, \
+						.ff_en = 0 \
+					  } \
+		.elem_bit_depth		= 0, \
+	} \
+)
 #else
-#define DEFAULT_3A_GRID_INFO \
-{ \
-	0,				/* ae_enable */ \
-	{0,0,0,0,0,0,0,0,0},	        /* AE:     width,height,b_width,b_height,x_start,y_start,x_end,y_end*/ \
-	0,				/* awb_enable */ \
-	{0,0,0,0,0,0,0,0},              /* AWB:    width,height,b_width,b_height,x_start,y_start,x_end,y_end*/ \
-	0,				/* af_enable */ \
-	{0,0,0,0,0,0,0},		/* AF:     width,height,b_width,b_height,x_start,y_start,ff_en*/ \
-	0,				/* awb_fr_enable */ \
-	{0,0,0,0,0,0,0},                  /* AWB_FR: width,height,b_width,b_height,x_start,y_start,ff_en*/ \
-	0,				/* elem_bit_depth */ \
-}
+#define DEFAULT_3A_GRID_INFO ( \
+	(struct ia_css_3a_grid_info) { \
+		.ae_enable		= 0, \
+		.ae_grd_info		= (struct ae_public_config_grid_config) { \
+						.width = 0, \
+						.height = 0, \
+						.b_width = 0, \
+						.b_height = 0, \
+						.x_start = 0, \
+						.y_start = 0, \
+						.x_end = 0, \
+						.y_end = 0 \
+					  } \
+		.awb_enable		= 0, \
+		.awb_grd_info		= (struct awb_public_config_grid_config) { \
+						.width = 0, \
+						.height = 0, \
+						.b_width = 0, \
+						.b_height = 0, \
+						.x_start = 0, \
+						.y_start = 0, \
+						.x_end = 0, \
+						.y_end = 0 \
+					  }	\
+		.af_enable		= 0, \
+		.af_grd_info		= (struct af_public_grid_config) { \
+						.width = 0, \
+						.height = 0, \
+						.b_width = 0, \
+						.b_height = 0, \
+						.x_start = 0, \
+						.y_start = 0, \
+						.ff_en = 0 \
+					  } \
+		.awb_fr_enable		= 0, \
+		.awb_fr_grd_info	= (struct awb_fr_public_grid_config) { \
+						.width = 0, \
+						.height = 0, \
+						.b_width = 0, \
+						.b_height = 0, \
+						.x_start = 0, \
+						.y_start = 0, \
+						.ff_en = 0 \
+					  } \
+		.elem_bit_depth		= 0, \
+	} \
+)
 #endif /* USE_NEW_AE_STRUCT || defined USE_NEW_AWB_STRUCT */
 
 #else
-#define DEFAULT_3A_GRID_INFO \
-{ \
-	0,				/* enable */ \
-	0,				/* use_dmem */ \
-	0,				/* has_histogram */ \
-	0,				/* width */ \
-	0,				/* height */ \
-	0,				/* aligned_width */ \
-	0,				/* aligned_height */ \
-	0,				/* bqs_per_grid_cell */ \
-	0,				/* deci_factor_log2 */ \
-	0,				/* elem_bit_depth */ \
-}
+#define DEFAULT_3A_GRID_INFO ( \
+	(struct ia_css_3a_grid_info) { \
+		.enable			= 0, \
+		.use_dmem		= 0, \
+		.has_histogram		= 0, \
+		.width			= 0, \
+		.height			= 0, \
+		.aligned_width		= 0, \
+		.aligned_height		= 0, \
+		.bqs_per_grid_cell	= 0, \
+		.deci_factor_log2	= 0, \
+		.elem_bit_depth		= 0, \
+	} \
+)
 
 #endif
 
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h
index 031983c357e4..232f1be3ca20 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h
@@ -41,19 +41,24 @@ struct ia_css_sdis_info {
 	uint32_t deci_factor_log2;
 };
 
-#define IA_CSS_DEFAULT_SDIS_INFO \
-	{	\
-		{	{ 0, 0 },	/* dim */ \
-			{ 0, 0 },	/* pad */ \
-		},	/* grid */ \
-		{	{ 0, 0 },	/* dim */ \
-			{ 0, 0 },	/* pad */ \
-		},	/* coef */ \
-		{	{ 0, 0 },	/* dim */ \
-			{ 0, 0 },	/* pad */ \
-		},	/* proj */ \
-		0,	/* dis_deci_factor_log2 */ \
-	}
+#define IA_CSS_DEFAULT_SDIS_INFO ( \
+	(struct ia_css_sdis_info) { \
+		.grid = { \
+			.dim = (struct ia_css_dvs_grid_dim) { .width = 0, .height = 0 }, \
+			.pad = (struct ia_css_dvs_grid_dim) { .width = 0, .height = 0 }, \
+		}, \
+		.coef = { \
+			.dim = (struct ia_css_dvs_grid_dim) { .width = 0, .height = 0 }, \
+			.pad = (struct ia_css_dvs_grid_dim) { .width = 0, .height = 0 }, \
+		}, \
+		.proj = { \
+			.dim = (struct ia_css_dvs_grid_dim) { .width = 0, .height = 0 }, \
+			.pad = (struct ia_css_dvs_grid_dim) { .width = 0, .height = 0 }, \
+		}, \
+		.deci_factor_log2 = 0, \
+	} \
+)
+
 
 /* DVS statistics grid
  *
@@ -209,15 +214,64 @@ struct ia_css_dvs_stat_grid_info {
 
 /* DVS statistics generated by accelerator default grid info
  */
-#define DEFAULT_DVS_GRID_INFO { \
-{ \
-	{ 0, 0, 0},	/* GBL CFG reg: kappa, match_shifrt, binning mode*/ \
-	{{{0, 0, 0, 0}, {0, 0, 0}, {0, 0} }, \
-	{{0, 0, 0, 0}, {0, 0, 0}, {0, 0} }, \
-	{{0, 0, 0, 0}, {0, 0, 0}, {0, 0} } }, \
-	{{0, 0, 0, 0}, {4, 0, 0, 0}, {0, 0, 0, 0} } } \
-}
+#define DEFAULT_DVS_STAT_PUBLIC_DVS_GLOBAL_CFG ( \
+	(struct dvs_stat_public_dvs_global_cfg) { \
+		.kappa		= 0, \
+		.match_shift	= 0, \
+		.ybin_mode	= 0, \
+	} \
+)
+
+#define DEFAULT_DVS_STAT_PUBLIC_DVS_GRD_CFG ( \
+	(struct dvs_stat_public_dvs_grd_cfg) { \
+		.grd_cfg	= (struct dvs_stat_public_dvs_level_grid_cfg) { \
+					.grid_width = 0, \
+					.grid_height = 0, \
+					.block_width = 0, \
+					.block_height = 0 \
+				}, \
+		.grd_start	= (struct dvs_stat_public_dvs_level_grid_start) { \
+					.x_start = 0, \
+					.y_start = 0, \
+					.enable = 0 \
+				}, \
+		.grd_end	= (struct dvs_stat_public_dvs_level_grid_end) { \
+					.x_end = 0, \
+					.y_end = 0, \
+				}, \
+	} \
+)
+
+#define DEFAULT_DVS_STAT_PUBLIC_DVS_LEVEL_FE_ROI_CFG(X_START) ( \
+	(struct dvs_stat_public_dvs_level_fe_roi_cfg) { \
+		.x_start = X_START, \
+		.y_start = 0, \
+		.x_end   = 0, \
+		.y_end   = 0, \
+	} \
+)
+
+#define DEFAULT_DVS_STAT_GRID_INFO ( \
+	(struct ia_css_dvs_stat_grid_info) { \
+		.dvs_gbl_cfg = DEFAULT_DVS_STAT_PUBLIC_DVS_GLOBAL_CFG, \
+		.grd_cfg = { \
+			DEFAULT_DVS_STAT_PUBLIC_DVS_GRD_CFG, \
+			DEFAULT_DVS_STAT_PUBLIC_DVS_GRD_CFG, \
+			DEFAULT_DVS_STAT_PUBLIC_DVS_GRD_CFG \
+		}, \
+		.fe_roi_cfg = { \
+			DEFAULT_DVS_STAT_PUBLIC_DVS_LEVEL_FE_ROI_CFG(0), \
+			DEFAULT_DVS_STAT_PUBLIC_DVS_LEVEL_FE_ROI_CFG(4), \
+			DEFAULT_DVS_STAT_PUBLIC_DVS_LEVEL_FE_ROI_CFG(0), \
+		} \
+	} \
+)
 
+#define DEFAULT_DVS_GRID_INFO ( \
+	(union ia_css_dvs_grid_u) { \
+		.dvs_stat_grid_info = DEFAULT_DVS_STAT_GRID_INFO, \
+	} \
+)
 
 /* Union that holds all types of DVS statistics grid info in
  *  CSS format
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c
index 9478c12abe89..e45a3c3fcf4a 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c
@@ -169,8 +169,7 @@ ia_css_sdis_init_info(
 	unsigned enabled)
 {
 	if (!enabled) {
-		struct ia_css_sdis_info default_dis = IA_CSS_DEFAULT_SDIS_INFO;
-		*dis = default_dis;
+		*dis = IA_CSS_DEFAULT_SDIS_INFO;
 		return;
 	}
 
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..416efad7dd1e 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,16 +93,17 @@ struct ia_css_cas_binary_descr {
 	bool *is_output_stage;
 };
 
-#define IA_CSS_DEFAULT_CAS_BINARY_DESCR \
-{ \
-	0,		\
-	0,		\
-	NULL,		\
-	NULL,		\
-	NULL,		\
-	NULL,		\
-	NULL,		\
-}
+#define IA_CSS_DEFAULT_CAS_BINARY_DESCR ( \
+	(struct ia_css_cas_binary_descr) {	\
+		.num_stage		= 0,	\
+		.num_output_stage	= 0,	\
+		.in_info		= NULL,	\
+		.internal_out_info	= NULL,	\
+		.out_info		= NULL,	\
+		.vf_info		= NULL,	\
+		.is_output_stage	= NULL,	\
+	} \
+)
 
 struct ia_css_binary_descr {
 	int mode;
@@ -173,75 +174,77 @@ struct ia_css_binary {
 
 #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 */ \
-}
+#define IA_CSS_BINARY_DEFAULT_SETTINGS ( \
+	(struct ia_css_binary) { \
+		.info				= NULL, \
+		.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}, \
+		.effective_in_frame_res		= { 0, 0 }, \
+		.vf_frame_info			= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
+		.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		= 0, \
+		.dis				= IA_CSS_DEFAULT_SDIS_INFO, \
+		.dvs_envelope			= { 0, 0 }, \
+		.online				= false, \
+		.uds_xc				= 0, \
+		.uds_yc				= 0, \
+		.left_padding			= 0, \
+		.metrics			= DEFAULT_BINARY_METRICS, \
+		.mem_params			= IA_CSS_DEFAULT_ISP_MEM_PARAMS, \
+		.css_params			= IA_CSS_DEFAULT_ISP_CSS_PARAMS, \
+	} \
+)
 
 #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 */ \
-}
+#define IA_CSS_BINARY_DEFAULT_SETTINGS ( \
+	(struct ia_css_binary) { \
+		.info				= NULL, \
+		.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}, \
+		.effective_in_frame_res		= { 0, 0 }, \
+		.vf_frame_info			= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
+		.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, \
+		.dis				= IA_CSS_DEFAULT_SDIS_INFO, \
+		.dvs_envelope			= { 0, 0 }, \
+		.online				= false, \
+		.uds_xc				= 0, \
+		.uds_yc				= 0, \
+		.left_padding			= 0, \
+		.metrics			= DEFAULT_BINARY_METRICS, \
+		.mem_params			= IA_CSS_DEFAULT_ISP_MEM_PARAMS, \
+		.css_params			= IA_CSS_DEFAULT_ISP_CSS_PARAMS, \
+	} \
+)
 
 #endif
 
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/binary/src/binary.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/binary/src/binary.c
index 295e07049393..a0f0e9062c4c 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/binary/src/binary.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/binary/src/binary.c
@@ -490,7 +490,6 @@ ia_css_binary_get_shading_info_type_1(const struct ia_css_binary *binary,	/* [in
 	struct sh_css_shading_table_bayer_origin_compute_results res;
 #else
 	struct sh_css_binary_sc_requirements scr;
-	struct ia_css_shading_info default_shading_info_type_1 = DEFAULT_SHADING_INFO_TYPE_1;
 #endif
 
 #ifndef ISP2401
@@ -542,7 +541,7 @@ ia_css_binary_get_shading_info_type_1(const struct ia_css_binary *binary,	/* [in
 		&res);
 	if (err != IA_CSS_SUCCESS)
 #else
-	*shading_info = default_shading_info_type_1;
+	*shading_info = DEFAULT_SHADING_INFO_TYPE_1;
 
 	err = sh_css_binary_get_sc_requirements(binary, required_bds_factor, stream_config, &scr);
 	if (err != IA_CSS_SUCCESS) {
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
index 2283dd1c1c9b..092570e98cee 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
@@ -94,14 +94,28 @@ union ia_css_all_memory_offsets {
 	} array[IA_CSS_NUM_PARAM_CLASSES];
 };
 
-#define IA_CSS_DEFAULT_ISP_MEM_PARAMS \
-		{ { { { 0, 0 } } } }
-
-#define IA_CSS_DEFAULT_ISP_CSS_PARAMS \
-		{ { { { 0, 0 } } } }
-
-#define IA_CSS_DEFAULT_ISP_ISP_PARAMS \
-		{ { { { 0, 0 } } } }
+#define IA_CSS_DEFAULT_ISP_MEM_PARAMS ( \
+	(struct ia_css_isp_param_host_segments) { \
+		.params = { { \
+			(struct ia_css_host_data) { .address = NULL, .size = 0 } \
+		} } \
+	} \
+)
+
+#define IA_CSS_DEFAULT_ISP_CSS_PARAMS ( \
+	(struct ia_css_isp_param_css_segments) { \
+		.params = { { \
+			(struct ia_css_data) { .address = 0, .size = 0 } \
+		} } \
+	} \
+)
+
+#define IA_CSS_DEFAULT_ISP_ISP_PARAMS ( \
+	(struct ia_css_isp_param_isp_segments) { \
+		.params = { { \
+			(struct ia_css_isp_data) { .address = 0, .size = 0 } \
+		} } \
+	} \
+)
 
 #endif /* _IA_CSS_ISP_PARAM_TYPES_H_ */
-
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/interface/ia_css_pipeline.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/interface/ia_css_pipeline.h
index e64936e2d46e..4a893a0d19b1 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/interface/ia_css_pipeline.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/interface/ia_css_pipeline.h
@@ -73,23 +73,24 @@ struct ia_css_pipeline {
 	uint32_t pipe_qos_config;
 };
 
-#define DEFAULT_PIPELINE \
-{ \
-	IA_CSS_PIPE_ID_PREVIEW, /* pipe_id */ \
-	0,			/* pipe_num */ \
-	false,			/* stop_requested */ \
-	NULL,                   /* stages */ \
-	NULL,                   /* current_stage */ \
-	0,                      /* num_stages */ \
-	DEFAULT_FRAME,          /* in_frame */ \
-	{DEFAULT_FRAME},          /* out_frame */ \
-	{DEFAULT_FRAME},          /* vf_frame */ \
-	IA_CSS_FRAME_DELAY_1,   /* frame_delay */ \
-	0,                      /* inout_port_config */ \
-	-1,                     /* num_execs */ \
-	true,					/* acquire_isp_each_stage */\
-	QOS_INVALID             /* pipe_qos_config */\
-}
+#define DEFAULT_PIPELINE ( \
+	(struct ia_css_pipeline) { \
+		.pipe_id		= IA_CSS_PIPE_ID_PREVIEW, \
+		.pipe_num		= 0, \
+		.stop_requested		= false, \
+		.stages			= NULL, \
+		.current_stage		= NULL, \
+		.num_stages		= 0, \
+		.in_frame		= DEFAULT_FRAME, \
+		.out_frame		= {DEFAULT_FRAME}, \
+		.vf_frame		= {DEFAULT_FRAME}, \
+		.dvs_frame_delay	= IA_CSS_FRAME_DELAY_1, \
+		.inout_port_config	= 0, \
+		.num_execs		= -1, \
+		.acquire_isp_each_stage	= true, \
+		.pipe_qos_config	= QOS_INVALID \
+	} \
+)
 
 /* Stage descriptor used to create a new stage in the pipeline */
 struct ia_css_pipeline_stage_desc {
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/src/pipeline.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/src/pipeline.c
index 8f93d29d1c51..81a50c73ad0b 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/src/pipeline.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/src/pipeline.c
@@ -692,17 +692,16 @@ static void pipeline_init_defaults(
 	unsigned int pipe_num,
 	unsigned int dvs_frame_delay)
 {
-	struct ia_css_frame init_frame = DEFAULT_FRAME;
 	unsigned int i;
 
 	pipeline->pipe_id = pipe_id;
 	pipeline->stages = NULL;
 	pipeline->stop_requested = false;
 	pipeline->current_stage = NULL;
-	pipeline->in_frame = init_frame;
+	pipeline->in_frame = DEFAULT_FRAME;
 	for (i = 0; i < IA_CSS_PIPE_MAX_OUTPUT_STAGE; i++) {
-		pipeline->out_frame[i] = init_frame;
-		pipeline->vf_frame[i] = init_frame;
+		pipeline->out_frame[i] = DEFAULT_FRAME;
+		pipeline->vf_frame[i] = DEFAULT_FRAME;
 	}
 	pipeline->num_execs = -1;
 	pipeline->acquire_isp_each_stage = true;
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
index 322bb3de6098..20d7fc1f2e4b 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
@@ -112,8 +112,6 @@ static int thread_alive;
 #define STATS_ENABLED(stage) (stage && stage->binary && stage->binary->info && \
         (stage->binary->info->sp.enable.s3a || stage->binary->info->sp.enable.dis))
 
-#define DEFAULT_PLANES { {0, 0, 0, 0} }
-
 struct sh_css my_css;
 
 int (*sh_css_printf) (const char *fmt, va_list args) = NULL;
@@ -2291,25 +2289,19 @@ init_pipe_defaults(enum ia_css_pipe_mode mode,
 	       struct ia_css_pipe *pipe,
 	       bool copy_pipe)
 {
-	static struct ia_css_pipe default_pipe = IA_CSS_DEFAULT_PIPE;
-	static struct ia_css_preview_settings prev  = IA_CSS_DEFAULT_PREVIEW_SETTINGS;
-	static struct ia_css_capture_settings capt  = IA_CSS_DEFAULT_CAPTURE_SETTINGS;
-	static struct ia_css_video_settings   video = IA_CSS_DEFAULT_VIDEO_SETTINGS;
-	static struct ia_css_yuvpp_settings   yuvpp = IA_CSS_DEFAULT_YUVPP_SETTINGS;
-
 	if (pipe == NULL) {
 		IA_CSS_ERROR("NULL pipe parameter");
 		return IA_CSS_ERR_INVALID_ARGUMENTS;
 	}
 
 	/* Initialize pipe to pre-defined defaults */
-	*pipe = default_pipe;
+	*pipe = IA_CSS_DEFAULT_PIPE;
 
 	/* TODO: JB should not be needed, but temporary backward reference */
 	switch (mode) {
 	case IA_CSS_PIPE_MODE_PREVIEW:
 		pipe->mode = IA_CSS_PIPE_ID_PREVIEW;
-		pipe->pipe_settings.preview = prev;
+		pipe->pipe_settings.preview = IA_CSS_DEFAULT_PREVIEW_SETTINGS;
 		break;
 	case IA_CSS_PIPE_MODE_CAPTURE:
 		if (copy_pipe) {
@@ -2317,11 +2309,11 @@ init_pipe_defaults(enum ia_css_pipe_mode mode,
 		} else {
 			pipe->mode = IA_CSS_PIPE_ID_CAPTURE;
 		}
-		pipe->pipe_settings.capture = capt;
+		pipe->pipe_settings.capture = IA_CSS_DEFAULT_CAPTURE_SETTINGS;
 		break;
 	case IA_CSS_PIPE_MODE_VIDEO:
 		pipe->mode = IA_CSS_PIPE_ID_VIDEO;
-		pipe->pipe_settings.video = video;
+		pipe->pipe_settings.video = IA_CSS_DEFAULT_VIDEO_SETTINGS;
 		break;
 	case IA_CSS_PIPE_MODE_ACC:
 		pipe->mode = IA_CSS_PIPE_ID_ACC;
@@ -2331,7 +2323,7 @@ init_pipe_defaults(enum ia_css_pipe_mode mode,
 		break;
 	case IA_CSS_PIPE_MODE_YUVPP:
 		pipe->mode = IA_CSS_PIPE_ID_YUVPP;
-		pipe->pipe_settings.yuvpp = yuvpp;
+		pipe->pipe_settings.yuvpp = IA_CSS_DEFAULT_YUVPP_SETTINGS;
 		break;
 	default:
 		return IA_CSS_ERR_INVALID_ARGUMENTS;
@@ -8827,10 +8819,8 @@ sh_css_init_host_sp_control_vars(void)
  */
 void ia_css_pipe_config_defaults(struct ia_css_pipe_config *pipe_config)
 {
-	struct ia_css_pipe_config def_config = DEFAULT_PIPE_CONFIG;
-
 	ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, "ia_css_pipe_config_defaults()\n");
-	*pipe_config = def_config;
+	*pipe_config = DEFAULT_PIPE_CONFIG;
 }
 
 void
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h
index 4bcc35d219f8..adc584c9beb0 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h
@@ -52,16 +52,17 @@ struct ia_css_pipe_extra_config {
 	bool disable_vf_pp;
 };
 
-#define DEFAULT_PIPE_EXTRA_CONFIG \
-{ \
-	false,				/* enable_raw_binning */ \
-	false,				/* enable_yuv_ds */ \
-	false,				/* enable_high_speed */ \
-	false,				/* enable_dvs_6axis */ \
-	false,				/* enable_reduced_pipe */ \
-	false,				/* enable_fractional_ds */ \
-	false,				/* disable_vf_pp */ \
-}
+#define DEFAULT_PIPE_EXTRA_CONFIG ( \
+	(struct ia_css_pipe_extra_config) { \
+		.enable_raw_binning	= false, \
+		.enable_yuv_ds		= false, \
+		.enable_high_speed	= false, \
+		.enable_dvs_6axis	= false, \
+		.enable_reduced_pipe	= false, \
+		.enable_fractional_ds	= false, \
+		.disable_vf_pp		= false, \
+	} \
+)
 
 enum ia_css_err
 ia_css_pipe_create_extra(const struct ia_css_pipe_config *config,
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h
index 40840ea318ab..e5f49d1f5390 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h
@@ -24,15 +24,14 @@ struct sh_css_pc_histogram {
 	unsigned *msink;
 };
 
-#if !defined(__USE_DESIGNATED_INITIALISERS__)
-#define DEFAULT_PC_HISTOGRAM \
-{ \
-	0, \
-	NULL, \
-	NULL, \
-	NULL \
-}
-#endif
+#define DEFAULT_PC_HISTOGRAM ( \
+	(struct sh_css_pc_histogram) { \
+		.length	= 0, \
+		.run	= NULL, \
+		.stall	= NULL, \
+		.msink	= NULL \
+	} \
+)
 
 struct sh_css_binary_metrics {
 	unsigned mode;
@@ -42,16 +41,15 @@ struct sh_css_binary_metrics {
 	struct sh_css_binary_metrics *next;
 };
 
-#if !defined(__USE_DESIGNATED_INITIALISERS__)
-#define DEFAULT_BINARY_METRICS \
-{ \
-	0, \
-	0, \
-	DEFAULT_PC_HISTOGRAM, \
-	DEFAULT_PC_HISTOGRAM, \
-	NULL \
-}
-#endif
+#define DEFAULT_BINARY_METRICS ( \
+	(struct sh_css_binary_metrics) { \
+		.mode		= 0, \
+		.id		= 0, \
+		.isp_histogram	= DEFAULT_PC_HISTOGRAM, \
+		.sp_histogram	= DEFAULT_PC_HISTOGRAM, \
+		.next		= NULL \
+	} \
+)
 
 struct ia_css_frame_metrics {
 	unsigned num_frames;

base-commit: 781b045baefdabf7e0bc9f33672ca830d3db9f27
-- 
2.15.0

^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v3 2/3] media: atomisp: delete zero-valued struct members.
  2017-12-01 21:45                       ` [PATCH v3 0/3] media: atomisp: clean up of data-structure initialization in the CSS API Jeremy Sowden
  2017-12-01 21:45                         ` [PATCH v3 1/3] media: atomisp: convert default struct values to use compound-literals with designated initializers Jeremy Sowden
@ 2017-12-01 21:45                         ` Jeremy Sowden
  2017-12-01 21:45                         ` [PATCH v3 3/3] media: atomisp: delete empty default struct values Jeremy Sowden
  2 siblings, 0 replies; 53+ messages in thread
From: Jeremy Sowden @ 2017-12-01 21:45 UTC (permalink / raw)
  To: linux-media

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 to be removed.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 .../hive_isp_css_common/input_formatter_global.h   |  17 ----
 .../pci/atomisp2/css2400/ia_css_frame_public.h     |  17 ----
 .../atomisp/pci/atomisp2/css2400/ia_css_pipe.h     |  44 +-------
 .../pci/atomisp2/css2400/ia_css_pipe_public.h      |  81 ---------------
 .../atomisp/pci/atomisp2/css2400/ia_css_types.h    |  48 +--------
 .../isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h     | 111 ---------------------
 .../kernels/sdis/common/ia_css_sdis_common_types.h |  34 -------
 .../runtime/binary/interface/ia_css_binary.h       |  89 ++---------------
 .../isp_param/interface/ia_css_isp_param_types.h   |   9 --
 .../runtime/pipeline/interface/ia_css_pipeline.h   |   6 --
 .../atomisp/pci/atomisp2/css2400/sh_css_legacy.h   |   7 --
 .../atomisp/pci/atomisp2/css2400/sh_css_metrics.h  |   7 --
 12 files changed, 20 insertions(+), 450 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/input_formatter_global.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/input_formatter_global.h
index 5e19b5bd56e6..7558f4964313 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/input_formatter_global.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/input_formatter_global.h
@@ -107,23 +107,6 @@ struct input_formatter_cfg_s {
 	uint32_t	block_no_reqs;
 };
 
-#define DEFAULT_IF_CONFIG ( \
-	(struct input_formatter_cfg_s) { \
-		.start_line		= 0, \
-		.start_column		= 0, \
-		.left_padding		= 0, \
-		.cropped_height		= 0, \
-		.cropped_width		= 0, \
-		.deinterleaving		= 0, \
-		.buf_vecs		= 0, \
-		.buf_start_index	= 0, \
-		.buf_increment		= 0, \
-		.buf_eol_offset		= 0, \
-		.is_yuv420_format	= false, \
-		.block_no_reqs		= false \
-	} \
-)
-
 extern const hrt_address HIVE_IF_SRST_ADDRESS[N_INPUT_FORMATTER_ID];
 extern const hrt_data HIVE_IF_SRST_MASK[N_INPUT_FORMATTER_ID];
 extern const uint8_t HIVE_IF_SWITCH_CODE[N_INPUT_FORMATTER_ID];
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_frame_public.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_frame_public.h
index d0408884c524..972863fcaf9e 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_frame_public.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_frame_public.h
@@ -122,18 +122,8 @@ struct ia_css_frame_info {
 
 #define IA_CSS_BINARY_DEFAULT_FRAME_INFO ( \
 	(struct ia_css_frame_info) { \
-		.res			= (struct ia_css_resolution) { \
-						.width = 0, \
-						.height = 0 \
-					}, \
-		.padded_width		= 0, \
 		.format			= IA_CSS_FRAME_FORMAT_NUM,  \
-		.raw_bit_depth		= 0, \
 		.raw_bayer_order	= IA_CSS_BAYER_ORDER_NUM, \
-		.crop_info		= (struct ia_css_crop_info) { \
-						.start_column	= 0, \
-						.start_line	= 0 \
-					}, \
 	} \
 )
 
@@ -197,16 +187,9 @@ struct ia_css_frame {
 #define DEFAULT_FRAME ( \
 	(struct ia_css_frame) { \
 		.info			= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
-		.data			= 0, \
-		.data_bytes		= 0, \
 		.dynamic_queue_id	= SH_CSS_INVALID_QUEUE_ID, \
 		.buf_type		= IA_CSS_BUFFER_TYPE_INVALID, \
 		.flash_state		= IA_CSS_FRAME_FLASH_STATE_NONE, \
-		.exp_id			= 0, \
-		.isp_config_id		= 0, \
-		.valid			= false, \
-		.contiguous		= false, \
-		.planes			= { 0 } \
 	} \
 )
 
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h
index bfebfd8d6e63..a68eac6de36a 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h
@@ -39,16 +39,11 @@ struct ia_css_preview_settings {
 	struct ia_css_pipe *acc_pipe;
 };
 
-#define IA_CSS_DEFAULT_PREVIEW_SETTINGS  ( \
+#define IA_CSS_DEFAULT_PREVIEW_SETTINGS ( \
 	(struct ia_css_preview_settings) { \
 		.copy_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
 		.preview_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
 		.vf_pp_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
-		.delay_frames	= { NULL }, \
-		.tnr_frames	= { NULL }, \
-		.copy_pipe	= NULL, \
-		.capture_pipe	= NULL, \
-		.acc_pipe	= NULL, \
 	} \
 )
 
@@ -74,17 +69,12 @@ struct ia_css_capture_settings {
 	(struct ia_css_capture_settings) { \
 		.copy_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
 		.primary_binary		= {IA_CSS_BINARY_DEFAULT_SETTINGS}, \
-		.num_primary_stage	= 0, \
 		.pre_isp_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
 		.anr_gdc_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
 		.post_isp_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
 		.capture_pp_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
 		.vf_pp_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
 		.capture_ldc_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
-		.yuv_scaler_binary	= NULL, \
-		.delay_frames		= { NULL }, \
-		.is_output_stage	= NULL, \
-		.num_yuv_scaler		= 0, \
 	} \
 )
 
@@ -108,17 +98,9 @@ struct ia_css_video_settings {
 
 #define IA_CSS_DEFAULT_VIDEO_SETTINGS ( \
 	(struct ia_css_video_settings) { \
-		.copy_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
-		.video_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
-		.vf_pp_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
-		.yuv_scaler_binary	= NULL, \
-		.delay_frames		= { NULL }, \
-		.tnr_frames		= { NULL }, \
-		.vf_pp_in_frame		= NULL, \
-		.copy_pipe		= NULL, \
-		.capture_pipe		= NULL, \
-		.is_output_stage	= NULL, \
-		.num_yuv_scaler		= 0, \
+		.copy_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+		.video_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+		.vf_pp_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
 	} \
 )
 
@@ -134,13 +116,7 @@ struct ia_css_yuvpp_settings {
 
 #define IA_CSS_DEFAULT_YUVPP_SETTINGS ( \
 	(struct ia_css_yuvpp_settings) { \
-		.copy_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
-		.yuv_scaler_binary	= NULL, \
-		.vf_pp_binary		= NULL, \
-		.is_output_stage	= NULL, \
-		.num_yuv_scaler		= 0, \
-		.num_vf_pp		= 0, \
-		.num_output		= 0, \
+		.copy_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
 	} \
 )
 
@@ -190,35 +166,25 @@ struct ia_css_pipe {
 
 #define IA_CSS_DEFAULT_PIPE ( \
 	(struct ia_css_pipe) { \
-		.stop_requested		= false, \
 		.config			= DEFAULT_PIPE_CONFIG, \
 		.extra_config		= DEFAULT_PIPE_EXTRA_CONFIG, \
 		.info			= DEFAULT_PIPE_INFO, \
 		.mode			= IA_CSS_PIPE_ID_ACC, /* (pipe_id) */ \
-		.shading_table		= NULL, \
 		.pipeline		= DEFAULT_PIPELINE, \
 		.output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
 		.bds_output_info	= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
 		.vf_output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
 		.out_yuv_ds_input_info	= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
 		.vf_yuv_ds_input_info	= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
-		.output_stage		= NULL, \
-		.vf_stage		= NULL, \
 		.required_bds_factor	= SH_CSS_BDS_FACTOR_1_00, \
 		.dvs_frame_delay	= 1, \
-		.num_invalid_frames	= 0, \
 		.enable_viewfinder	= {true}, \
-		.stream			= NULL, \
 		.in_frame_struct	= DEFAULT_FRAME, \
 		.out_frame_struct	= DEFAULT_FRAME, \
 		.vf_frame_struct	= DEFAULT_FRAME, \
-		.continuous_frames	= { NULL }, \
-		.cont_md_buffers	= { NULL }, \
 		.pipe_settings		= { \
 			.preview = IA_CSS_DEFAULT_PREVIEW_SETTINGS \
 		}, \
-		.scaler_pp_lut		= 0, \
-		.osys_obj		= NULL, \
 		.pipe_num		= PIPE_ENTRY_EMPTY_TOKEN, \
 	} \
 )
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe_public.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe_public.h
index 5c8830486aec..b094af39c8e3 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe_public.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe_public.h
@@ -152,14 +152,6 @@ struct ia_css_pipe_config {
 };
 
 
-#ifdef ISP2401
-/**
- * Default origin of internal frame positioned on shading table.
- */
-#define IA_CSS_PIPE_DEFAULT_INTERNAL_FRAME_ORIGIN_BQS_ON_SCTBL ( \
-	(struct ia_css_coordinate) { .x = 0, .y = 0 } \
-)
-
 /**
  * Default settings for newly created pipe configurations.
  */
@@ -167,68 +159,14 @@ struct ia_css_pipe_config {
 	(struct ia_css_pipe_config) { \
 		.mode			= IA_CSS_PIPE_MODE_PREVIEW, \
 		.isp_pipe_version	= 1, \
-		.input_effective_res	= { 0, 0 }, \
-		.bayer_ds_out_res	= { 0, 0 }, \
-		.capt_pp_in_res		= { 0, 0 }, \
-		.vf_pp_in_res		= { 0, 0 }, \
-		.output_system_in_res	= { 0, 0 }, \
-		.dvs_crop_out_res	= { 0, 0 }, \
 		.output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
 		.vf_output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
-		.acc_extension		= NULL, \
-		.acc_stages		= NULL, \
-		.num_acc_stages		= 0, \
 		.default_capture_config	= DEFAULT_CAPTURE_CONFIG, \
-		.dvs_envelope		= { 0, 0 }, \
 		.dvs_frame_delay	= IA_CSS_FRAME_DELAY_1, \
 		.acc_num_execs		= -1, \
-		.enable_dz		= false, \
-		.enable_dpc		= false, \
-		.enable_vfpp_bci	= false, \
-		.enable_luma_only	= false, \
-		.enable_tnr		= false, \
-		.p_isp_config		= NULL, \
-		.gdc_in_buffer_res	= { 0, 0 }, \
-		.gdc_in_buffer_offset	= { 0, 0 }, \
-		.internal_frame_origin_bqs_on_sctbl \
-					= IA_CSS_PIPE_DEFAULT_INTERNAL_FRAME_ORIGIN_BQS_ON_SCTBL \
 	} \
 )
 
-#else
-
-/**
- * Default settings for newly created pipe configurations.
- */
-#define DEFAULT_PIPE_CONFIG ( \
-	(struct ia_css_pipe_config) { \
-		.mode			= IA_CSS_PIPE_MODE_PREVIEW, \
-		.isp_pipe_version	= 1, \
-		.input_effective_res	= { 0, 0 }, \
-		.bayer_ds_out_res	= { 0, 0 }, \
-		.capt_pp_in_res		= { 0, 0 }, \
-		.vf_pp_in_res		= { 0, 0 }, \
-		.dvs_crop_out_res	= { 0, 0 }, \
-		.output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
-		.vf_output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
-		.acc_extension		= NULL, \
-		.acc_stages		= NULL, \
-		.num_acc_stages		= 0, \
-		.default_capture_config	= DEFAULT_CAPTURE_CONFIG, \
-		.dvs_envelope		= { 0, 0 }, \
-		.dvs_frame_delay	= IA_CSS_FRAME_DELAY_1, \
-		.acc_num_execs		= -1, \
-		.enable_dz		= false, \
-		.enable_dpc		= false, \
-		.enable_vfpp_bci	= false, \
-		.p_isp_config		= NULL, \
-		.gdc_in_buffer_res	= { 0, 0 }, \
-		.gdc_in_buffer_offset	= { 0, 0 } \
-	} \
-)
-
-#endif
-
 /* Pipe info, this struct describes properties of a pipe after it's stream has
  * been created.
  * ~~~** DO NOT ADD NEW FIELD **~~~ This structure will be deprecated.
@@ -273,22 +211,6 @@ struct ia_css_pipe_info {
 /**
  * Defaults for ia_css_pipe_info structs.
  */
-#ifdef ISP2401
-
-#define DEFAULT_PIPE_INFO ( \
-	(struct ia_css_pipe_info) { \
-		.output_info			= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
-		.vf_output_info			= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
-		.raw_output_info		= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
-		.output_system_in_res_info	= { 0, 0 }, \
-		.shading_info			= DEFAULT_SHADING_INFO, \
-		.grid_info			= DEFAULT_GRID_INFO, \
-		.num_invalid_frames		= 0 \
-	} \
-)
-
-#else
-
 #define DEFAULT_PIPE_INFO ( \
 	(struct ia_css_pipe_info) { \
 		.output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
@@ -296,12 +218,9 @@ struct ia_css_pipe_info {
 		.raw_output_info	= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
 		.shading_info		= DEFAULT_SHADING_INFO, \
 		.grid_info		= DEFAULT_GRID_INFO, \
-		.num_invalid_frames	= 0 \
 	} \
 )
 
-#endif
-
 /* @brief Load default pipe configuration
  * @param[out]	pipe_config The pipe configuration.
  * @return	None
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h
index 95e77da5c464..e9ab800ae128 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h
@@ -370,54 +370,21 @@ struct ia_css_shading_info {
 	} info;
 };
 
-#ifndef ISP2401
-
 /* Default Shading Correction information of Shading Correction Type 1. */
 #define DEFAULT_SHADING_INFO_TYPE_1 ( \
 	(struct ia_css_shading_info) { \
 		.type = IA_CSS_SHADING_CORRECTION_TYPE_1, \
 		.info = { \
 			.type_1 = { \
-				.enable					= 0, \
-				.num_hor_grids				= 0, \
-				.num_ver_grids				= 0, \
-				.bqs_per_grid_cell			= 0, \
-				.bayer_scale_hor_ratio_in		= 1, \
-				.bayer_scale_hor_ratio_out		= 1, \
-				.bayer_scale_ver_ratio_in		= 1, \
-				.bayer_scale_ver_ratio_out		= 1, \
-				.sc_bayer_origin_x_bqs_on_shading_table	= 0, \
-				.sc_bayer_origin_y_bqs_on_shading_table	= 0 \
+				.bayer_scale_hor_ratio_in	= 1, \
+				.bayer_scale_hor_ratio_out	= 1, \
+				.bayer_scale_ver_ratio_in	= 1, \
+				.bayer_scale_ver_ratio_out	= 1, \
 			} \
 		} \
 	} \
 )
 
-#else
-
-/* Default Shading Correction information of Shading Correction Type 1. */
-#define DEFAULT_SHADING_INFO_TYPE_1 ( \
-	(struct ia_css_shading_info) { \
-		.type = IA_CSS_SHADING_CORRECTION_TYPE_1, \
-		.info = { \
-			.type_1 = { \
-				.num_hor_grids				= 0, \
-				.num_ver_grids				= 0, \
-				.bqs_per_grid_cell			= 0, \
-				.bayer_scale_hor_ratio_in		= 1, \
-				.bayer_scale_hor_ratio_out		= 1, \
-				.bayer_scale_ver_ratio_in		= 1, \
-				.bayer_scale_ver_ratio_out		= 1, \
-				.isp_input_sensor_data_res_bqs		= {0, 0}, \
-				.sensor_data_res_bqs			= {0, 0}, \
-				.sensor_data_origin_bqs_on_sctbl	= {0, 0} \
-			} \
-		} \
-	} \
-)
-
-#endif
-
 /* Default Shading Correction information. */
 #define DEFAULT_SHADING_INFO	DEFAULT_SHADING_INFO_TYPE_1
 
@@ -441,8 +408,6 @@ struct ia_css_grid_info {
 /* defaults for ia_css_grid_info structs */
 #define DEFAULT_GRID_INFO ( \
 	(struct ia_css_grid_info) { \
-		.isp_in_width	= 0, \
-		.isp_in_height	= 0, \
 		.s3a_grid	= DEFAULT_3A_GRID_INFO, \
 		.dvs_grid	= DEFAULT_DVS_GRID_INFO, \
 		.vamem_type	= IA_CSS_VAMEM_TYPE_1 \
@@ -538,10 +503,7 @@ struct ia_css_capture_config {
 /* default settings for ia_css_capture_config structs */
 #define DEFAULT_CAPTURE_CONFIG ( \
 	(struct ia_css_capture_config) { \
-		.mode			= IA_CSS_CAPTURE_MODE_PRIMARY, \
-		.enable_xnr		= false, \
-		.enable_raw_output	= false, \
-		.enable_capture_pp_bli	= false \
+		.mode	= IA_CSS_CAPTURE_MODE_PRIMARY, \
 	} \
 )
 
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h
index 19fb0b885c72..4b8bdc973d4b 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h
@@ -98,122 +98,11 @@ struct ia_css_3a_grid_info {
 };
 
 
-#if defined(SYSTEM_css_skycam_c0_system)
-#if defined USE_NEW_AE_STRUCT || defined USE_NEW_AWB_STRUCT
 #define DEFAULT_3A_GRID_INFO ( \
 	(struct ia_css_3a_grid_info) { \
-		.ae_enable		= 0, \
-		.ae_grd_info		= (struct ae_public_config_grid_config) { \
-						.width = 0, \
-						.height = 0, \
-						.b_width = 0, \
-						.b_height = 0, \
-						.x_start = 0, \
-						.y_start = 0, \
-						.x_end = 0, \
-						.y_end = 0 \
-					  } \
-		.awb_enable		= 0, \
-		.awb_grd_info		= (struct awb_public_config_grid_config) { \
-						.width = 0, \
-						.height = 0, \
-						.b_width = 0, \
-						.b_height = 0, \
-						.x_start = 0, \
-						.y_start = 0, \
-						.x_end = 0, \
-						.y_end = 0 \
-					  }	\
-		.af_enable		= 0, \
-		.af_grd_info		= (struct af_public_grid_config) { \
-						.width = 0, \
-						.height = 0, \
-						.b_width = 0, \
-						.b_height = 0, \
-						.x_start = 0, \
-						.y_start = 0, \
-						.ff_en = 0 \
-					  } \
-		.awb_fr_enable		= 0, \
-		.awb_fr_grd_info	= (struct awb_fr_public_grid_config) { \
-						.width = 0, \
-						.height = 0, \
-						.b_width = 0, \
-						.b_height = 0, \
-						.x_start = 0, \
-						.y_start = 0, \
-						.ff_en = 0 \
-					  } \
-		.elem_bit_depth		= 0, \
 	} \
 )
-#else
-#define DEFAULT_3A_GRID_INFO ( \
-	(struct ia_css_3a_grid_info) { \
-		.ae_enable		= 0, \
-		.ae_grd_info		= (struct ae_public_config_grid_config) { \
-						.width = 0, \
-						.height = 0, \
-						.b_width = 0, \
-						.b_height = 0, \
-						.x_start = 0, \
-						.y_start = 0, \
-						.x_end = 0, \
-						.y_end = 0 \
-					  } \
-		.awb_enable		= 0, \
-		.awb_grd_info		= (struct awb_public_config_grid_config) { \
-						.width = 0, \
-						.height = 0, \
-						.b_width = 0, \
-						.b_height = 0, \
-						.x_start = 0, \
-						.y_start = 0, \
-						.x_end = 0, \
-						.y_end = 0 \
-					  }	\
-		.af_enable		= 0, \
-		.af_grd_info		= (struct af_public_grid_config) { \
-						.width = 0, \
-						.height = 0, \
-						.b_width = 0, \
-						.b_height = 0, \
-						.x_start = 0, \
-						.y_start = 0, \
-						.ff_en = 0 \
-					  } \
-		.awb_fr_enable		= 0, \
-		.awb_fr_grd_info	= (struct awb_fr_public_grid_config) { \
-						.width = 0, \
-						.height = 0, \
-						.b_width = 0, \
-						.b_height = 0, \
-						.x_start = 0, \
-						.y_start = 0, \
-						.ff_en = 0 \
-					  } \
-		.elem_bit_depth		= 0, \
-	} \
-)
-#endif /* USE_NEW_AE_STRUCT || defined USE_NEW_AWB_STRUCT */
 
-#else
-#define DEFAULT_3A_GRID_INFO ( \
-	(struct ia_css_3a_grid_info) { \
-		.enable			= 0, \
-		.use_dmem		= 0, \
-		.has_histogram		= 0, \
-		.width			= 0, \
-		.height			= 0, \
-		.aligned_width		= 0, \
-		.aligned_height		= 0, \
-		.bqs_per_grid_cell	= 0, \
-		.deci_factor_log2	= 0, \
-		.elem_bit_depth		= 0, \
-	} \
-)
-
-#endif
 
 /* This struct should be split into 3, for AE, AWB and AF.
  * However, that will require driver/ 3A lib modifications.
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h
index 232f1be3ca20..b9adc2af7603 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h
@@ -43,19 +43,6 @@ struct ia_css_sdis_info {
 
 #define IA_CSS_DEFAULT_SDIS_INFO ( \
 	(struct ia_css_sdis_info) { \
-		.grid = { \
-			.dim = (struct ia_css_dvs_grid_dim) { .width = 0, .height = 0 }, \
-			.pad = (struct ia_css_dvs_grid_dim) { .width = 0, .height = 0 }, \
-		}, \
-		.coef = { \
-			.dim = (struct ia_css_dvs_grid_dim) { .width = 0, .height = 0 }, \
-			.pad = (struct ia_css_dvs_grid_dim) { .width = 0, .height = 0 }, \
-		}, \
-		.proj = { \
-			.dim = (struct ia_css_dvs_grid_dim) { .width = 0, .height = 0 }, \
-			.pad = (struct ia_css_dvs_grid_dim) { .width = 0, .height = 0 }, \
-		}, \
-		.deci_factor_log2 = 0, \
 	} \
 )
 
@@ -216,38 +203,17 @@ struct ia_css_dvs_stat_grid_info {
  */
 #define DEFAULT_DVS_STAT_PUBLIC_DVS_GLOBAL_CFG ( \
 	(struct dvs_stat_public_dvs_global_cfg) { \
-		.kappa		= 0, \
-		.match_shift	= 0, \
-		.ybin_mode	= 0, \
 	} \
 )
 
 #define DEFAULT_DVS_STAT_PUBLIC_DVS_GRD_CFG ( \
 	(struct dvs_stat_public_dvs_grd_cfg) { \
-		.grd_cfg	= (struct dvs_stat_public_dvs_level_grid_cfg) { \
-					.grid_width = 0, \
-					.grid_height = 0, \
-					.block_width = 0, \
-					.block_height = 0 \
-				}, \
-		.grd_start	= (struct dvs_stat_public_dvs_level_grid_start) { \
-					.x_start = 0, \
-					.y_start = 0, \
-					.enable = 0 \
-				}, \
-		.grd_end	= (struct dvs_stat_public_dvs_level_grid_end) { \
-					.x_end = 0, \
-					.y_end = 0, \
-				}, \
 	} \
 )
 
 #define DEFAULT_DVS_STAT_PUBLIC_DVS_LEVEL_FE_ROI_CFG(X_START) ( \
 	(struct dvs_stat_public_dvs_level_fe_roi_cfg) { \
 		.x_start = X_START, \
-		.y_start = 0, \
-		.x_end   = 0, \
-		.y_end   = 0, \
 	} \
 )
 
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 416efad7dd1e..23bc33b66018 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
@@ -94,14 +94,7 @@ struct ia_css_cas_binary_descr {
 };
 
 #define IA_CSS_DEFAULT_CAS_BINARY_DESCR ( \
-	(struct ia_css_cas_binary_descr) {	\
-		.num_stage		= 0,	\
-		.num_output_stage	= 0,	\
-		.in_info		= NULL,	\
-		.internal_out_info	= NULL,	\
-		.out_info		= NULL,	\
-		.vf_info		= NULL,	\
-		.is_output_stage	= NULL,	\
+	(struct ia_css_cas_binary_descr) { \
 	} \
 )
 
@@ -172,82 +165,20 @@ struct ia_css_binary {
 	struct ia_css_isp_param_css_segments  css_params;
 };
 
-#ifdef ISP2401
-
 #define IA_CSS_BINARY_DEFAULT_SETTINGS ( \
 	(struct ia_css_binary) { \
-		.info				= NULL, \
-		.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}, \
-		.effective_in_frame_res		= { 0, 0 }, \
-		.vf_frame_info			= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
-		.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		= 0, \
-		.dis				= IA_CSS_DEFAULT_SDIS_INFO, \
-		.dvs_envelope			= { 0, 0 }, \
-		.online				= false, \
-		.uds_xc				= 0, \
-		.uds_yc				= 0, \
-		.left_padding			= 0, \
-		.metrics			= DEFAULT_BINARY_METRICS, \
-		.mem_params			= IA_CSS_DEFAULT_ISP_MEM_PARAMS, \
-		.css_params			= IA_CSS_DEFAULT_ISP_CSS_PARAMS, \
+		.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, \
+		.dis			= IA_CSS_DEFAULT_SDIS_INFO, \
+		.metrics		= DEFAULT_BINARY_METRICS, \
+		.mem_params		= IA_CSS_DEFAULT_ISP_MEM_PARAMS, \
+		.css_params		= IA_CSS_DEFAULT_ISP_CSS_PARAMS, \
 	} \
 )
 
-#else
-
-#define IA_CSS_BINARY_DEFAULT_SETTINGS ( \
-	(struct ia_css_binary) { \
-		.info				= NULL, \
-		.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}, \
-		.effective_in_frame_res		= { 0, 0 }, \
-		.vf_frame_info			= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
-		.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, \
-		.dis				= IA_CSS_DEFAULT_SDIS_INFO, \
-		.dvs_envelope			= { 0, 0 }, \
-		.online				= false, \
-		.uds_xc				= 0, \
-		.uds_yc				= 0, \
-		.left_padding			= 0, \
-		.metrics			= DEFAULT_BINARY_METRICS, \
-		.mem_params			= IA_CSS_DEFAULT_ISP_MEM_PARAMS, \
-		.css_params			= IA_CSS_DEFAULT_ISP_CSS_PARAMS, \
-	} \
-)
-
-#endif
-
 enum ia_css_err
 ia_css_binary_init_infos(void);
 
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
index 092570e98cee..e49afa2102ae 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
@@ -96,25 +96,16 @@ union ia_css_all_memory_offsets {
 
 #define IA_CSS_DEFAULT_ISP_MEM_PARAMS ( \
 	(struct ia_css_isp_param_host_segments) { \
-		.params = { { \
-			(struct ia_css_host_data) { .address = NULL, .size = 0 } \
-		} } \
 	} \
 )
 
 #define IA_CSS_DEFAULT_ISP_CSS_PARAMS ( \
 	(struct ia_css_isp_param_css_segments) { \
-		.params = { { \
-			(struct ia_css_data) { .address = 0, .size = 0 } \
-		} } \
 	} \
 )
 
 #define IA_CSS_DEFAULT_ISP_ISP_PARAMS ( \
 	(struct ia_css_isp_param_isp_segments) { \
-		.params = { { \
-			(struct ia_css_isp_data) { .address = 0, .size = 0 } \
-		} } \
 	} \
 )
 
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/interface/ia_css_pipeline.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/interface/ia_css_pipeline.h
index 4a893a0d19b1..e3bb948af4d3 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/interface/ia_css_pipeline.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/interface/ia_css_pipeline.h
@@ -76,16 +76,10 @@ struct ia_css_pipeline {
 #define DEFAULT_PIPELINE ( \
 	(struct ia_css_pipeline) { \
 		.pipe_id		= IA_CSS_PIPE_ID_PREVIEW, \
-		.pipe_num		= 0, \
-		.stop_requested		= false, \
-		.stages			= NULL, \
-		.current_stage		= NULL, \
-		.num_stages		= 0, \
 		.in_frame		= DEFAULT_FRAME, \
 		.out_frame		= {DEFAULT_FRAME}, \
 		.vf_frame		= {DEFAULT_FRAME}, \
 		.dvs_frame_delay	= IA_CSS_FRAME_DELAY_1, \
-		.inout_port_config	= 0, \
 		.num_execs		= -1, \
 		.acquire_isp_each_stage	= true, \
 		.pipe_qos_config	= QOS_INVALID \
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h
index adc584c9beb0..77fc32a03c72 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h
@@ -54,13 +54,6 @@ struct ia_css_pipe_extra_config {
 
 #define DEFAULT_PIPE_EXTRA_CONFIG ( \
 	(struct ia_css_pipe_extra_config) { \
-		.enable_raw_binning	= false, \
-		.enable_yuv_ds		= false, \
-		.enable_high_speed	= false, \
-		.enable_dvs_6axis	= false, \
-		.enable_reduced_pipe	= false, \
-		.enable_fractional_ds	= false, \
-		.disable_vf_pp		= false, \
 	} \
 )
 
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h
index e5f49d1f5390..aa3badd7e9da 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h
@@ -26,10 +26,6 @@ struct sh_css_pc_histogram {
 
 #define DEFAULT_PC_HISTOGRAM ( \
 	(struct sh_css_pc_histogram) { \
-		.length	= 0, \
-		.run	= NULL, \
-		.stall	= NULL, \
-		.msink	= NULL \
 	} \
 )
 
@@ -43,11 +39,8 @@ struct sh_css_binary_metrics {
 
 #define DEFAULT_BINARY_METRICS ( \
 	(struct sh_css_binary_metrics) { \
-		.mode		= 0, \
-		.id		= 0, \
 		.isp_histogram	= DEFAULT_PC_HISTOGRAM, \
 		.sp_histogram	= DEFAULT_PC_HISTOGRAM, \
-		.next		= NULL \
 	} \
 )
 
-- 
2.15.0

^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v3 3/3] media: atomisp: delete empty default struct values.
  2017-12-01 21:45                       ` [PATCH v3 0/3] media: atomisp: clean up of data-structure initialization in the CSS API Jeremy Sowden
  2017-12-01 21:45                         ` [PATCH v3 1/3] media: atomisp: convert default struct values to use compound-literals with designated initializers Jeremy Sowden
  2017-12-01 21:45                         ` [PATCH v3 2/3] media: atomisp: delete zero-valued struct members Jeremy Sowden
@ 2017-12-01 21:45                         ` Jeremy Sowden
  2 siblings, 0 replies; 53+ messages in thread
From: Jeremy Sowden @ 2017-12-01 21:45 UTC (permalink / raw)
  To: linux-media

Removing zero-valued struct-members left a number of the default
struct-values empty.  These values have now been removed.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 .../atomisp/pci/atomisp2/css2400/ia_css_pipe.h     |  1 -
 .../atomisp/pci/atomisp2/css2400/ia_css_types.h    |  1 -
 .../isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h     |  6 ---
 .../kernels/sdis/common/ia_css_sdis_common_types.h | 46 ++++------------------
 .../isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c   |  2 +-
 .../runtime/binary/interface/ia_css_binary.h       |  9 -----
 .../isp_param/interface/ia_css_isp_param_types.h   | 15 -------
 .../media/atomisp/pci/atomisp2/css2400/sh_css.c    |  9 ++---
 .../atomisp/pci/atomisp2/css2400/sh_css_legacy.h   |  5 ---
 .../atomisp/pci/atomisp2/css2400/sh_css_metrics.h  | 12 ------
 10 files changed, 12 insertions(+), 94 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h
index a68eac6de36a..3f3c85c2f360 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h
@@ -167,7 +167,6 @@ struct ia_css_pipe {
 #define IA_CSS_DEFAULT_PIPE ( \
 	(struct ia_css_pipe) { \
 		.config			= DEFAULT_PIPE_CONFIG, \
-		.extra_config		= DEFAULT_PIPE_EXTRA_CONFIG, \
 		.info			= DEFAULT_PIPE_INFO, \
 		.mode			= IA_CSS_PIPE_ID_ACC, /* (pipe_id) */ \
 		.pipeline		= DEFAULT_PIPELINE, \
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h
index e9ab800ae128..914049b56bc7 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h
@@ -408,7 +408,6 @@ struct ia_css_grid_info {
 /* defaults for ia_css_grid_info structs */
 #define DEFAULT_GRID_INFO ( \
 	(struct ia_css_grid_info) { \
-		.s3a_grid	= DEFAULT_3A_GRID_INFO, \
 		.dvs_grid	= DEFAULT_DVS_GRID_INFO, \
 		.vamem_type	= IA_CSS_VAMEM_TYPE_1 \
 	} \
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h
index 4b8bdc973d4b..63e70669f085 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h
@@ -98,12 +98,6 @@ struct ia_css_3a_grid_info {
 };
 
 
-#define DEFAULT_3A_GRID_INFO ( \
-	(struct ia_css_3a_grid_info) { \
-	} \
-)
-
-
 /* This struct should be split into 3, for AE, AWB and AF.
  * However, that will require driver/ 3A lib modifications.
  */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h
index b9adc2af7603..f74941d49e8b 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h
@@ -41,12 +41,6 @@ struct ia_css_sdis_info {
 	uint32_t deci_factor_log2;
 };
 
-#define IA_CSS_DEFAULT_SDIS_INFO ( \
-	(struct ia_css_sdis_info) { \
-	} \
-)
-
-
 /* DVS statistics grid
  *
  *  ISP block: SDVS1 (DIS/DVS Support for DIS/DVS ver.1 (2-axes))
@@ -201,41 +195,15 @@ struct ia_css_dvs_stat_grid_info {
 
 /* DVS statistics generated by accelerator default grid info
  */
-#define DEFAULT_DVS_STAT_PUBLIC_DVS_GLOBAL_CFG ( \
-	(struct dvs_stat_public_dvs_global_cfg) { \
-	} \
-)
-
-#define DEFAULT_DVS_STAT_PUBLIC_DVS_GRD_CFG ( \
-	(struct dvs_stat_public_dvs_grd_cfg) { \
-	} \
-)
-
-#define DEFAULT_DVS_STAT_PUBLIC_DVS_LEVEL_FE_ROI_CFG(X_START) ( \
-	(struct dvs_stat_public_dvs_level_fe_roi_cfg) { \
-		.x_start = X_START, \
-	} \
-)
-
-#define DEFAULT_DVS_STAT_GRID_INFO ( \
-	(struct ia_css_dvs_stat_grid_info) { \
-		.dvs_gbl_cfg = DEFAULT_DVS_STAT_PUBLIC_DVS_GLOBAL_CFG, \
-		.grd_cfg = { \
-			DEFAULT_DVS_STAT_PUBLIC_DVS_GRD_CFG, \
-			DEFAULT_DVS_STAT_PUBLIC_DVS_GRD_CFG, \
-			DEFAULT_DVS_STAT_PUBLIC_DVS_GRD_CFG \
-		}, \
-		.fe_roi_cfg = { \
-			DEFAULT_DVS_STAT_PUBLIC_DVS_LEVEL_FE_ROI_CFG(0), \
-			DEFAULT_DVS_STAT_PUBLIC_DVS_LEVEL_FE_ROI_CFG(4), \
-			DEFAULT_DVS_STAT_PUBLIC_DVS_LEVEL_FE_ROI_CFG(0), \
-		} \
-	} \
-)
-
 #define DEFAULT_DVS_GRID_INFO ( \
 	(union ia_css_dvs_grid_u) { \
-		.dvs_stat_grid_info = DEFAULT_DVS_STAT_GRID_INFO, \
+		.dvs_stat_grid_info = (struct ia_css_dvs_stat_grid_info) { \
+			.fe_roi_cfg = { \
+				[1] = (struct dvs_stat_public_dvs_level_fe_roi_cfg) { \
+					.x_start = 4 \
+				} \
+			} \
+		} \
 	} \
 )
 
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c
index e45a3c3fcf4a..0fdd696bf654 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c
@@ -169,7 +169,7 @@ ia_css_sdis_init_info(
 	unsigned enabled)
 {
 	if (!enabled) {
-		*dis = IA_CSS_DEFAULT_SDIS_INFO;
+		*dis = (struct ia_css_sdis_info) { };
 		return;
 	}
 
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 23bc33b66018..dbbdc404faa7 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,11 +93,6 @@ struct ia_css_cas_binary_descr {
 	bool *is_output_stage;
 };
 
-#define IA_CSS_DEFAULT_CAS_BINARY_DESCR ( \
-	(struct ia_css_cas_binary_descr) { \
-	} \
-)
-
 struct ia_css_binary_descr {
 	int mode;
 	bool online;
@@ -172,10 +167,6 @@ struct ia_css_binary {
 		.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, \
-		.dis			= IA_CSS_DEFAULT_SDIS_INFO, \
-		.metrics		= DEFAULT_BINARY_METRICS, \
-		.mem_params		= IA_CSS_DEFAULT_ISP_MEM_PARAMS, \
-		.css_params		= IA_CSS_DEFAULT_ISP_CSS_PARAMS, \
 	} \
 )
 
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
index e49afa2102ae..2de9f8eda2da 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
@@ -94,19 +94,4 @@ union ia_css_all_memory_offsets {
 	} array[IA_CSS_NUM_PARAM_CLASSES];
 };
 
-#define IA_CSS_DEFAULT_ISP_MEM_PARAMS ( \
-	(struct ia_css_isp_param_host_segments) { \
-	} \
-)
-
-#define IA_CSS_DEFAULT_ISP_CSS_PARAMS ( \
-	(struct ia_css_isp_param_css_segments) { \
-	} \
-)
-
-#define IA_CSS_DEFAULT_ISP_ISP_PARAMS ( \
-	(struct ia_css_isp_param_isp_segments) { \
-	} \
-)
-
 #endif /* _IA_CSS_ISP_PARAM_TYPES_H_ */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
index 20d7fc1f2e4b..2b1763ccd436 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
@@ -5580,8 +5580,7 @@ static enum ia_css_err load_video_binaries(struct ia_css_pipe *pipe)
 	/* we build up the pipeline starting at the end */
 	/* YUV post-processing if needed */
 	if (need_scaler) {
-		struct ia_css_cas_binary_descr cas_scaler_descr
-			= IA_CSS_DEFAULT_CAS_BINARY_DESCR;
+		struct ia_css_cas_binary_descr cas_scaler_descr = { };
 
 		/* NV12 is the common format that is supported by both */
 		/* yuv_scaler and the video_xx_isp2_min binaries. */
@@ -6236,8 +6235,8 @@ static enum ia_css_err load_primary_binaries(
 						pipe_out_info->res);
 
 	if (need_extra_yuv_scaler) {
-		struct ia_css_cas_binary_descr cas_scaler_descr
-			= IA_CSS_DEFAULT_CAS_BINARY_DESCR;
+		struct ia_css_cas_binary_descr cas_scaler_descr = { };
+
 		err = ia_css_pipe_create_cas_scaler_desc_single_output(
 			&capt_pp_out_info,
 			pipe_out_info,
@@ -7224,7 +7223,7 @@ load_yuvpp_binaries(struct ia_css_pipe *pipe)
 	struct ia_css_frame_info *vf_pp_in_info[IA_CSS_PIPE_MAX_OUTPUT_STAGE];
 	struct ia_css_yuvpp_settings *mycs;
 	struct ia_css_binary *next_binary;
-	struct ia_css_cas_binary_descr cas_scaler_descr = IA_CSS_DEFAULT_CAS_BINARY_DESCR;
+	struct ia_css_cas_binary_descr cas_scaler_descr = { };
 	unsigned int i, j;
 	bool need_isp_copy_binary = false;
 
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h
index 77fc32a03c72..4fd25ba2cd0d 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h
@@ -52,11 +52,6 @@ struct ia_css_pipe_extra_config {
 	bool disable_vf_pp;
 };
 
-#define DEFAULT_PIPE_EXTRA_CONFIG ( \
-	(struct ia_css_pipe_extra_config) { \
-	} \
-)
-
 enum ia_css_err
 ia_css_pipe_create_extra(const struct ia_css_pipe_config *config,
 			 const struct ia_css_pipe_extra_config *extra_config,
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h
index aa3badd7e9da..2ef9238d95ad 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h
@@ -24,11 +24,6 @@ struct sh_css_pc_histogram {
 	unsigned *msink;
 };
 
-#define DEFAULT_PC_HISTOGRAM ( \
-	(struct sh_css_pc_histogram) { \
-	} \
-)
-
 struct sh_css_binary_metrics {
 	unsigned mode;
 	unsigned id;
@@ -37,13 +32,6 @@ struct sh_css_binary_metrics {
 	struct sh_css_binary_metrics *next;
 };
 
-#define DEFAULT_BINARY_METRICS ( \
-	(struct sh_css_binary_metrics) { \
-		.isp_histogram	= DEFAULT_PC_HISTOGRAM, \
-		.sp_histogram	= DEFAULT_PC_HISTOGRAM, \
-	} \
-)
-
 struct ia_css_frame_metrics {
 	unsigned num_frames;
 };
-- 
2.15.0

^ permalink raw reply related	[flat|nested] 53+ messages in thread

* Re: [PATCH v2 1/3] media: atomisp: convert default struct values to use compound-literals with designated initializers.
  2017-12-01 17:19                         ` [PATCH v2 1/3] media: atomisp: convert default struct values to use compound-literals with designated initializers Jeremy Sowden
@ 2017-12-02 10:20                           ` Dan Carpenter
  2017-12-02 10:35                             ` Jeremy Sowden
  0 siblings, 1 reply; 53+ messages in thread
From: Dan Carpenter @ 2017-12-02 10:20 UTC (permalink / raw)
  To: Jeremy Sowden; +Cc: linux-media, devel

On Fri, Dec 01, 2017 at 05:19:37PM +0000, Jeremy Sowden wrote:
> -#define DEFAULT_PIPE_INFO \
> -{ \
> -	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* output_info */ \
> -	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* vf_output_info */ \
> -	IA_CSS_BINARY_DEFAULT_FRAME_INFO,	/* raw_output_info */ \
> -	{ 0, 0},				/* output system in res */ \
> -	DEFAULT_SHADING_INFO,			/* shading_info */ \
> -	DEFAULT_GRID_INFO,			/* grid_info */ \
> -	0					/* num_invalid_frames */ \
> -}
> +#define DEFAULT_PIPE_INFO ( \

Why does this have a ( now?  That can't compile can it??

> +	(struct ia_css_pipe_info) { \
> +		.output_info			= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
> +		.vf_output_info			= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
> +		.raw_output_info		= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
> +		.output_system_in_res_info	= { 0, 0 }, \
> +		.shading_info			= DEFAULT_SHADING_INFO, \
> +		.grid_info			= DEFAULT_GRID_INFO, \
> +		.num_invalid_frames		= 0 \
> +	} \
> +)

We need to get better compile test coverage on this...  :/  There are
some others as well.

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH v2 1/3] media: atomisp: convert default struct values to use compound-literals with designated initializers.
  2017-12-02 10:20                           ` Dan Carpenter
@ 2017-12-02 10:35                             ` Jeremy Sowden
  2017-12-02 20:41                               ` Jeremy Sowden
  0 siblings, 1 reply; 53+ messages in thread
From: Jeremy Sowden @ 2017-12-02 10:35 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: linux-media, devel

[-- Attachment #1: Type: text/plain, Size: 1835 bytes --]

On 2017-12-02, at 13:20:09 +0300, Dan Carpenter wrote:
> On Fri, Dec 01, 2017 at 05:19:37PM +0000, Jeremy Sowden wrote:
> > -#define DEFAULT_PIPE_INFO \
> > -{ \
> > -	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* output_info */ \
> > -	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* vf_output_info */ \
> > -	IA_CSS_BINARY_DEFAULT_FRAME_INFO,	/* raw_output_info */ \
> > -	{ 0, 0},				/* output system in res */ \
> > -	DEFAULT_SHADING_INFO,			/* shading_info */ \
> > -	DEFAULT_GRID_INFO,			/* grid_info */ \
> > -	0					/* num_invalid_frames */ \
> > -}
> > +#define DEFAULT_PIPE_INFO ( \
>
> Why does this have a ( now?  That can't compile can it??

It does.

> > +	(struct ia_css_pipe_info) { \
> > +		.output_info			= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
> > +		.vf_output_info			= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
> > +		.raw_output_info		= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
> > +		.output_system_in_res_info	= { 0, 0 }, \
> > +		.shading_info			= DEFAULT_SHADING_INFO, \
> > +		.grid_info			= DEFAULT_GRID_INFO, \
> > +		.num_invalid_frames		= 0 \
> > +	} \
> > +)

Checkpatch got quite shouty, e.g.:

  ERROR: Macros with complex values should be enclosed in parentheses
  #826: FILE: drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h:215:
  +#define DEFAULT_DVS_STAT_PUBLIC_DVS_GLOBAL_CFG \
  +(struct dvs_stat_public_dvs_global_cfg) { \
  +       .kappa          = 0, \
  +       .match_shift    = 0, \
  +       .ybin_mode      = 0, \
  +}

so I just wrapped all of them.

> We need to get better compile test coverage on this...  :/  There are
> some others as well.

I have run a test-compilation.  Some of the code doesn't get built
because it's #ifdeffed off.  I did try adding -DISP2401 (which enables
most of it), that that just causes unrelated compilation failures.

J.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH v2 2/3] media: atomisp: delete zero-valued struct members.
  2017-12-01 17:41                           ` Alan Cox
@ 2017-12-02 15:00                             ` Jeremy Sowden
  0 siblings, 0 replies; 53+ messages in thread
From: Jeremy Sowden @ 2017-12-02 15:00 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-media, devel

[-- Attachment #1: Type: text/plain, Size: 341 bytes --]

On 2017-12-01, at 17:41:50 +0000, Alan Cox wrote:
> > --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe_public.h
> > +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe_public.h
> > @@ -152,14 +152,6 @@ struct ia_css_pipe_config {
> >  };
> >
>
>
> Thani you that's a really good cleanup.

Thanks. :)

J.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH v2 1/3] media: atomisp: convert default struct values to use compound-literals with designated initializers.
  2017-12-02 10:35                             ` Jeremy Sowden
@ 2017-12-02 20:41                               ` Jeremy Sowden
  2017-12-02 21:34                                 ` Jeremy Sowden
  2017-12-03  5:39                                 ` [PATCH v2 1/3] media: atomisp: convert default struct values to use compound-literals with designated initializers Dan Carpenter
  0 siblings, 2 replies; 53+ messages in thread
From: Jeremy Sowden @ 2017-12-02 20:41 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: linux-media, devel

[-- Attachment #1: Type: text/plain, Size: 2111 bytes --]

On 2017-12-02, at 10:35:06 +0000, Jeremy Sowden wrote:
> On 2017-12-02, at 13:20:09 +0300, Dan Carpenter wrote:
> > On Fri, Dec 01, 2017 at 05:19:37PM +0000, Jeremy Sowden wrote:
> > > -#define DEFAULT_PIPE_INFO \
> > > -{ \
> > > -	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* output_info */ \
> > > -	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* vf_output_info */ \
> > > -	IA_CSS_BINARY_DEFAULT_FRAME_INFO,	/* raw_output_info */ \
> > > -	{ 0, 0},				/* output system in res */ \
> > > -	DEFAULT_SHADING_INFO,			/* shading_info */ \
> > > -	DEFAULT_GRID_INFO,			/* grid_info */ \
> > > -	0					/* num_invalid_frames */ \
> > > -}
> > > +#define DEFAULT_PIPE_INFO ( \
> >
> > Why does this have a ( now?  That can't compile can it??
>
> It does.

That was a bit terse: the macros expand to compound-literals, so
putting parens around them is no different from:

  #define THREE (3)

It's also superfluous, of course.

> > > +	(struct ia_css_pipe_info) { \
> > > +		.output_info			= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
> > > +		.vf_output_info			= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
> > > +		.raw_output_info		= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
> > > +		.output_system_in_res_info	= { 0, 0 }, \
> > > +		.shading_info			= DEFAULT_SHADING_INFO, \
> > > +		.grid_info			= DEFAULT_GRID_INFO, \
> > > +		.num_invalid_frames		= 0 \
> > > +	} \
> > > +)
>
> Checkpatch got quite shouty, e.g.:
>
>   ERROR: Macros with complex values should be enclosed in parentheses
>   #826: FILE: drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h:215:
>   +#define DEFAULT_DVS_STAT_PUBLIC_DVS_GLOBAL_CFG \
>   +(struct dvs_stat_public_dvs_global_cfg) { \
>   +       .kappa          = 0, \
>   +       .match_shift    = 0, \
>   +       .ybin_mode      = 0, \
>   +}
>
> so I just wrapped all of them.

I've run checkpatch.pl against the unparenthesized patches, and it only
objects to some of the macros.  I've also taken a look at the source of
checkpatch.pl itself, and at first glance it appears that it should
accept them.  I'll see if I can work out why it's complaining.

J.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH v2 1/3] media: atomisp: convert default struct values to use compound-literals with designated initializers.
  2017-12-02 20:41                               ` Jeremy Sowden
@ 2017-12-02 21:34                                 ` Jeremy Sowden
  2017-12-02 22:11                                   ` [PATCH v4 0/3] media: atomisp: clean up of data-structure initialization in the CSS API Jeremy Sowden
  2017-12-03  5:39                                 ` [PATCH v2 1/3] media: atomisp: convert default struct values to use compound-literals with designated initializers Dan Carpenter
  1 sibling, 1 reply; 53+ messages in thread
From: Jeremy Sowden @ 2017-12-02 21:34 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: linux-media, devel

[-- Attachment #1: Type: text/plain, Size: 2285 bytes --]

On 2017-12-02, at 20:41:48 +0000, Jeremy Sowden wrote:
> On 2017-12-02, at 10:35:06 +0000, Jeremy Sowden wrote:
> > On 2017-12-02, at 13:20:09 +0300, Dan Carpenter wrote:
> > > On Fri, Dec 01, 2017 at 05:19:37PM +0000, Jeremy Sowden wrote:
> > > > -#define DEFAULT_PIPE_INFO \
> > > > -{ \
> > > > -	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* output_info */ \
> > > > -	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* vf_output_info */ \
> > > > -	IA_CSS_BINARY_DEFAULT_FRAME_INFO,	/* raw_output_info */ \
> > > > -	{ 0, 0},				/* output system in res */ \
> > > > -	DEFAULT_SHADING_INFO,			/* shading_info */ \
> > > > -	DEFAULT_GRID_INFO,			/* grid_info */ \
> > > > -	0					/* num_invalid_frames */ \
> > > > -}
> > > > +#define DEFAULT_PIPE_INFO ( \
> > >
> > > Why does this have a ( now?  That can't compile can it??
> > >
> > > > +	(struct ia_css_pipe_info) { \
> > > > +		.output_info			= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
> > > > +		.vf_output_info			= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
> > > > +		.raw_output_info		= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
> > > > +		.output_system_in_res_info	= { 0, 0 }, \
> > > > +		.shading_info			= DEFAULT_SHADING_INFO, \
> > > > +		.grid_info			= DEFAULT_GRID_INFO, \
> > > > +		.num_invalid_frames		= 0 \
> > > > +	} \
> > > > +)
> >
> > Checkpatch got quite shouty, e.g.:
> >
> >   ERROR: Macros with complex values should be enclosed in parentheses
> >   #826: FILE: drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h:215:
> >   +#define DEFAULT_DVS_STAT_PUBLIC_DVS_GLOBAL_CFG \
> >   +(struct dvs_stat_public_dvs_global_cfg) { \
> >   +       .kappa          = 0, \
> >   +       .match_shift    = 0, \
> >   +       .ybin_mode      = 0, \
> >   +}
> >
> > so I just wrapped all of them.
>
> I've run checkpatch.pl against the unparenthesized patches, and it
> only objects to some of the macros.  I've also taken a look at the
> source of checkpatch.pl itself, and at first glance it appears that it
> should accept them.  I'll see if I can work out why it's complaining.

I think I've found a bug in checkpatch.pl.  I'll remove the parentheses
from my patches 'cause the error-reportd appear to be bogus, and pass on
my findings.

J.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 53+ messages in thread

* [PATCH v4 0/3] media: atomisp: clean up of data-structure initialization in the CSS API
  2017-12-02 21:34                                 ` Jeremy Sowden
@ 2017-12-02 22:11                                   ` Jeremy Sowden
  2017-12-02 22:11                                     ` [PATCH v4 1/3] media: atomisp: convert default struct values to use compound-literals with designated initializers Jeremy Sowden
                                                       ` (2 more replies)
  0 siblings, 3 replies; 53+ messages in thread
From: Jeremy Sowden @ 2017-12-02 22:11 UTC (permalink / raw)
  To: linux-media, devel

v4.

  Removed the parens around the compound-literals in the macro
  definitions.  They were superfluous and the errors reported by
  checkpatch.pl appear to have been false positives resulting from a
  bug.

v3.

  Rebased on to git://linuxtv.org/media_tree.git.  Patch-set applies cleanly to
  linux-next as of 20171201.

v2.

  Fixed a couple of bugs and addressed checkpatch errors.

v1.

  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 made it
  possible 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.

  The designated initializers also allow the removal of lots of
  struct-members initialized to zero values.

  I made the changes in three stages: firstly, I converted the default
  values to compound-literals and designated initializers and removed
  the temporary variables; secondly, I removed the zero-valued
  struct-members; finally, I removed some structs which had become
  empty.

Jeremy Sowden (3):
  media: atomisp: convert default struct values to use compound-literals
    with designated initializers.
  media: atomisp: delete zero-valued struct members.
  media: atomisp: delete empty default struct values.

 .../hive_isp_css_common/input_formatter_global.h   |  16 ---
 .../pci/atomisp2/css2400/ia_css_frame_public.h     |  29 ++----
 .../atomisp/pci/atomisp2/css2400/ia_css_pipe.h     | 113 ++++++++-------------
 .../pci/atomisp2/css2400/ia_css_pipe_public.h      | 108 +++-----------------
 .../atomisp/pci/atomisp2/css2400/ia_css_types.h    |  64 +++---------
 .../isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h     |  50 +--------
 .../kernels/sdis/common/ia_css_sdis_common_types.h |  31 ++----
 .../isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c   |   3 +-
 .../runtime/binary/interface/ia_css_binary.h       |  88 ++--------------
 .../atomisp2/css2400/runtime/binary/src/binary.c   |   3 +-
 .../isp_param/interface/ia_css_isp_param_types.h   |  10 --
 .../runtime/pipeline/interface/ia_css_pipeline.h   |  24 ++---
 .../css2400/runtime/pipeline/src/pipeline.c        |   7 +-
 .../media/atomisp/pci/atomisp2/css2400/sh_css.c    |  31 ++----
 .../atomisp/pci/atomisp2/css2400/sh_css_legacy.h   |  11 --
 .../atomisp/pci/atomisp2/css2400/sh_css_metrics.h  |  21 ----
 16 files changed, 116 insertions(+), 493 deletions(-)


base-commit: 781b045baefdabf7e0bc9f33672ca830d3db9f27
-- 
2.15.0

^ permalink raw reply	[flat|nested] 53+ messages in thread

* [PATCH v4 1/3] media: atomisp: convert default struct values to use compound-literals with designated initializers.
  2017-12-02 22:11                                   ` [PATCH v4 0/3] media: atomisp: clean up of data-structure initialization in the CSS API Jeremy Sowden
@ 2017-12-02 22:11                                     ` Jeremy Sowden
  2017-12-19 12:07                                       ` Sakari Ailus
  2017-12-02 22:12                                     ` [PATCH v4 2/3] media: atomisp: delete zero-valued struct members Jeremy Sowden
  2017-12-02 22:12                                     ` [PATCH v4 3/3] media: atomisp: delete empty default struct values Jeremy Sowden
  2 siblings, 1 reply; 53+ messages in thread
From: Jeremy Sowden @ 2017-12-02 22:11 UTC (permalink / raw)
  To: linux-media, devel

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.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 .../hive_isp_css_common/input_formatter_global.h   |  26 ++--
 .../pci/atomisp2/css2400/ia_css_frame_public.h     |  46 ++++---
 .../atomisp/pci/atomisp2/css2400/ia_css_pipe.h     | 150 +++++++++++----------
 .../pci/atomisp2/css2400/ia_css_pipe_public.h      | 136 +++++++++----------
 .../atomisp/pci/atomisp2/css2400/ia_css_types.h    |  78 +++++------
 .../isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h     | 134 +++++++++++++-----
 .../kernels/sdis/common/ia_css_sdis_common_types.h |  86 +++++++++---
 .../isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c   |   3 +-
 .../runtime/binary/interface/ia_css_binary.h       | 140 +++++++++----------
 .../atomisp2/css2400/runtime/binary/src/binary.c   |   3 +-
 .../isp_param/interface/ia_css_isp_param_types.h   |  19 ++-
 .../runtime/pipeline/interface/ia_css_pipeline.h   |  30 ++---
 .../css2400/runtime/pipeline/src/pipeline.c        |   7 +-
 .../media/atomisp/pci/atomisp2/css2400/sh_css.c    |  22 +--
 .../atomisp/pci/atomisp2/css2400/sh_css_legacy.h   |  16 +--
 .../atomisp/pci/atomisp2/css2400/sh_css_metrics.h  |  26 ++--
 16 files changed, 518 insertions(+), 404 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/input_formatter_global.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/input_formatter_global.h
index 5654d911db65..4ce352986296 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/input_formatter_global.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/input_formatter_global.h
@@ -108,19 +108,19 @@ struct input_formatter_cfg_s {
 };
 
 #define DEFAULT_IF_CONFIG \
-{ \
-	0,          /* start_line */\
-	0,          /* start_column */\
-	0,          /* left_padding */\
-	0,          /* cropped_height */\
-	0,          /* cropped_width */\
-	0,          /* deinterleaving */\
-	0,          /*.buf_vecs */\
-	0,          /* buf_start_index */\
-	0,          /* buf_increment */\
-	0,          /* buf_eol_offset */\
-	false,      /* is_yuv420_format */\
-	false       /* block_no_reqs */\
+(struct input_formatter_cfg_s) { \
+	.start_line		= 0, \
+	.start_column		= 0, \
+	.left_padding		= 0, \
+	.cropped_height		= 0, \
+	.cropped_width		= 0, \
+	.deinterleaving		= 0, \
+	.buf_vecs		= 0, \
+	.buf_start_index	= 0, \
+	.buf_increment		= 0, \
+	.buf_eol_offset		= 0, \
+	.is_yuv420_format	= false, \
+	.block_no_reqs		= false \
 }
 
 extern const hrt_address HIVE_IF_SRST_ADDRESS[N_INPUT_FORMATTER_ID];
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_frame_public.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_frame_public.h
index ba7a076c3afa..634eca325f07 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_frame_public.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_frame_public.h
@@ -121,15 +121,19 @@ struct ia_css_frame_info {
 };
 
 #define IA_CSS_BINARY_DEFAULT_FRAME_INFO \
-{ \
-	{0,                      /* width */ \
-	 0},                     /* height */ \
-	0,                       /* padded_width */ \
-	IA_CSS_FRAME_FORMAT_NUM, /* format */ \
-	0,                       /* raw_bit_depth */ \
-	IA_CSS_BAYER_ORDER_NUM,  /* raw_bayer_order */ \
-	{0,                       /*start col */ \
-	 0},                       /*start line */ \
+(struct ia_css_frame_info) { \
+	.res			= (struct ia_css_resolution) { \
+					.width = 0, \
+					.height = 0 \
+				}, \
+	.padded_width		= 0, \
+	.format			= IA_CSS_FRAME_FORMAT_NUM,  \
+	.raw_bit_depth		= 0, \
+	.raw_bayer_order	= IA_CSS_BAYER_ORDER_NUM, \
+	.crop_info		= (struct ia_css_crop_info) { \
+					.start_column	= 0, \
+					.start_line	= 0 \
+				}, \
 }
 
 /**
@@ -190,18 +194,18 @@ struct ia_css_frame {
 };
 
 #define DEFAULT_FRAME \
-{ \
-	IA_CSS_BINARY_DEFAULT_FRAME_INFO,	/* info */ \
-	0,					/* data */ \
-	0,					/* data_bytes */ \
-	SH_CSS_INVALID_QUEUE_ID,		/* dynamic_data_index */ \
-	IA_CSS_BUFFER_TYPE_INVALID,			/* buf_type */ \
-	IA_CSS_FRAME_FLASH_STATE_NONE,		/* flash_state */ \
-	0,					/* exp_id */ \
-	0,					/* isp_config_id */ \
-	false,					/* valid */ \
-	false,					/* contiguous  */ \
-	{ 0 }					/* planes */ \
+(struct ia_css_frame) { \
+	.info			= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
+	.data			= 0, \
+	.data_bytes		= 0, \
+	.dynamic_queue_id	= SH_CSS_INVALID_QUEUE_ID, \
+	.buf_type		= IA_CSS_BUFFER_TYPE_INVALID, \
+	.flash_state		= IA_CSS_FRAME_FLASH_STATE_NONE, \
+	.exp_id			= 0, \
+	.isp_config_id		= 0, \
+	.valid			= false, \
+	.contiguous		= false, \
+	.planes			= { 0 } \
 }
 
 /* @brief Fill a frame with zeros
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h
index d0c0e6b92025..fa5e3f6b85a8 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h
@@ -33,22 +33,22 @@ struct ia_css_preview_settings {
 	/* 2401 only for these two - do we in fact use them for anything real */
 	struct ia_css_frame *delay_frames[MAX_NUM_DELAY_FRAMES];
 	struct ia_css_frame *tnr_frames[NUM_TNR_FRAMES];
-	
+
 	struct ia_css_pipe *copy_pipe;
 	struct ia_css_pipe *capture_pipe;
 	struct ia_css_pipe *acc_pipe;
 };
 
-#define IA_CSS_DEFAULT_PREVIEW_SETTINGS \
-{ \
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* copy_binary */\
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* preview_binary */\
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* vf_pp_binary */\
-	{ NULL },			/* dvs_frames */ \
-	{ NULL },			/* tnr_frames */ \
-	NULL,				/* copy_pipe */\
-	NULL,				/* capture_pipe */\
-	NULL,				/* acc_pipe */\
+#define IA_CSS_DEFAULT_PREVIEW_SETTINGS  \
+(struct ia_css_preview_settings) { \
+	.copy_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+	.preview_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+	.vf_pp_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+	.delay_frames	= { NULL }, \
+	.tnr_frames	= { NULL }, \
+	.copy_pipe	= NULL, \
+	.capture_pipe	= NULL, \
+	.acc_pipe	= NULL, \
 }
 
 struct ia_css_capture_settings {
@@ -70,20 +70,20 @@ struct ia_css_capture_settings {
 };
 
 #define IA_CSS_DEFAULT_CAPTURE_SETTINGS \
-{ \
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* copy_binary */\
-	{IA_CSS_BINARY_DEFAULT_SETTINGS},	/* primary_binary */\
-	0,				/* num_primary_stage */\
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* pre_isp_binary */\
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* anr_gdc_binary */\
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* post_isp_binary */\
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* capture_pp_binary */\
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* vf_pp_binary */\
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* capture_ldc_binary */\
-	NULL,				/* yuv_scaler_binary */ \
-	{ NULL },			/* delay_frames[ref_frames] */ \
-	NULL,				/* is_output_stage */ \
-	0,				/* num_yuv_scaler */ \
+(struct ia_css_capture_settings) { \
+	.copy_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+	.primary_binary		= {IA_CSS_BINARY_DEFAULT_SETTINGS}, \
+	.num_primary_stage	= 0, \
+	.pre_isp_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+	.anr_gdc_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+	.post_isp_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+	.capture_pp_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+	.vf_pp_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+	.capture_ldc_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+	.yuv_scaler_binary	= NULL, \
+	.delay_frames		= { NULL }, \
+	.is_output_stage	= NULL, \
+	.num_yuv_scaler		= 0, \
 }
 
 struct ia_css_video_settings {
@@ -105,18 +105,18 @@ struct ia_css_video_settings {
 };
 
 #define IA_CSS_DEFAULT_VIDEO_SETTINGS \
-{ \
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* copy_binary */ \
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* video_binary */ \
-	IA_CSS_BINARY_DEFAULT_SETTINGS,	/* vf_pp_binary */ \
-	NULL,				/* yuv_scaler_binary */ \
-	{ NULL },			/* delay_frames */ \
-	{ NULL },			/* tnr_frames */ \
-	NULL,				/* vf_pp_in_frame */ \
-	NULL,				/* copy_pipe */ \
-	NULL,				/* capture_pipe */ \
-	NULL,				/* is_output_stage */ \
-	0,				/* num_yuv_scaler */ \
+(struct ia_css_video_settings) { \
+	.copy_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+	.video_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+	.vf_pp_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+	.yuv_scaler_binary	= NULL, \
+	.delay_frames		= { NULL }, \
+	.tnr_frames		= { NULL }, \
+	.vf_pp_in_frame		= NULL, \
+	.copy_pipe		= NULL, \
+	.capture_pipe		= NULL, \
+	.is_output_stage	= NULL, \
+	.num_yuv_scaler		= 0, \
 }
 
 struct ia_css_yuvpp_settings {
@@ -130,14 +130,14 @@ struct ia_css_yuvpp_settings {
 };
 
 #define IA_CSS_DEFAULT_YUVPP_SETTINGS \
-{ \
-	IA_CSS_BINARY_DEFAULT_SETTINGS,		/* copy_binary */ \
-	NULL,					/* yuv_scaler_binary */ \
-	NULL,					/* vf_pp_binary */ \
-	NULL,					/* is_output_stage */ \
-	0,					/* num_yuv_scaler */ \
-	0,					/* num_vf_pp */ \
-	0,					/* num_output */ \
+(struct ia_css_yuvpp_settings) { \
+	.copy_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+	.yuv_scaler_binary	= NULL, \
+	.vf_pp_binary		= NULL, \
+	.is_output_stage	= NULL, \
+	.num_yuv_scaler		= 0, \
+	.num_vf_pp		= 0, \
+	.num_output		= 0, \
 }
 
 struct osys_object;
@@ -185,35 +185,37 @@ struct ia_css_pipe {
 };
 
 #define IA_CSS_DEFAULT_PIPE \
-{ \
-	false,					/* stop_requested */ \
-	DEFAULT_PIPE_CONFIG,			/* config */ \
-	DEFAULT_PIPE_EXTRA_CONFIG,		/* extra_config */ \
-	DEFAULT_PIPE_INFO,			/* info */ \
-	IA_CSS_PIPE_ID_ACC,			/* mode (pipe_id) */ \
-	NULL,					/* shading_table */ \
-	DEFAULT_PIPELINE,			/* pipeline */ \
-	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* output_info */ \
-	IA_CSS_BINARY_DEFAULT_FRAME_INFO,	/* bds_output_info */ \
-	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* vf_output_info */ \
-	IA_CSS_BINARY_DEFAULT_FRAME_INFO,	/* out_yuv_ds_input_info */ \
-	IA_CSS_BINARY_DEFAULT_FRAME_INFO,	/* vf_yuv_ds_input_info */ \
-	NULL,					/* output_stage */ \
-	NULL,					/* vf_stage */ \
-	SH_CSS_BDS_FACTOR_1_00,			/* required_bds_factor */ \
-	1,					/* dvs_frame_delay */ \
-	0,					/* num_invalid_frames */ \
-	{true},					/* enable_viewfinder */ \
-	NULL,					/* stream */ \
-	DEFAULT_FRAME,				/* in_frame_struct */ \
-	DEFAULT_FRAME,				/* out_frame_struct */ \
-	DEFAULT_FRAME,				/* vf_frame_struct */ \
-	{ NULL },				/* continuous_frames */ \
-	{ NULL },				/* cont_md_buffers */ \
-	{ IA_CSS_DEFAULT_PREVIEW_SETTINGS },	/* pipe_settings */ \
-	0,					/* scaler_pp_lut */ \
-	NULL,					/* osys object */ \
-	PIPE_ENTRY_EMPTY_TOKEN,			/* pipe_num */\
+(struct ia_css_pipe) { \
+	.stop_requested		= false, \
+	.config			= DEFAULT_PIPE_CONFIG, \
+	.extra_config		= DEFAULT_PIPE_EXTRA_CONFIG, \
+	.info			= DEFAULT_PIPE_INFO, \
+	.mode			= IA_CSS_PIPE_ID_ACC, /* (pipe_id) */ \
+	.shading_table		= NULL, \
+	.pipeline		= DEFAULT_PIPELINE, \
+	.output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
+	.bds_output_info	= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
+	.vf_output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
+	.out_yuv_ds_input_info	= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
+	.vf_yuv_ds_input_info	= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
+	.output_stage		= NULL, \
+	.vf_stage		= NULL, \
+	.required_bds_factor	= SH_CSS_BDS_FACTOR_1_00, \
+	.dvs_frame_delay	= 1, \
+	.num_invalid_frames	= 0, \
+	.enable_viewfinder	= {true}, \
+	.stream			= NULL, \
+	.in_frame_struct	= DEFAULT_FRAME, \
+	.out_frame_struct	= DEFAULT_FRAME, \
+	.vf_frame_struct	= DEFAULT_FRAME, \
+	.continuous_frames	= { NULL }, \
+	.cont_md_buffers	= { NULL }, \
+	.pipe_settings		= { \
+		.preview = IA_CSS_DEFAULT_PREVIEW_SETTINGS \
+	}, \
+	.scaler_pp_lut		= 0, \
+	.osys_obj		= NULL, \
+	.pipe_num		= PIPE_ENTRY_EMPTY_TOKEN, \
 }
 
 void ia_css_pipe_map_queue(struct ia_css_pipe *pipe, bool map);
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe_public.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe_public.h
index df0aad9a6ab9..58f3b5e16daa 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe_public.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe_public.h
@@ -157,42 +157,40 @@ struct ia_css_pipe_config {
  * Default origin of internal frame positioned on shading table.
  */
 #define IA_CSS_PIPE_DEFAULT_INTERNAL_FRAME_ORIGIN_BQS_ON_SCTBL \
-{ \
-	0,					/* x [bqs] */ \
-	0					/* y [bqs] */ \
-}
+(struct ia_css_coordinate) { .x = 0, .y = 0 }
 
 /**
  * Default settings for newly created pipe configurations.
  */
 #define DEFAULT_PIPE_CONFIG \
-{ \
-	IA_CSS_PIPE_MODE_PREVIEW,		/* mode */ \
-	1,					/* isp_pipe_version */ \
-	{ 0, 0 },				/* pipe_effective_input_res */ \
-	{ 0, 0 },				/* bayer_ds_out_res */ \
-	{ 0, 0 },				/* vf_pp_in_res */ \
-	{ 0, 0 },				/* capt_pp_in_res */ \
-	{ 0, 0 },				/* output_system_in_res */ \
-	{ 0, 0 },				/* dvs_crop_out_res */ \
-	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* output_info */ \
-	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* vf_output_info */ \
-	NULL,					/* acc_extension */ \
-	NULL,					/* acc_stages */ \
-	0,					/* num_acc_stages */ \
-	DEFAULT_CAPTURE_CONFIG,			/* default_capture_config */ \
-	{ 0, 0 },				/* dvs_envelope */ \
-	IA_CSS_FRAME_DELAY_1,			/* dvs_frame_delay */ \
-	-1,					/* acc_num_execs */ \
-	false,					/* enable_dz */ \
-	false,					/* enable_dpc */ \
-	false,					/* enable_vfpp_bci */ \
-	false,					/* enable_luma_only */ \
-	false,					/* enable_tnr */ \
-	NULL,					/* p_isp_config */\
-	{ 0, 0 },				/* gdc_in_buffer_res */ \
-	{ 0, 0 },				/* gdc_in_buffer_offset */ \
-	IA_CSS_PIPE_DEFAULT_INTERNAL_FRAME_ORIGIN_BQS_ON_SCTBL	/* internal_frame_origin_bqs_on_sctbl */ \
+(struct ia_css_pipe_config) { \
+	.mode			= IA_CSS_PIPE_MODE_PREVIEW, \
+	.isp_pipe_version	= 1, \
+	.input_effective_res	= { 0, 0 }, \
+	.bayer_ds_out_res	= { 0, 0 }, \
+	.capt_pp_in_res		= { 0, 0 }, \
+	.vf_pp_in_res		= { 0, 0 }, \
+	.output_system_in_res	= { 0, 0 }, \
+	.dvs_crop_out_res	= { 0, 0 }, \
+	.output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
+	.vf_output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
+	.acc_extension		= NULL, \
+	.acc_stages		= NULL, \
+	.num_acc_stages		= 0, \
+	.default_capture_config	= DEFAULT_CAPTURE_CONFIG, \
+	.dvs_envelope		= { 0, 0 }, \
+	.dvs_frame_delay	= IA_CSS_FRAME_DELAY_1, \
+	.acc_num_execs		= -1, \
+	.enable_dz		= false, \
+	.enable_dpc		= false, \
+	.enable_vfpp_bci	= false, \
+	.enable_luma_only	= false, \
+	.enable_tnr		= false, \
+	.p_isp_config		= NULL, \
+	.gdc_in_buffer_res	= { 0, 0 }, \
+	.gdc_in_buffer_offset	= { 0, 0 }, \
+	.internal_frame_origin_bqs_on_sctbl \
+				= IA_CSS_PIPE_DEFAULT_INTERNAL_FRAME_ORIGIN_BQS_ON_SCTBL \
 }
 
 #else
@@ -201,29 +199,29 @@ struct ia_css_pipe_config {
  * Default settings for newly created pipe configurations.
  */
 #define DEFAULT_PIPE_CONFIG \
-{ \
-	IA_CSS_PIPE_MODE_PREVIEW,		/* mode */ \
-	1,					/* isp_pipe_version */ \
-	{ 0, 0 },				/* pipe_effective_input_res */ \
-	{ 0, 0 },				/* bayer_ds_out_res */ \
-	{ 0, 0 },				/* vf_pp_in_res */ \
-	{ 0, 0 },				/* capt_pp_in_res */ \
-	{ 0, 0 },				/* dvs_crop_out_res */ \
-	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* output_info */ \
-	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* vf_output_info */ \
-	NULL,					/* acc_extension */ \
-	NULL,					/* acc_stages */ \
-	0,					/* num_acc_stages */ \
-	DEFAULT_CAPTURE_CONFIG,			/* default_capture_config */ \
-	{ 0, 0 },				/* dvs_envelope */ \
-	IA_CSS_FRAME_DELAY_1,			/* dvs_frame_delay */ \
-	-1,					/* acc_num_execs */ \
-	false,					/* enable_dz */ \
-	false,					/* enable_dpc */ \
-	false,					/* enable_vfpp_bci */ \
-	NULL,					/* p_isp_config */\
-	{ 0, 0 },				/* gdc_in_buffer_res */ \
-	{ 0, 0 }				/* gdc_in_buffer_offset */ \
+(struct ia_css_pipe_config) { \
+	.mode			= IA_CSS_PIPE_MODE_PREVIEW, \
+	.isp_pipe_version	= 1, \
+	.input_effective_res	= { 0, 0 }, \
+	.bayer_ds_out_res	= { 0, 0 }, \
+	.capt_pp_in_res		= { 0, 0 }, \
+	.vf_pp_in_res		= { 0, 0 }, \
+	.dvs_crop_out_res	= { 0, 0 }, \
+	.output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
+	.vf_output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
+	.acc_extension		= NULL, \
+	.acc_stages		= NULL, \
+	.num_acc_stages		= 0, \
+	.default_capture_config	= DEFAULT_CAPTURE_CONFIG, \
+	.dvs_envelope		= { 0, 0 }, \
+	.dvs_frame_delay	= IA_CSS_FRAME_DELAY_1, \
+	.acc_num_execs		= -1, \
+	.enable_dz		= false, \
+	.enable_dpc		= false, \
+	.enable_vfpp_bci	= false, \
+	.p_isp_config		= NULL, \
+	.gdc_in_buffer_res	= { 0, 0 }, \
+	.gdc_in_buffer_offset	= { 0, 0 } \
 }
 
 #endif
@@ -275,26 +273,26 @@ struct ia_css_pipe_info {
 #ifdef ISP2401
 
 #define DEFAULT_PIPE_INFO \
-{ \
-	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* output_info */ \
-	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* vf_output_info */ \
-	IA_CSS_BINARY_DEFAULT_FRAME_INFO,	/* raw_output_info */ \
-	{ 0, 0},				/* output system in res */ \
-	DEFAULT_SHADING_INFO,			/* shading_info */ \
-	DEFAULT_GRID_INFO,			/* grid_info */ \
-	0					/* num_invalid_frames */ \
+(struct ia_css_pipe_info) { \
+	.output_info			= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
+	.vf_output_info			= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
+	.raw_output_info		= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
+	.output_system_in_res_info	= { 0, 0 }, \
+	.shading_info			= DEFAULT_SHADING_INFO, \
+	.grid_info			= DEFAULT_GRID_INFO, \
+	.num_invalid_frames		= 0 \
 }
 
 #else
 
 #define DEFAULT_PIPE_INFO \
-{ \
-	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* output_info */ \
-	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* vf_output_info */ \
-	IA_CSS_BINARY_DEFAULT_FRAME_INFO,	/* raw_output_info */ \
-	DEFAULT_SHADING_INFO,			/* shading_info */ \
-	DEFAULT_GRID_INFO,			/* grid_info */ \
-	0					/* num_invalid_frames */ \
+(struct ia_css_pipe_info) { \
+	.output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
+	.vf_output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
+	.raw_output_info	= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
+	.shading_info		= DEFAULT_SHADING_INFO, \
+	.grid_info		= DEFAULT_GRID_INFO, \
+	.num_invalid_frames	= 0 \
 }
 
 #endif
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h
index 725b90072cfe..25e30bc8a663 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h
@@ -374,20 +374,20 @@ struct ia_css_shading_info {
 
 /* Default Shading Correction information of Shading Correction Type 1. */
 #define DEFAULT_SHADING_INFO_TYPE_1 \
-{ \
-	IA_CSS_SHADING_CORRECTION_TYPE_1,	/* type */ \
-	{					/* info */ \
-		{ \
-			0,	/* enable */ \
-			0,	/* num_hor_grids */ \
-			0,	/* num_ver_grids */ \
-			0,	/* bqs_per_grid_cell */ \
-			1,	/* bayer_scale_hor_ratio_in */ \
-			1,	/* bayer_scale_hor_ratio_out */ \
-			1,	/* bayer_scale_ver_ratio_in */ \
-			1,	/* bayer_scale_ver_ratio_out */ \
-			0,	/* sc_bayer_origin_x_bqs_on_shading_table */ \
-			0	/* sc_bayer_origin_y_bqs_on_shading_table */ \
+(struct ia_css_shading_info) { \
+	.type = IA_CSS_SHADING_CORRECTION_TYPE_1, \
+	.info = { \
+		.type_1 = { \
+			.enable					= 0, \
+			.num_hor_grids				= 0, \
+			.num_ver_grids				= 0, \
+			.bqs_per_grid_cell			= 0, \
+			.bayer_scale_hor_ratio_in		= 1, \
+			.bayer_scale_hor_ratio_out		= 1, \
+			.bayer_scale_ver_ratio_in		= 1, \
+			.bayer_scale_ver_ratio_out		= 1, \
+			.sc_bayer_origin_x_bqs_on_shading_table	= 0, \
+			.sc_bayer_origin_y_bqs_on_shading_table	= 0 \
 		} \
 	} \
 }
@@ -396,20 +396,20 @@ struct ia_css_shading_info {
 
 /* Default Shading Correction information of Shading Correction Type 1. */
 #define DEFAULT_SHADING_INFO_TYPE_1 \
-{ \
-	IA_CSS_SHADING_CORRECTION_TYPE_1,	/* type */ \
-	{					/* info */ \
-		{ \
-			0,			/* num_hor_grids */ \
-			0,			/* num_ver_grids */ \
-			0,			/* bqs_per_grid_cell */ \
-			1,			/* bayer_scale_hor_ratio_in */ \
-			1,			/* bayer_scale_hor_ratio_out */ \
-			1,			/* bayer_scale_ver_ratio_in */ \
-			1,			/* bayer_scale_ver_ratio_out */ \
-			{0, 0},			/* isp_input_sensor_data_res_bqs */ \
-			{0, 0},			/* sensor_data_res_bqs */ \
-			{0, 0}			/* sensor_data_origin_bqs_on_sctbl */ \
+(struct ia_css_shading_info) { \
+	.type = IA_CSS_SHADING_CORRECTION_TYPE_1, \
+	.info = { \
+		.type_1 = { \
+			.num_hor_grids				= 0, \
+			.num_ver_grids				= 0, \
+			.bqs_per_grid_cell			= 0, \
+			.bayer_scale_hor_ratio_in		= 1, \
+			.bayer_scale_hor_ratio_out		= 1, \
+			.bayer_scale_ver_ratio_in		= 1, \
+			.bayer_scale_ver_ratio_out		= 1, \
+			.isp_input_sensor_data_res_bqs		= {0, 0}, \
+			.sensor_data_res_bqs			= {0, 0}, \
+			.sensor_data_origin_bqs_on_sctbl	= {0, 0} \
 		} \
 	} \
 }
@@ -438,12 +438,12 @@ struct ia_css_grid_info {
 
 /* defaults for ia_css_grid_info structs */
 #define DEFAULT_GRID_INFO \
-{ \
-	0,				/* isp_in_width */ \
-	0,				/* isp_in_height */ \
-	DEFAULT_3A_GRID_INFO,		/* s3a_grid */ \
-	DEFAULT_DVS_GRID_INFO,		/* dvs_grid */ \
-	IA_CSS_VAMEM_TYPE_1		/* vamem_type */ \
+(struct ia_css_grid_info) { \
+	.isp_in_width	= 0, \
+	.isp_in_height	= 0, \
+	.s3a_grid	= DEFAULT_3A_GRID_INFO, \
+	.dvs_grid	= DEFAULT_DVS_GRID_INFO, \
+	.vamem_type	= IA_CSS_VAMEM_TYPE_1 \
 }
 
 /* Morphing table, used for geometric distortion and chromatic abberration
@@ -534,11 +534,11 @@ struct ia_css_capture_config {
 
 /* default settings for ia_css_capture_config structs */
 #define DEFAULT_CAPTURE_CONFIG \
-{ \
-	IA_CSS_CAPTURE_MODE_PRIMARY,	/* mode (capture) */ \
-	false,				/* enable_xnr */ \
-	false,				/* enable_raw_output */ \
-	false				/* enable_capture_pp_bli */ \
+(struct ia_css_capture_config) { \
+	.mode			= IA_CSS_CAPTURE_MODE_PRIMARY, \
+	.enable_xnr		= false, \
+	.enable_raw_output	= false, \
+	.enable_capture_pp_bli	= false \
 }
 
 
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h
index 8d674d2c6427..3ba736fee525 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h
@@ -28,7 +28,7 @@
 /* 3A configuration. This configures the 3A statistics collection
  *  module.
  */
- 
+
 /* 3A statistics grid
  *
  *  ISP block: S3A1 (3A Support for 3A ver.1 (Histogram is not used for AE))
@@ -54,7 +54,7 @@ struct ia_css_3a_grid_info {
   	uint32_t awb_fr_enable;					/** awb_fr enabled in binary,
 								   0:disabled, 1:enabled */
 	struct awb_fr_public_grid_config	awb_fr_grd_info;/** see description in awb_fr_public.h*/
-  
+
         uint32_t elem_bit_depth;    /** TODO:Taken from BYT  - need input from AIQ
 					if needed for SKC
 					Bit depth of element used
@@ -101,45 +101,113 @@ struct ia_css_3a_grid_info {
 #if defined(SYSTEM_css_skycam_c0_system)
 #if defined USE_NEW_AE_STRUCT || defined USE_NEW_AWB_STRUCT
 #define DEFAULT_3A_GRID_INFO \
-{ \
-	0,				/* ae_enable */ \
-	{0,0,0,0,0,0,0},	        /* AE:     width,height,b_width,b_height,x_start,y_start*/ \
-	0,				/* awb_enable */ \
-	{0,0,0,0,0,0},			/* AWB:    width,height,b_width,b_height,x_start,y_start*/ \
-	0,				/* af_enable */ \
-	{0,0,0,0,0,0,0},		/* AF:     width,height,b_width,b_height,x_start,y_start,ff_en*/ \
-	0,				/* awb_fr_enable */ \
-	{0,0,0,0,0,0,0},                  /* AWB_FR: width,height,b_width,b_height,x_start,y_start,ff_en*/ \
-	0,				/* elem_bit_depth */ \
+(struct ia_css_3a_grid_info) { \
+	.ae_enable		= 0, \
+	.ae_grd_info		= (struct ae_public_config_grid_config) { \
+					.width = 0, \
+					.height = 0, \
+					.b_width = 0, \
+					.b_height = 0, \
+					.x_start = 0, \
+					.y_start = 0, \
+					.x_end = 0, \
+					.y_end = 0 \
+				  } \
+	.awb_enable		= 0, \
+	.awb_grd_info		= (struct awb_public_config_grid_config) { \
+					.width = 0, \
+					.height = 0, \
+					.b_width = 0, \
+					.b_height = 0, \
+					.x_start = 0, \
+					.y_start = 0, \
+					.x_end = 0, \
+					.y_end = 0 \
+				  }	\
+	.af_enable		= 0, \
+	.af_grd_info		= (struct af_public_grid_config) { \
+					.width = 0, \
+					.height = 0, \
+					.b_width = 0, \
+					.b_height = 0, \
+					.x_start = 0, \
+					.y_start = 0, \
+					.ff_en = 0 \
+				  } \
+	.awb_fr_enable		= 0, \
+	.awb_fr_grd_info	= (struct awb_fr_public_grid_config) { \
+					.width = 0, \
+					.height = 0, \
+					.b_width = 0, \
+					.b_height = 0, \
+					.x_start = 0, \
+					.y_start = 0, \
+					.ff_en = 0 \
+				  } \
+	.elem_bit_depth		= 0, \
 }
 #else
 #define DEFAULT_3A_GRID_INFO \
-{ \
-	0,				/* ae_enable */ \
-	{0,0,0,0,0,0,0,0,0},	        /* AE:     width,height,b_width,b_height,x_start,y_start,x_end,y_end*/ \
-	0,				/* awb_enable */ \
-	{0,0,0,0,0,0,0,0},              /* AWB:    width,height,b_width,b_height,x_start,y_start,x_end,y_end*/ \
-	0,				/* af_enable */ \
-	{0,0,0,0,0,0,0},		/* AF:     width,height,b_width,b_height,x_start,y_start,ff_en*/ \
-	0,				/* awb_fr_enable */ \
-	{0,0,0,0,0,0,0},                  /* AWB_FR: width,height,b_width,b_height,x_start,y_start,ff_en*/ \
-	0,				/* elem_bit_depth */ \
+(struct ia_css_3a_grid_info) { \
+	.ae_enable		= 0, \
+	.ae_grd_info		= (struct ae_public_config_grid_config) { \
+					.width = 0, \
+					.height = 0, \
+					.b_width = 0, \
+					.b_height = 0, \
+					.x_start = 0, \
+					.y_start = 0, \
+					.x_end = 0, \
+					.y_end = 0 \
+				  } \
+	.awb_enable		= 0, \
+	.awb_grd_info		= (struct awb_public_config_grid_config) { \
+					.width = 0, \
+					.height = 0, \
+					.b_width = 0, \
+					.b_height = 0, \
+					.x_start = 0, \
+					.y_start = 0, \
+					.x_end = 0, \
+					.y_end = 0 \
+				  }	\
+	.af_enable		= 0, \
+	.af_grd_info		= (struct af_public_grid_config) { \
+					.width = 0, \
+					.height = 0, \
+					.b_width = 0, \
+					.b_height = 0, \
+					.x_start = 0, \
+					.y_start = 0, \
+					.ff_en = 0 \
+				  } \
+	.awb_fr_enable		= 0, \
+	.awb_fr_grd_info	= (struct awb_fr_public_grid_config) { \
+					.width = 0, \
+					.height = 0, \
+					.b_width = 0, \
+					.b_height = 0, \
+					.x_start = 0, \
+					.y_start = 0, \
+					.ff_en = 0 \
+				  } \
+	.elem_bit_depth		= 0, \
 }
 #endif /* USE_NEW_AE_STRUCT || defined USE_NEW_AWB_STRUCT */
 
 #else
 #define DEFAULT_3A_GRID_INFO \
-{ \
-	0,				/* enable */ \
-	0,				/* use_dmem */ \
-	0,				/* has_histogram */ \
-	0,				/* width */ \
-	0,				/* height */ \
-	0,				/* aligned_width */ \
-	0,				/* aligned_height */ \
-	0,				/* bqs_per_grid_cell */ \
-	0,				/* deci_factor_log2 */ \
-	0,				/* elem_bit_depth */ \
+(struct ia_css_3a_grid_info) { \
+	.enable			= 0, \
+	.use_dmem		= 0, \
+	.has_histogram		= 0, \
+	.width			= 0, \
+	.height			= 0, \
+	.aligned_width		= 0, \
+	.aligned_height		= 0, \
+	.bqs_per_grid_cell	= 0, \
+	.deci_factor_log2	= 0, \
+	.elem_bit_depth		= 0, \
 }
 
 #endif
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h
index 031983c357e4..b96c5890f615 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h
@@ -42,18 +42,22 @@ struct ia_css_sdis_info {
 };
 
 #define IA_CSS_DEFAULT_SDIS_INFO \
-	{	\
-		{	{ 0, 0 },	/* dim */ \
-			{ 0, 0 },	/* pad */ \
-		},	/* grid */ \
-		{	{ 0, 0 },	/* dim */ \
-			{ 0, 0 },	/* pad */ \
-		},	/* coef */ \
-		{	{ 0, 0 },	/* dim */ \
-			{ 0, 0 },	/* pad */ \
-		},	/* proj */ \
-		0,	/* dis_deci_factor_log2 */ \
-	}
+(struct ia_css_sdis_info) { \
+	.grid = { \
+		.dim = (struct ia_css_dvs_grid_dim) { .width = 0, .height = 0 }, \
+		.pad = (struct ia_css_dvs_grid_dim) { .width = 0, .height = 0 }, \
+	}, \
+	.coef = { \
+		.dim = (struct ia_css_dvs_grid_dim) { .width = 0, .height = 0 }, \
+		.pad = (struct ia_css_dvs_grid_dim) { .width = 0, .height = 0 }, \
+	}, \
+	.proj = { \
+		.dim = (struct ia_css_dvs_grid_dim) { .width = 0, .height = 0 }, \
+		.pad = (struct ia_css_dvs_grid_dim) { .width = 0, .height = 0 }, \
+	}, \
+	.deci_factor_log2 = 0, \
+}
+
 
 /* DVS statistics grid
  *
@@ -209,15 +213,59 @@ struct ia_css_dvs_stat_grid_info {
 
 /* DVS statistics generated by accelerator default grid info
  */
-#define DEFAULT_DVS_GRID_INFO { \
-{ \
-	{ 0, 0, 0},	/* GBL CFG reg: kappa, match_shifrt, binning mode*/ \
-	{{{0, 0, 0, 0}, {0, 0, 0}, {0, 0} }, \
-	{{0, 0, 0, 0}, {0, 0, 0}, {0, 0} }, \
-	{{0, 0, 0, 0}, {0, 0, 0}, {0, 0} } }, \
-	{{0, 0, 0, 0}, {4, 0, 0, 0}, {0, 0, 0, 0} } } \
+#define DEFAULT_DVS_STAT_PUBLIC_DVS_GLOBAL_CFG \
+(struct dvs_stat_public_dvs_global_cfg) { \
+	.kappa		= 0, \
+	.match_shift	= 0, \
+	.ybin_mode	= 0, \
 }
 
+#define DEFAULT_DVS_STAT_PUBLIC_DVS_GRD_CFG \
+(struct dvs_stat_public_dvs_grd_cfg) { \
+	.grd_cfg	= (struct dvs_stat_public_dvs_level_grid_cfg) { \
+				.grid_width = 0, \
+				.grid_height = 0, \
+				.block_width = 0, \
+				.block_height = 0 \
+			}, \
+	.grd_start	= (struct dvs_stat_public_dvs_level_grid_start) { \
+				.x_start = 0, \
+				.y_start = 0, \
+				.enable = 0 \
+			}, \
+	.grd_end	= (struct dvs_stat_public_dvs_level_grid_end) { \
+				.x_end = 0, \
+				.y_end = 0, \
+			}, \
+}
+
+#define DEFAULT_DVS_STAT_PUBLIC_DVS_LEVEL_FE_ROI_CFG(X_START) \
+(struct dvs_stat_public_dvs_level_fe_roi_cfg) { \
+	.x_start = X_START, \
+	.y_start = 0, \
+	.x_end   = 0, \
+	.y_end   = 0, \
+}
+
+#define DEFAULT_DVS_STAT_GRID_INFO \
+(struct ia_css_dvs_stat_grid_info) { \
+	.dvs_gbl_cfg = DEFAULT_DVS_STAT_PUBLIC_DVS_GLOBAL_CFG, \
+	.grd_cfg = { \
+		DEFAULT_DVS_STAT_PUBLIC_DVS_GRD_CFG, \
+		DEFAULT_DVS_STAT_PUBLIC_DVS_GRD_CFG, \
+		DEFAULT_DVS_STAT_PUBLIC_DVS_GRD_CFG \
+	}, \
+	.fe_roi_cfg = { \
+		DEFAULT_DVS_STAT_PUBLIC_DVS_LEVEL_FE_ROI_CFG(0), \
+		DEFAULT_DVS_STAT_PUBLIC_DVS_LEVEL_FE_ROI_CFG(4), \
+		DEFAULT_DVS_STAT_PUBLIC_DVS_LEVEL_FE_ROI_CFG(0), \
+	} \
+}
+
+#define DEFAULT_DVS_GRID_INFO \
+(union ia_css_dvs_grid_u) { \
+	.dvs_stat_grid_info = DEFAULT_DVS_STAT_GRID_INFO, \
+}
 
 /* Union that holds all types of DVS statistics grid info in
  *  CSS format
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c
index 9478c12abe89..e45a3c3fcf4a 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c
@@ -169,8 +169,7 @@ ia_css_sdis_init_info(
 	unsigned enabled)
 {
 	if (!enabled) {
-		struct ia_css_sdis_info default_dis = IA_CSS_DEFAULT_SDIS_INFO;
-		*dis = default_dis;
+		*dis = IA_CSS_DEFAULT_SDIS_INFO;
 		return;
 	}
 
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..f7685760ba87 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
@@ -94,14 +94,14 @@ struct ia_css_cas_binary_descr {
 };
 
 #define IA_CSS_DEFAULT_CAS_BINARY_DESCR \
-{ \
-	0,		\
-	0,		\
-	NULL,		\
-	NULL,		\
-	NULL,		\
-	NULL,		\
-	NULL,		\
+(struct ia_css_cas_binary_descr) {	\
+	.num_stage		= 0,	\
+	.num_output_stage	= 0,	\
+	.in_info		= NULL,	\
+	.internal_out_info	= NULL,	\
+	.out_info		= NULL,	\
+	.vf_info		= NULL,	\
+	.is_output_stage	= NULL,	\
 }
 
 struct ia_css_binary_descr {
@@ -174,73 +174,73 @@ struct ia_css_binary {
 #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) { \
+	.info				= NULL, \
+	.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}, \
+	.effective_in_frame_res		= { 0, 0 }, \
+	.vf_frame_info			= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
+	.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		= 0, \
+	.dis				= IA_CSS_DEFAULT_SDIS_INFO, \
+	.dvs_envelope			= { 0, 0 }, \
+	.online				= false, \
+	.uds_xc				= 0, \
+	.uds_yc				= 0, \
+	.left_padding			= 0, \
+	.metrics			= DEFAULT_BINARY_METRICS, \
+	.mem_params			= IA_CSS_DEFAULT_ISP_MEM_PARAMS, \
+	.css_params			= IA_CSS_DEFAULT_ISP_CSS_PARAMS, \
 }
 
 #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 */ \
+(struct ia_css_binary) { \
+	.info				= NULL, \
+	.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}, \
+	.effective_in_frame_res		= { 0, 0 }, \
+	.vf_frame_info			= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
+	.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, \
+	.dis				= IA_CSS_DEFAULT_SDIS_INFO, \
+	.dvs_envelope			= { 0, 0 }, \
+	.online				= false, \
+	.uds_xc				= 0, \
+	.uds_yc				= 0, \
+	.left_padding			= 0, \
+	.metrics			= DEFAULT_BINARY_METRICS, \
+	.mem_params			= IA_CSS_DEFAULT_ISP_MEM_PARAMS, \
+	.css_params			= IA_CSS_DEFAULT_ISP_CSS_PARAMS, \
 }
 
 #endif
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/binary/src/binary.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/binary/src/binary.c
index 295e07049393..a0f0e9062c4c 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/binary/src/binary.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/binary/src/binary.c
@@ -490,7 +490,6 @@ ia_css_binary_get_shading_info_type_1(const struct ia_css_binary *binary,	/* [in
 	struct sh_css_shading_table_bayer_origin_compute_results res;
 #else
 	struct sh_css_binary_sc_requirements scr;
-	struct ia_css_shading_info default_shading_info_type_1 = DEFAULT_SHADING_INFO_TYPE_1;
 #endif
 
 #ifndef ISP2401
@@ -542,7 +541,7 @@ ia_css_binary_get_shading_info_type_1(const struct ia_css_binary *binary,	/* [in
 		&res);
 	if (err != IA_CSS_SUCCESS)
 #else
-	*shading_info = default_shading_info_type_1;
+	*shading_info = DEFAULT_SHADING_INFO_TYPE_1;
 
 	err = sh_css_binary_get_sc_requirements(binary, required_bds_factor, stream_config, &scr);
 	if (err != IA_CSS_SUCCESS) {
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
index 2283dd1c1c9b..ded3a050d5fb 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
@@ -95,13 +95,24 @@ union ia_css_all_memory_offsets {
 };
 
 #define IA_CSS_DEFAULT_ISP_MEM_PARAMS \
-		{ { { { 0, 0 } } } }
+(struct ia_css_isp_param_host_segments) { \
+	.params = { { \
+		(struct ia_css_host_data) { .address = NULL, .size = 0 } \
+	} } \
+}
 
 #define IA_CSS_DEFAULT_ISP_CSS_PARAMS \
-		{ { { { 0, 0 } } } }
+(struct ia_css_isp_param_css_segments) { \
+	.params = { { \
+		(struct ia_css_data) { .address = 0, .size = 0 } \
+	} } \
+}
 
 #define IA_CSS_DEFAULT_ISP_ISP_PARAMS \
-		{ { { { 0, 0 } } } }
+(struct ia_css_isp_param_isp_segments) { \
+	.params = { { \
+		(struct ia_css_isp_data) { .address = 0, .size = 0 } \
+	} } \
+}
 
 #endif /* _IA_CSS_ISP_PARAM_TYPES_H_ */
-
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/interface/ia_css_pipeline.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/interface/ia_css_pipeline.h
index e64936e2d46e..99c8f5f4b92e 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/interface/ia_css_pipeline.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/interface/ia_css_pipeline.h
@@ -74,21 +74,21 @@ struct ia_css_pipeline {
 };
 
 #define DEFAULT_PIPELINE \
-{ \
-	IA_CSS_PIPE_ID_PREVIEW, /* pipe_id */ \
-	0,			/* pipe_num */ \
-	false,			/* stop_requested */ \
-	NULL,                   /* stages */ \
-	NULL,                   /* current_stage */ \
-	0,                      /* num_stages */ \
-	DEFAULT_FRAME,          /* in_frame */ \
-	{DEFAULT_FRAME},          /* out_frame */ \
-	{DEFAULT_FRAME},          /* vf_frame */ \
-	IA_CSS_FRAME_DELAY_1,   /* frame_delay */ \
-	0,                      /* inout_port_config */ \
-	-1,                     /* num_execs */ \
-	true,					/* acquire_isp_each_stage */\
-	QOS_INVALID             /* pipe_qos_config */\
+(struct ia_css_pipeline) { \
+	.pipe_id		= IA_CSS_PIPE_ID_PREVIEW, \
+	.pipe_num		= 0, \
+	.stop_requested		= false, \
+	.stages			= NULL, \
+	.current_stage		= NULL, \
+	.num_stages		= 0, \
+	.in_frame		= DEFAULT_FRAME, \
+	.out_frame		= {DEFAULT_FRAME}, \
+	.vf_frame		= {DEFAULT_FRAME}, \
+	.dvs_frame_delay	= IA_CSS_FRAME_DELAY_1, \
+	.inout_port_config	= 0, \
+	.num_execs		= -1, \
+	.acquire_isp_each_stage	= true, \
+	.pipe_qos_config	= QOS_INVALID \
 }
 
 /* Stage descriptor used to create a new stage in the pipeline */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/src/pipeline.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/src/pipeline.c
index 8f93d29d1c51..81a50c73ad0b 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/src/pipeline.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/src/pipeline.c
@@ -692,17 +692,16 @@ static void pipeline_init_defaults(
 	unsigned int pipe_num,
 	unsigned int dvs_frame_delay)
 {
-	struct ia_css_frame init_frame = DEFAULT_FRAME;
 	unsigned int i;
 
 	pipeline->pipe_id = pipe_id;
 	pipeline->stages = NULL;
 	pipeline->stop_requested = false;
 	pipeline->current_stage = NULL;
-	pipeline->in_frame = init_frame;
+	pipeline->in_frame = DEFAULT_FRAME;
 	for (i = 0; i < IA_CSS_PIPE_MAX_OUTPUT_STAGE; i++) {
-		pipeline->out_frame[i] = init_frame;
-		pipeline->vf_frame[i] = init_frame;
+		pipeline->out_frame[i] = DEFAULT_FRAME;
+		pipeline->vf_frame[i] = DEFAULT_FRAME;
 	}
 	pipeline->num_execs = -1;
 	pipeline->acquire_isp_each_stage = true;
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
index 322bb3de6098..20d7fc1f2e4b 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
@@ -112,8 +112,6 @@ static int thread_alive;
 #define STATS_ENABLED(stage) (stage && stage->binary && stage->binary->info && \
         (stage->binary->info->sp.enable.s3a || stage->binary->info->sp.enable.dis))
 
-#define DEFAULT_PLANES { {0, 0, 0, 0} }
-
 struct sh_css my_css;
 
 int (*sh_css_printf) (const char *fmt, va_list args) = NULL;
@@ -2291,25 +2289,19 @@ init_pipe_defaults(enum ia_css_pipe_mode mode,
 	       struct ia_css_pipe *pipe,
 	       bool copy_pipe)
 {
-	static struct ia_css_pipe default_pipe = IA_CSS_DEFAULT_PIPE;
-	static struct ia_css_preview_settings prev  = IA_CSS_DEFAULT_PREVIEW_SETTINGS;
-	static struct ia_css_capture_settings capt  = IA_CSS_DEFAULT_CAPTURE_SETTINGS;
-	static struct ia_css_video_settings   video = IA_CSS_DEFAULT_VIDEO_SETTINGS;
-	static struct ia_css_yuvpp_settings   yuvpp = IA_CSS_DEFAULT_YUVPP_SETTINGS;
-
 	if (pipe == NULL) {
 		IA_CSS_ERROR("NULL pipe parameter");
 		return IA_CSS_ERR_INVALID_ARGUMENTS;
 	}
 
 	/* Initialize pipe to pre-defined defaults */
-	*pipe = default_pipe;
+	*pipe = IA_CSS_DEFAULT_PIPE;
 
 	/* TODO: JB should not be needed, but temporary backward reference */
 	switch (mode) {
 	case IA_CSS_PIPE_MODE_PREVIEW:
 		pipe->mode = IA_CSS_PIPE_ID_PREVIEW;
-		pipe->pipe_settings.preview = prev;
+		pipe->pipe_settings.preview = IA_CSS_DEFAULT_PREVIEW_SETTINGS;
 		break;
 	case IA_CSS_PIPE_MODE_CAPTURE:
 		if (copy_pipe) {
@@ -2317,11 +2309,11 @@ init_pipe_defaults(enum ia_css_pipe_mode mode,
 		} else {
 			pipe->mode = IA_CSS_PIPE_ID_CAPTURE;
 		}
-		pipe->pipe_settings.capture = capt;
+		pipe->pipe_settings.capture = IA_CSS_DEFAULT_CAPTURE_SETTINGS;
 		break;
 	case IA_CSS_PIPE_MODE_VIDEO:
 		pipe->mode = IA_CSS_PIPE_ID_VIDEO;
-		pipe->pipe_settings.video = video;
+		pipe->pipe_settings.video = IA_CSS_DEFAULT_VIDEO_SETTINGS;
 		break;
 	case IA_CSS_PIPE_MODE_ACC:
 		pipe->mode = IA_CSS_PIPE_ID_ACC;
@@ -2331,7 +2323,7 @@ init_pipe_defaults(enum ia_css_pipe_mode mode,
 		break;
 	case IA_CSS_PIPE_MODE_YUVPP:
 		pipe->mode = IA_CSS_PIPE_ID_YUVPP;
-		pipe->pipe_settings.yuvpp = yuvpp;
+		pipe->pipe_settings.yuvpp = IA_CSS_DEFAULT_YUVPP_SETTINGS;
 		break;
 	default:
 		return IA_CSS_ERR_INVALID_ARGUMENTS;
@@ -8827,10 +8819,8 @@ sh_css_init_host_sp_control_vars(void)
  */
 void ia_css_pipe_config_defaults(struct ia_css_pipe_config *pipe_config)
 {
-	struct ia_css_pipe_config def_config = DEFAULT_PIPE_CONFIG;
-
 	ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, "ia_css_pipe_config_defaults()\n");
-	*pipe_config = def_config;
+	*pipe_config = DEFAULT_PIPE_CONFIG;
 }
 
 void
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h
index 4bcc35d219f8..f51b817b4a60 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h
@@ -53,14 +53,14 @@ struct ia_css_pipe_extra_config {
 };
 
 #define DEFAULT_PIPE_EXTRA_CONFIG \
-{ \
-	false,				/* enable_raw_binning */ \
-	false,				/* enable_yuv_ds */ \
-	false,				/* enable_high_speed */ \
-	false,				/* enable_dvs_6axis */ \
-	false,				/* enable_reduced_pipe */ \
-	false,				/* enable_fractional_ds */ \
-	false,				/* disable_vf_pp */ \
+(struct ia_css_pipe_extra_config) { \
+	.enable_raw_binning	= false, \
+	.enable_yuv_ds		= false, \
+	.enable_high_speed	= false, \
+	.enable_dvs_6axis	= false, \
+	.enable_reduced_pipe	= false, \
+	.enable_fractional_ds	= false, \
+	.disable_vf_pp		= false, \
 }
 
 enum ia_css_err
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h
index 40840ea318ab..f90ac36a408a 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h
@@ -24,15 +24,13 @@ struct sh_css_pc_histogram {
 	unsigned *msink;
 };
 
-#if !defined(__USE_DESIGNATED_INITIALISERS__)
 #define DEFAULT_PC_HISTOGRAM \
-{ \
-	0, \
-	NULL, \
-	NULL, \
-	NULL \
+(struct sh_css_pc_histogram) { \
+	.length	= 0, \
+	.run	= NULL, \
+	.stall	= NULL, \
+	.msink	= NULL \
 }
-#endif
 
 struct sh_css_binary_metrics {
 	unsigned mode;
@@ -42,16 +40,14 @@ struct sh_css_binary_metrics {
 	struct sh_css_binary_metrics *next;
 };
 
-#if !defined(__USE_DESIGNATED_INITIALISERS__)
 #define DEFAULT_BINARY_METRICS \
-{ \
-	0, \
-	0, \
-	DEFAULT_PC_HISTOGRAM, \
-	DEFAULT_PC_HISTOGRAM, \
-	NULL \
+(struct sh_css_binary_metrics) { \
+	.mode		= 0, \
+	.id		= 0, \
+	.isp_histogram	= DEFAULT_PC_HISTOGRAM, \
+	.sp_histogram	= DEFAULT_PC_HISTOGRAM, \
+	.next		= NULL \
 }
-#endif
 
 struct ia_css_frame_metrics {
 	unsigned num_frames;
-- 
2.15.0

^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v4 2/3] media: atomisp: delete zero-valued struct members.
  2017-12-02 22:11                                   ` [PATCH v4 0/3] media: atomisp: clean up of data-structure initialization in the CSS API Jeremy Sowden
  2017-12-02 22:11                                     ` [PATCH v4 1/3] media: atomisp: convert default struct values to use compound-literals with designated initializers Jeremy Sowden
@ 2017-12-02 22:12                                     ` Jeremy Sowden
  2017-12-02 22:12                                     ` [PATCH v4 3/3] media: atomisp: delete empty default struct values Jeremy Sowden
  2 siblings, 0 replies; 53+ messages in thread
From: Jeremy Sowden @ 2017-12-02 22:12 UTC (permalink / raw)
  To: linux-media, devel

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 to be removed.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 .../hive_isp_css_common/input_formatter_global.h   |  16 ---
 .../pci/atomisp2/css2400/ia_css_frame_public.h     |  17 ----
 .../atomisp/pci/atomisp2/css2400/ia_css_pipe.h     |  44 +--------
 .../pci/atomisp2/css2400/ia_css_pipe_public.h      |  78 ---------------
 .../atomisp/pci/atomisp2/css2400/ia_css_types.h    |  47 +--------
 .../isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h     | 109 ---------------------
 .../kernels/sdis/common/ia_css_sdis_common_types.h |  34 -------
 .../runtime/binary/interface/ia_css_binary.h       |  88 ++---------------
 .../isp_param/interface/ia_css_isp_param_types.h   |   9 --
 .../runtime/pipeline/interface/ia_css_pipeline.h   |   6 --
 .../atomisp/pci/atomisp2/css2400/sh_css_legacy.h   |   7 --
 .../atomisp/pci/atomisp2/css2400/sh_css_metrics.h  |   7 --
 12 files changed, 20 insertions(+), 442 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/input_formatter_global.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/input_formatter_global.h
index 4ce352986296..7558f4964313 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/input_formatter_global.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/input_formatter_global.h
@@ -107,22 +107,6 @@ struct input_formatter_cfg_s {
 	uint32_t	block_no_reqs;
 };
 
-#define DEFAULT_IF_CONFIG \
-(struct input_formatter_cfg_s) { \
-	.start_line		= 0, \
-	.start_column		= 0, \
-	.left_padding		= 0, \
-	.cropped_height		= 0, \
-	.cropped_width		= 0, \
-	.deinterleaving		= 0, \
-	.buf_vecs		= 0, \
-	.buf_start_index	= 0, \
-	.buf_increment		= 0, \
-	.buf_eol_offset		= 0, \
-	.is_yuv420_format	= false, \
-	.block_no_reqs		= false \
-}
-
 extern const hrt_address HIVE_IF_SRST_ADDRESS[N_INPUT_FORMATTER_ID];
 extern const hrt_data HIVE_IF_SRST_MASK[N_INPUT_FORMATTER_ID];
 extern const uint8_t HIVE_IF_SWITCH_CODE[N_INPUT_FORMATTER_ID];
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_frame_public.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_frame_public.h
index 634eca325f07..0beb7347a4f3 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_frame_public.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_frame_public.h
@@ -122,18 +122,8 @@ struct ia_css_frame_info {
 
 #define IA_CSS_BINARY_DEFAULT_FRAME_INFO \
 (struct ia_css_frame_info) { \
-	.res			= (struct ia_css_resolution) { \
-					.width = 0, \
-					.height = 0 \
-				}, \
-	.padded_width		= 0, \
 	.format			= IA_CSS_FRAME_FORMAT_NUM,  \
-	.raw_bit_depth		= 0, \
 	.raw_bayer_order	= IA_CSS_BAYER_ORDER_NUM, \
-	.crop_info		= (struct ia_css_crop_info) { \
-					.start_column	= 0, \
-					.start_line	= 0 \
-				}, \
 }
 
 /**
@@ -196,16 +186,9 @@ struct ia_css_frame {
 #define DEFAULT_FRAME \
 (struct ia_css_frame) { \
 	.info			= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
-	.data			= 0, \
-	.data_bytes		= 0, \
 	.dynamic_queue_id	= SH_CSS_INVALID_QUEUE_ID, \
 	.buf_type		= IA_CSS_BUFFER_TYPE_INVALID, \
 	.flash_state		= IA_CSS_FRAME_FLASH_STATE_NONE, \
-	.exp_id			= 0, \
-	.isp_config_id		= 0, \
-	.valid			= false, \
-	.contiguous		= false, \
-	.planes			= { 0 } \
 }
 
 /* @brief Fill a frame with zeros
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h
index fa5e3f6b85a8..522238ec8899 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h
@@ -39,16 +39,11 @@ struct ia_css_preview_settings {
 	struct ia_css_pipe *acc_pipe;
 };
 
-#define IA_CSS_DEFAULT_PREVIEW_SETTINGS  \
+#define IA_CSS_DEFAULT_PREVIEW_SETTINGS \
 (struct ia_css_preview_settings) { \
 	.copy_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
 	.preview_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
 	.vf_pp_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
-	.delay_frames	= { NULL }, \
-	.tnr_frames	= { NULL }, \
-	.copy_pipe	= NULL, \
-	.capture_pipe	= NULL, \
-	.acc_pipe	= NULL, \
 }
 
 struct ia_css_capture_settings {
@@ -73,17 +68,12 @@ struct ia_css_capture_settings {
 (struct ia_css_capture_settings) { \
 	.copy_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
 	.primary_binary		= {IA_CSS_BINARY_DEFAULT_SETTINGS}, \
-	.num_primary_stage	= 0, \
 	.pre_isp_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
 	.anr_gdc_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
 	.post_isp_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
 	.capture_pp_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
 	.vf_pp_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
 	.capture_ldc_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
-	.yuv_scaler_binary	= NULL, \
-	.delay_frames		= { NULL }, \
-	.is_output_stage	= NULL, \
-	.num_yuv_scaler		= 0, \
 }
 
 struct ia_css_video_settings {
@@ -106,17 +96,9 @@ struct ia_css_video_settings {
 
 #define IA_CSS_DEFAULT_VIDEO_SETTINGS \
 (struct ia_css_video_settings) { \
-	.copy_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
-	.video_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
-	.vf_pp_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
-	.yuv_scaler_binary	= NULL, \
-	.delay_frames		= { NULL }, \
-	.tnr_frames		= { NULL }, \
-	.vf_pp_in_frame		= NULL, \
-	.copy_pipe		= NULL, \
-	.capture_pipe		= NULL, \
-	.is_output_stage	= NULL, \
-	.num_yuv_scaler		= 0, \
+	.copy_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+	.video_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
+	.vf_pp_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
 }
 
 struct ia_css_yuvpp_settings {
@@ -131,13 +113,7 @@ struct ia_css_yuvpp_settings {
 
 #define IA_CSS_DEFAULT_YUVPP_SETTINGS \
 (struct ia_css_yuvpp_settings) { \
-	.copy_binary		= IA_CSS_BINARY_DEFAULT_SETTINGS, \
-	.yuv_scaler_binary	= NULL, \
-	.vf_pp_binary		= NULL, \
-	.is_output_stage	= NULL, \
-	.num_yuv_scaler		= 0, \
-	.num_vf_pp		= 0, \
-	.num_output		= 0, \
+	.copy_binary	= IA_CSS_BINARY_DEFAULT_SETTINGS, \
 }
 
 struct osys_object;
@@ -186,35 +162,25 @@ struct ia_css_pipe {
 
 #define IA_CSS_DEFAULT_PIPE \
 (struct ia_css_pipe) { \
-	.stop_requested		= false, \
 	.config			= DEFAULT_PIPE_CONFIG, \
 	.extra_config		= DEFAULT_PIPE_EXTRA_CONFIG, \
 	.info			= DEFAULT_PIPE_INFO, \
 	.mode			= IA_CSS_PIPE_ID_ACC, /* (pipe_id) */ \
-	.shading_table		= NULL, \
 	.pipeline		= DEFAULT_PIPELINE, \
 	.output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
 	.bds_output_info	= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
 	.vf_output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
 	.out_yuv_ds_input_info	= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
 	.vf_yuv_ds_input_info	= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
-	.output_stage		= NULL, \
-	.vf_stage		= NULL, \
 	.required_bds_factor	= SH_CSS_BDS_FACTOR_1_00, \
 	.dvs_frame_delay	= 1, \
-	.num_invalid_frames	= 0, \
 	.enable_viewfinder	= {true}, \
-	.stream			= NULL, \
 	.in_frame_struct	= DEFAULT_FRAME, \
 	.out_frame_struct	= DEFAULT_FRAME, \
 	.vf_frame_struct	= DEFAULT_FRAME, \
-	.continuous_frames	= { NULL }, \
-	.cont_md_buffers	= { NULL }, \
 	.pipe_settings		= { \
 		.preview = IA_CSS_DEFAULT_PREVIEW_SETTINGS \
 	}, \
-	.scaler_pp_lut		= 0, \
-	.osys_obj		= NULL, \
 	.pipe_num		= PIPE_ENTRY_EMPTY_TOKEN, \
 }
 
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe_public.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe_public.h
index 58f3b5e16daa..002eff7315bb 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe_public.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe_public.h
@@ -152,49 +152,6 @@ struct ia_css_pipe_config {
 };
 
 
-#ifdef ISP2401
-/**
- * Default origin of internal frame positioned on shading table.
- */
-#define IA_CSS_PIPE_DEFAULT_INTERNAL_FRAME_ORIGIN_BQS_ON_SCTBL \
-(struct ia_css_coordinate) { .x = 0, .y = 0 }
-
-/**
- * Default settings for newly created pipe configurations.
- */
-#define DEFAULT_PIPE_CONFIG \
-(struct ia_css_pipe_config) { \
-	.mode			= IA_CSS_PIPE_MODE_PREVIEW, \
-	.isp_pipe_version	= 1, \
-	.input_effective_res	= { 0, 0 }, \
-	.bayer_ds_out_res	= { 0, 0 }, \
-	.capt_pp_in_res		= { 0, 0 }, \
-	.vf_pp_in_res		= { 0, 0 }, \
-	.output_system_in_res	= { 0, 0 }, \
-	.dvs_crop_out_res	= { 0, 0 }, \
-	.output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
-	.vf_output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
-	.acc_extension		= NULL, \
-	.acc_stages		= NULL, \
-	.num_acc_stages		= 0, \
-	.default_capture_config	= DEFAULT_CAPTURE_CONFIG, \
-	.dvs_envelope		= { 0, 0 }, \
-	.dvs_frame_delay	= IA_CSS_FRAME_DELAY_1, \
-	.acc_num_execs		= -1, \
-	.enable_dz		= false, \
-	.enable_dpc		= false, \
-	.enable_vfpp_bci	= false, \
-	.enable_luma_only	= false, \
-	.enable_tnr		= false, \
-	.p_isp_config		= NULL, \
-	.gdc_in_buffer_res	= { 0, 0 }, \
-	.gdc_in_buffer_offset	= { 0, 0 }, \
-	.internal_frame_origin_bqs_on_sctbl \
-				= IA_CSS_PIPE_DEFAULT_INTERNAL_FRAME_ORIGIN_BQS_ON_SCTBL \
-}
-
-#else
-
 /**
  * Default settings for newly created pipe configurations.
  */
@@ -202,30 +159,13 @@ struct ia_css_pipe_config {
 (struct ia_css_pipe_config) { \
 	.mode			= IA_CSS_PIPE_MODE_PREVIEW, \
 	.isp_pipe_version	= 1, \
-	.input_effective_res	= { 0, 0 }, \
-	.bayer_ds_out_res	= { 0, 0 }, \
-	.capt_pp_in_res		= { 0, 0 }, \
-	.vf_pp_in_res		= { 0, 0 }, \
-	.dvs_crop_out_res	= { 0, 0 }, \
 	.output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
 	.vf_output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
-	.acc_extension		= NULL, \
-	.acc_stages		= NULL, \
-	.num_acc_stages		= 0, \
 	.default_capture_config	= DEFAULT_CAPTURE_CONFIG, \
-	.dvs_envelope		= { 0, 0 }, \
 	.dvs_frame_delay	= IA_CSS_FRAME_DELAY_1, \
 	.acc_num_execs		= -1, \
-	.enable_dz		= false, \
-	.enable_dpc		= false, \
-	.enable_vfpp_bci	= false, \
-	.p_isp_config		= NULL, \
-	.gdc_in_buffer_res	= { 0, 0 }, \
-	.gdc_in_buffer_offset	= { 0, 0 } \
 }
 
-#endif
-
 /* Pipe info, this struct describes properties of a pipe after it's stream has
  * been created.
  * ~~~** DO NOT ADD NEW FIELD **~~~ This structure will be deprecated.
@@ -270,21 +210,6 @@ struct ia_css_pipe_info {
 /**
  * Defaults for ia_css_pipe_info structs.
  */
-#ifdef ISP2401
-
-#define DEFAULT_PIPE_INFO \
-(struct ia_css_pipe_info) { \
-	.output_info			= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
-	.vf_output_info			= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
-	.raw_output_info		= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
-	.output_system_in_res_info	= { 0, 0 }, \
-	.shading_info			= DEFAULT_SHADING_INFO, \
-	.grid_info			= DEFAULT_GRID_INFO, \
-	.num_invalid_frames		= 0 \
-}
-
-#else
-
 #define DEFAULT_PIPE_INFO \
 (struct ia_css_pipe_info) { \
 	.output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
@@ -292,11 +217,8 @@ struct ia_css_pipe_info {
 	.raw_output_info	= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
 	.shading_info		= DEFAULT_SHADING_INFO, \
 	.grid_info		= DEFAULT_GRID_INFO, \
-	.num_invalid_frames	= 0 \
 }
 
-#endif
-
 /* @brief Load default pipe configuration
  * @param[out]	pipe_config The pipe configuration.
  * @return	None
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h
index 25e30bc8a663..a0ddf989fadf 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h
@@ -370,52 +370,20 @@ struct ia_css_shading_info {
 	} info;
 };
 
-#ifndef ISP2401
-
-/* Default Shading Correction information of Shading Correction Type 1. */
-#define DEFAULT_SHADING_INFO_TYPE_1 \
-(struct ia_css_shading_info) { \
-	.type = IA_CSS_SHADING_CORRECTION_TYPE_1, \
-	.info = { \
-		.type_1 = { \
-			.enable					= 0, \
-			.num_hor_grids				= 0, \
-			.num_ver_grids				= 0, \
-			.bqs_per_grid_cell			= 0, \
-			.bayer_scale_hor_ratio_in		= 1, \
-			.bayer_scale_hor_ratio_out		= 1, \
-			.bayer_scale_ver_ratio_in		= 1, \
-			.bayer_scale_ver_ratio_out		= 1, \
-			.sc_bayer_origin_x_bqs_on_shading_table	= 0, \
-			.sc_bayer_origin_y_bqs_on_shading_table	= 0 \
-		} \
-	} \
-}
-
-#else
-
 /* Default Shading Correction information of Shading Correction Type 1. */
 #define DEFAULT_SHADING_INFO_TYPE_1 \
 (struct ia_css_shading_info) { \
 	.type = IA_CSS_SHADING_CORRECTION_TYPE_1, \
 	.info = { \
 		.type_1 = { \
-			.num_hor_grids				= 0, \
-			.num_ver_grids				= 0, \
-			.bqs_per_grid_cell			= 0, \
-			.bayer_scale_hor_ratio_in		= 1, \
-			.bayer_scale_hor_ratio_out		= 1, \
-			.bayer_scale_ver_ratio_in		= 1, \
-			.bayer_scale_ver_ratio_out		= 1, \
-			.isp_input_sensor_data_res_bqs		= {0, 0}, \
-			.sensor_data_res_bqs			= {0, 0}, \
-			.sensor_data_origin_bqs_on_sctbl	= {0, 0} \
+			.bayer_scale_hor_ratio_in	= 1, \
+			.bayer_scale_hor_ratio_out	= 1, \
+			.bayer_scale_ver_ratio_in	= 1, \
+			.bayer_scale_ver_ratio_out	= 1, \
 		} \
 	} \
 }
 
-#endif
-
 /* Default Shading Correction information. */
 #define DEFAULT_SHADING_INFO	DEFAULT_SHADING_INFO_TYPE_1
 
@@ -439,8 +407,6 @@ struct ia_css_grid_info {
 /* defaults for ia_css_grid_info structs */
 #define DEFAULT_GRID_INFO \
 (struct ia_css_grid_info) { \
-	.isp_in_width	= 0, \
-	.isp_in_height	= 0, \
 	.s3a_grid	= DEFAULT_3A_GRID_INFO, \
 	.dvs_grid	= DEFAULT_DVS_GRID_INFO, \
 	.vamem_type	= IA_CSS_VAMEM_TYPE_1 \
@@ -535,10 +501,7 @@ struct ia_css_capture_config {
 /* default settings for ia_css_capture_config structs */
 #define DEFAULT_CAPTURE_CONFIG \
 (struct ia_css_capture_config) { \
-	.mode			= IA_CSS_CAPTURE_MODE_PRIMARY, \
-	.enable_xnr		= false, \
-	.enable_raw_output	= false, \
-	.enable_capture_pp_bli	= false \
+	.mode	= IA_CSS_CAPTURE_MODE_PRIMARY, \
 }
 
 
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h
index 3ba736fee525..988a0e272225 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h
@@ -98,119 +98,10 @@ struct ia_css_3a_grid_info {
 };
 
 
-#if defined(SYSTEM_css_skycam_c0_system)
-#if defined USE_NEW_AE_STRUCT || defined USE_NEW_AWB_STRUCT
-#define DEFAULT_3A_GRID_INFO \
-(struct ia_css_3a_grid_info) { \
-	.ae_enable		= 0, \
-	.ae_grd_info		= (struct ae_public_config_grid_config) { \
-					.width = 0, \
-					.height = 0, \
-					.b_width = 0, \
-					.b_height = 0, \
-					.x_start = 0, \
-					.y_start = 0, \
-					.x_end = 0, \
-					.y_end = 0 \
-				  } \
-	.awb_enable		= 0, \
-	.awb_grd_info		= (struct awb_public_config_grid_config) { \
-					.width = 0, \
-					.height = 0, \
-					.b_width = 0, \
-					.b_height = 0, \
-					.x_start = 0, \
-					.y_start = 0, \
-					.x_end = 0, \
-					.y_end = 0 \
-				  }	\
-	.af_enable		= 0, \
-	.af_grd_info		= (struct af_public_grid_config) { \
-					.width = 0, \
-					.height = 0, \
-					.b_width = 0, \
-					.b_height = 0, \
-					.x_start = 0, \
-					.y_start = 0, \
-					.ff_en = 0 \
-				  } \
-	.awb_fr_enable		= 0, \
-	.awb_fr_grd_info	= (struct awb_fr_public_grid_config) { \
-					.width = 0, \
-					.height = 0, \
-					.b_width = 0, \
-					.b_height = 0, \
-					.x_start = 0, \
-					.y_start = 0, \
-					.ff_en = 0 \
-				  } \
-	.elem_bit_depth		= 0, \
-}
-#else
 #define DEFAULT_3A_GRID_INFO \
 (struct ia_css_3a_grid_info) { \
-	.ae_enable		= 0, \
-	.ae_grd_info		= (struct ae_public_config_grid_config) { \
-					.width = 0, \
-					.height = 0, \
-					.b_width = 0, \
-					.b_height = 0, \
-					.x_start = 0, \
-					.y_start = 0, \
-					.x_end = 0, \
-					.y_end = 0 \
-				  } \
-	.awb_enable		= 0, \
-	.awb_grd_info		= (struct awb_public_config_grid_config) { \
-					.width = 0, \
-					.height = 0, \
-					.b_width = 0, \
-					.b_height = 0, \
-					.x_start = 0, \
-					.y_start = 0, \
-					.x_end = 0, \
-					.y_end = 0 \
-				  }	\
-	.af_enable		= 0, \
-	.af_grd_info		= (struct af_public_grid_config) { \
-					.width = 0, \
-					.height = 0, \
-					.b_width = 0, \
-					.b_height = 0, \
-					.x_start = 0, \
-					.y_start = 0, \
-					.ff_en = 0 \
-				  } \
-	.awb_fr_enable		= 0, \
-	.awb_fr_grd_info	= (struct awb_fr_public_grid_config) { \
-					.width = 0, \
-					.height = 0, \
-					.b_width = 0, \
-					.b_height = 0, \
-					.x_start = 0, \
-					.y_start = 0, \
-					.ff_en = 0 \
-				  } \
-	.elem_bit_depth		= 0, \
 }
-#endif /* USE_NEW_AE_STRUCT || defined USE_NEW_AWB_STRUCT */
 
-#else
-#define DEFAULT_3A_GRID_INFO \
-(struct ia_css_3a_grid_info) { \
-	.enable			= 0, \
-	.use_dmem		= 0, \
-	.has_histogram		= 0, \
-	.width			= 0, \
-	.height			= 0, \
-	.aligned_width		= 0, \
-	.aligned_height		= 0, \
-	.bqs_per_grid_cell	= 0, \
-	.deci_factor_log2	= 0, \
-	.elem_bit_depth		= 0, \
-}
-
-#endif
 
 /* This struct should be split into 3, for AE, AWB and AF.
  * However, that will require driver/ 3A lib modifications.
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h
index b96c5890f615..e867dadd8a83 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h
@@ -43,19 +43,6 @@ struct ia_css_sdis_info {
 
 #define IA_CSS_DEFAULT_SDIS_INFO \
 (struct ia_css_sdis_info) { \
-	.grid = { \
-		.dim = (struct ia_css_dvs_grid_dim) { .width = 0, .height = 0 }, \
-		.pad = (struct ia_css_dvs_grid_dim) { .width = 0, .height = 0 }, \
-	}, \
-	.coef = { \
-		.dim = (struct ia_css_dvs_grid_dim) { .width = 0, .height = 0 }, \
-		.pad = (struct ia_css_dvs_grid_dim) { .width = 0, .height = 0 }, \
-	}, \
-	.proj = { \
-		.dim = (struct ia_css_dvs_grid_dim) { .width = 0, .height = 0 }, \
-		.pad = (struct ia_css_dvs_grid_dim) { .width = 0, .height = 0 }, \
-	}, \
-	.deci_factor_log2 = 0, \
 }
 
 
@@ -215,36 +202,15 @@ struct ia_css_dvs_stat_grid_info {
  */
 #define DEFAULT_DVS_STAT_PUBLIC_DVS_GLOBAL_CFG \
 (struct dvs_stat_public_dvs_global_cfg) { \
-	.kappa		= 0, \
-	.match_shift	= 0, \
-	.ybin_mode	= 0, \
 }
 
 #define DEFAULT_DVS_STAT_PUBLIC_DVS_GRD_CFG \
 (struct dvs_stat_public_dvs_grd_cfg) { \
-	.grd_cfg	= (struct dvs_stat_public_dvs_level_grid_cfg) { \
-				.grid_width = 0, \
-				.grid_height = 0, \
-				.block_width = 0, \
-				.block_height = 0 \
-			}, \
-	.grd_start	= (struct dvs_stat_public_dvs_level_grid_start) { \
-				.x_start = 0, \
-				.y_start = 0, \
-				.enable = 0 \
-			}, \
-	.grd_end	= (struct dvs_stat_public_dvs_level_grid_end) { \
-				.x_end = 0, \
-				.y_end = 0, \
-			}, \
 }
 
 #define DEFAULT_DVS_STAT_PUBLIC_DVS_LEVEL_FE_ROI_CFG(X_START) \
 (struct dvs_stat_public_dvs_level_fe_roi_cfg) { \
 	.x_start = X_START, \
-	.y_start = 0, \
-	.x_end   = 0, \
-	.y_end   = 0, \
 }
 
 #define DEFAULT_DVS_STAT_GRID_INFO \
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 f7685760ba87..c4abddf28670 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
@@ -94,14 +94,7 @@ struct ia_css_cas_binary_descr {
 };
 
 #define IA_CSS_DEFAULT_CAS_BINARY_DESCR \
-(struct ia_css_cas_binary_descr) {	\
-	.num_stage		= 0,	\
-	.num_output_stage	= 0,	\
-	.in_info		= NULL,	\
-	.internal_out_info	= NULL,	\
-	.out_info		= NULL,	\
-	.vf_info		= NULL,	\
-	.is_output_stage	= NULL,	\
+(struct ia_css_cas_binary_descr) { \
 }
 
 struct ia_css_binary_descr {
@@ -171,80 +164,19 @@ struct ia_css_binary {
 	struct ia_css_isp_param_css_segments  css_params;
 };
 
-#ifdef ISP2401
-
-#define IA_CSS_BINARY_DEFAULT_SETTINGS \
-(struct ia_css_binary) { \
-	.info				= NULL, \
-	.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}, \
-	.effective_in_frame_res		= { 0, 0 }, \
-	.vf_frame_info			= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
-	.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		= 0, \
-	.dis				= IA_CSS_DEFAULT_SDIS_INFO, \
-	.dvs_envelope			= { 0, 0 }, \
-	.online				= false, \
-	.uds_xc				= 0, \
-	.uds_yc				= 0, \
-	.left_padding			= 0, \
-	.metrics			= DEFAULT_BINARY_METRICS, \
-	.mem_params			= IA_CSS_DEFAULT_ISP_MEM_PARAMS, \
-	.css_params			= IA_CSS_DEFAULT_ISP_CSS_PARAMS, \
-}
-
-#else
-
 #define IA_CSS_BINARY_DEFAULT_SETTINGS \
 (struct ia_css_binary) { \
-	.info				= NULL, \
-	.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}, \
-	.effective_in_frame_res		= { 0, 0 }, \
-	.vf_frame_info			= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
-	.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, \
-	.dis				= IA_CSS_DEFAULT_SDIS_INFO, \
-	.dvs_envelope			= { 0, 0 }, \
-	.online				= false, \
-	.uds_xc				= 0, \
-	.uds_yc				= 0, \
-	.left_padding			= 0, \
-	.metrics			= DEFAULT_BINARY_METRICS, \
-	.mem_params			= IA_CSS_DEFAULT_ISP_MEM_PARAMS, \
-	.css_params			= IA_CSS_DEFAULT_ISP_CSS_PARAMS, \
+	.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, \
+	.dis			= IA_CSS_DEFAULT_SDIS_INFO, \
+	.metrics		= DEFAULT_BINARY_METRICS, \
+	.mem_params		= IA_CSS_DEFAULT_ISP_MEM_PARAMS, \
+	.css_params		= IA_CSS_DEFAULT_ISP_CSS_PARAMS, \
 }
 
-#endif
-
 enum ia_css_err
 ia_css_binary_init_infos(void);
 
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
index ded3a050d5fb..f9b65eb764d8 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
@@ -96,23 +96,14 @@ union ia_css_all_memory_offsets {
 
 #define IA_CSS_DEFAULT_ISP_MEM_PARAMS \
 (struct ia_css_isp_param_host_segments) { \
-	.params = { { \
-		(struct ia_css_host_data) { .address = NULL, .size = 0 } \
-	} } \
 }
 
 #define IA_CSS_DEFAULT_ISP_CSS_PARAMS \
 (struct ia_css_isp_param_css_segments) { \
-	.params = { { \
-		(struct ia_css_data) { .address = 0, .size = 0 } \
-	} } \
 }
 
 #define IA_CSS_DEFAULT_ISP_ISP_PARAMS \
 (struct ia_css_isp_param_isp_segments) { \
-	.params = { { \
-		(struct ia_css_isp_data) { .address = 0, .size = 0 } \
-	} } \
 }
 
 #endif /* _IA_CSS_ISP_PARAM_TYPES_H_ */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/interface/ia_css_pipeline.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/interface/ia_css_pipeline.h
index 99c8f5f4b92e..85ed7db0af55 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/interface/ia_css_pipeline.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/interface/ia_css_pipeline.h
@@ -76,16 +76,10 @@ struct ia_css_pipeline {
 #define DEFAULT_PIPELINE \
 (struct ia_css_pipeline) { \
 	.pipe_id		= IA_CSS_PIPE_ID_PREVIEW, \
-	.pipe_num		= 0, \
-	.stop_requested		= false, \
-	.stages			= NULL, \
-	.current_stage		= NULL, \
-	.num_stages		= 0, \
 	.in_frame		= DEFAULT_FRAME, \
 	.out_frame		= {DEFAULT_FRAME}, \
 	.vf_frame		= {DEFAULT_FRAME}, \
 	.dvs_frame_delay	= IA_CSS_FRAME_DELAY_1, \
-	.inout_port_config	= 0, \
 	.num_execs		= -1, \
 	.acquire_isp_each_stage	= true, \
 	.pipe_qos_config	= QOS_INVALID \
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h
index f51b817b4a60..6c78a15485f6 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h
@@ -54,13 +54,6 @@ struct ia_css_pipe_extra_config {
 
 #define DEFAULT_PIPE_EXTRA_CONFIG \
 (struct ia_css_pipe_extra_config) { \
-	.enable_raw_binning	= false, \
-	.enable_yuv_ds		= false, \
-	.enable_high_speed	= false, \
-	.enable_dvs_6axis	= false, \
-	.enable_reduced_pipe	= false, \
-	.enable_fractional_ds	= false, \
-	.disable_vf_pp		= false, \
 }
 
 enum ia_css_err
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h
index f90ac36a408a..3387e8bafbe7 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h
@@ -26,10 +26,6 @@ struct sh_css_pc_histogram {
 
 #define DEFAULT_PC_HISTOGRAM \
 (struct sh_css_pc_histogram) { \
-	.length	= 0, \
-	.run	= NULL, \
-	.stall	= NULL, \
-	.msink	= NULL \
 }
 
 struct sh_css_binary_metrics {
@@ -42,11 +38,8 @@ struct sh_css_binary_metrics {
 
 #define DEFAULT_BINARY_METRICS \
 (struct sh_css_binary_metrics) { \
-	.mode		= 0, \
-	.id		= 0, \
 	.isp_histogram	= DEFAULT_PC_HISTOGRAM, \
 	.sp_histogram	= DEFAULT_PC_HISTOGRAM, \
-	.next		= NULL \
 }
 
 struct ia_css_frame_metrics {
-- 
2.15.0

^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v4 3/3] media: atomisp: delete empty default struct values.
  2017-12-02 22:11                                   ` [PATCH v4 0/3] media: atomisp: clean up of data-structure initialization in the CSS API Jeremy Sowden
  2017-12-02 22:11                                     ` [PATCH v4 1/3] media: atomisp: convert default struct values to use compound-literals with designated initializers Jeremy Sowden
  2017-12-02 22:12                                     ` [PATCH v4 2/3] media: atomisp: delete zero-valued struct members Jeremy Sowden
@ 2017-12-02 22:12                                     ` Jeremy Sowden
  2017-12-19 12:08                                       ` Sakari Ailus
  2 siblings, 1 reply; 53+ messages in thread
From: Jeremy Sowden @ 2017-12-02 22:12 UTC (permalink / raw)
  To: linux-media, devel

Removing zero-valued struct-members left a number of the default
struct-values empty.  These values have now been removed.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 .../atomisp/pci/atomisp2/css2400/ia_css_pipe.h     |  1 -
 .../atomisp/pci/atomisp2/css2400/ia_css_types.h    |  1 -
 .../isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h     |  5 ---
 .../kernels/sdis/common/ia_css_sdis_common_types.h | 41 ++++------------------
 .../isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c   |  2 +-
 .../runtime/binary/interface/ia_css_binary.h       |  8 -----
 .../isp_param/interface/ia_css_isp_param_types.h   | 12 -------
 .../media/atomisp/pci/atomisp2/css2400/sh_css.c    |  9 +++--
 .../atomisp/pci/atomisp2/css2400/sh_css_legacy.h   |  4 ---
 .../atomisp/pci/atomisp2/css2400/sh_css_metrics.h  | 10 ------
 10 files changed, 12 insertions(+), 81 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h
index 522238ec8899..f6870fa7a18c 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h
@@ -163,7 +163,6 @@ struct ia_css_pipe {
 #define IA_CSS_DEFAULT_PIPE \
 (struct ia_css_pipe) { \
 	.config			= DEFAULT_PIPE_CONFIG, \
-	.extra_config		= DEFAULT_PIPE_EXTRA_CONFIG, \
 	.info			= DEFAULT_PIPE_INFO, \
 	.mode			= IA_CSS_PIPE_ID_ACC, /* (pipe_id) */ \
 	.pipeline		= DEFAULT_PIPELINE, \
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h
index a0ddf989fadf..259ab3f074ba 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h
@@ -407,7 +407,6 @@ struct ia_css_grid_info {
 /* defaults for ia_css_grid_info structs */
 #define DEFAULT_GRID_INFO \
 (struct ia_css_grid_info) { \
-	.s3a_grid	= DEFAULT_3A_GRID_INFO, \
 	.dvs_grid	= DEFAULT_DVS_GRID_INFO, \
 	.vamem_type	= IA_CSS_VAMEM_TYPE_1 \
 }
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h
index 988a0e272225..63e70669f085 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h
@@ -98,11 +98,6 @@ struct ia_css_3a_grid_info {
 };
 
 
-#define DEFAULT_3A_GRID_INFO \
-(struct ia_css_3a_grid_info) { \
-}
-
-
 /* This struct should be split into 3, for AE, AWB and AF.
  * However, that will require driver/ 3A lib modifications.
  */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h
index e867dadd8a83..381e5730d405 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h
@@ -41,11 +41,6 @@ struct ia_css_sdis_info {
 	uint32_t deci_factor_log2;
 };
 
-#define IA_CSS_DEFAULT_SDIS_INFO \
-(struct ia_css_sdis_info) { \
-}
-
-
 /* DVS statistics grid
  *
  *  ISP block: SDVS1 (DIS/DVS Support for DIS/DVS ver.1 (2-axes))
@@ -200,37 +195,15 @@ struct ia_css_dvs_stat_grid_info {
 
 /* DVS statistics generated by accelerator default grid info
  */
-#define DEFAULT_DVS_STAT_PUBLIC_DVS_GLOBAL_CFG \
-(struct dvs_stat_public_dvs_global_cfg) { \
-}
-
-#define DEFAULT_DVS_STAT_PUBLIC_DVS_GRD_CFG \
-(struct dvs_stat_public_dvs_grd_cfg) { \
-}
-
-#define DEFAULT_DVS_STAT_PUBLIC_DVS_LEVEL_FE_ROI_CFG(X_START) \
-(struct dvs_stat_public_dvs_level_fe_roi_cfg) { \
-	.x_start = X_START, \
-}
-
-#define DEFAULT_DVS_STAT_GRID_INFO \
-(struct ia_css_dvs_stat_grid_info) { \
-	.dvs_gbl_cfg = DEFAULT_DVS_STAT_PUBLIC_DVS_GLOBAL_CFG, \
-	.grd_cfg = { \
-		DEFAULT_DVS_STAT_PUBLIC_DVS_GRD_CFG, \
-		DEFAULT_DVS_STAT_PUBLIC_DVS_GRD_CFG, \
-		DEFAULT_DVS_STAT_PUBLIC_DVS_GRD_CFG \
-	}, \
-	.fe_roi_cfg = { \
-		DEFAULT_DVS_STAT_PUBLIC_DVS_LEVEL_FE_ROI_CFG(0), \
-		DEFAULT_DVS_STAT_PUBLIC_DVS_LEVEL_FE_ROI_CFG(4), \
-		DEFAULT_DVS_STAT_PUBLIC_DVS_LEVEL_FE_ROI_CFG(0), \
-	} \
-}
-
 #define DEFAULT_DVS_GRID_INFO \
 (union ia_css_dvs_grid_u) { \
-	.dvs_stat_grid_info = DEFAULT_DVS_STAT_GRID_INFO, \
+	.dvs_stat_grid_info = (struct ia_css_dvs_stat_grid_info) { \
+		.fe_roi_cfg = { \
+			[1] = (struct dvs_stat_public_dvs_level_fe_roi_cfg) { \
+				.x_start = 4 \
+			} \
+		} \
+	} \
 }
 
 /* Union that holds all types of DVS statistics grid info in
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c
index e45a3c3fcf4a..0fdd696bf654 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c
@@ -169,7 +169,7 @@ ia_css_sdis_init_info(
 	unsigned enabled)
 {
 	if (!enabled) {
-		*dis = IA_CSS_DEFAULT_SDIS_INFO;
+		*dis = (struct ia_css_sdis_info) { };
 		return;
 	}
 
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 c4abddf28670..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,10 +93,6 @@ struct ia_css_cas_binary_descr {
 	bool *is_output_stage;
 };
 
-#define IA_CSS_DEFAULT_CAS_BINARY_DESCR \
-(struct ia_css_cas_binary_descr) { \
-}
-
 struct ia_css_binary_descr {
 	int mode;
 	bool online;
@@ -171,10 +167,6 @@ struct ia_css_binary {
 	.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, \
-	.dis			= IA_CSS_DEFAULT_SDIS_INFO, \
-	.metrics		= DEFAULT_BINARY_METRICS, \
-	.mem_params		= IA_CSS_DEFAULT_ISP_MEM_PARAMS, \
-	.css_params		= IA_CSS_DEFAULT_ISP_CSS_PARAMS, \
 }
 
 enum ia_css_err
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
index f9b65eb764d8..2de9f8eda2da 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h
@@ -94,16 +94,4 @@ union ia_css_all_memory_offsets {
 	} array[IA_CSS_NUM_PARAM_CLASSES];
 };
 
-#define IA_CSS_DEFAULT_ISP_MEM_PARAMS \
-(struct ia_css_isp_param_host_segments) { \
-}
-
-#define IA_CSS_DEFAULT_ISP_CSS_PARAMS \
-(struct ia_css_isp_param_css_segments) { \
-}
-
-#define IA_CSS_DEFAULT_ISP_ISP_PARAMS \
-(struct ia_css_isp_param_isp_segments) { \
-}
-
 #endif /* _IA_CSS_ISP_PARAM_TYPES_H_ */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
index 20d7fc1f2e4b..2b1763ccd436 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
@@ -5580,8 +5580,7 @@ static enum ia_css_err load_video_binaries(struct ia_css_pipe *pipe)
 	/* we build up the pipeline starting at the end */
 	/* YUV post-processing if needed */
 	if (need_scaler) {
-		struct ia_css_cas_binary_descr cas_scaler_descr
-			= IA_CSS_DEFAULT_CAS_BINARY_DESCR;
+		struct ia_css_cas_binary_descr cas_scaler_descr = { };
 
 		/* NV12 is the common format that is supported by both */
 		/* yuv_scaler and the video_xx_isp2_min binaries. */
@@ -6236,8 +6235,8 @@ static enum ia_css_err load_primary_binaries(
 						pipe_out_info->res);
 
 	if (need_extra_yuv_scaler) {
-		struct ia_css_cas_binary_descr cas_scaler_descr
-			= IA_CSS_DEFAULT_CAS_BINARY_DESCR;
+		struct ia_css_cas_binary_descr cas_scaler_descr = { };
+
 		err = ia_css_pipe_create_cas_scaler_desc_single_output(
 			&capt_pp_out_info,
 			pipe_out_info,
@@ -7224,7 +7223,7 @@ load_yuvpp_binaries(struct ia_css_pipe *pipe)
 	struct ia_css_frame_info *vf_pp_in_info[IA_CSS_PIPE_MAX_OUTPUT_STAGE];
 	struct ia_css_yuvpp_settings *mycs;
 	struct ia_css_binary *next_binary;
-	struct ia_css_cas_binary_descr cas_scaler_descr = IA_CSS_DEFAULT_CAS_BINARY_DESCR;
+	struct ia_css_cas_binary_descr cas_scaler_descr = { };
 	unsigned int i, j;
 	bool need_isp_copy_binary = false;
 
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h
index 6c78a15485f6..4fd25ba2cd0d 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h
@@ -52,10 +52,6 @@ struct ia_css_pipe_extra_config {
 	bool disable_vf_pp;
 };
 
-#define DEFAULT_PIPE_EXTRA_CONFIG \
-(struct ia_css_pipe_extra_config) { \
-}
-
 enum ia_css_err
 ia_css_pipe_create_extra(const struct ia_css_pipe_config *config,
 			 const struct ia_css_pipe_extra_config *extra_config,
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h
index 3387e8bafbe7..2ef9238d95ad 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h
@@ -24,10 +24,6 @@ struct sh_css_pc_histogram {
 	unsigned *msink;
 };
 
-#define DEFAULT_PC_HISTOGRAM \
-(struct sh_css_pc_histogram) { \
-}
-
 struct sh_css_binary_metrics {
 	unsigned mode;
 	unsigned id;
@@ -36,12 +32,6 @@ struct sh_css_binary_metrics {
 	struct sh_css_binary_metrics *next;
 };
 
-#define DEFAULT_BINARY_METRICS \
-(struct sh_css_binary_metrics) { \
-	.isp_histogram	= DEFAULT_PC_HISTOGRAM, \
-	.sp_histogram	= DEFAULT_PC_HISTOGRAM, \
-}
-
 struct ia_css_frame_metrics {
 	unsigned num_frames;
 };
-- 
2.15.0

^ permalink raw reply related	[flat|nested] 53+ messages in thread

* Re: [PATCH v2 1/3] media: atomisp: convert default struct values to use compound-literals with designated initializers.
  2017-12-02 20:41                               ` Jeremy Sowden
  2017-12-02 21:34                                 ` Jeremy Sowden
@ 2017-12-03  5:39                                 ` Dan Carpenter
  2017-12-03 10:54                                   ` Jeremy Sowden
  1 sibling, 1 reply; 53+ messages in thread
From: Dan Carpenter @ 2017-12-03  5:39 UTC (permalink / raw)
  To: Jeremy Sowden; +Cc: devel, linux-media

On Sat, Dec 02, 2017 at 08:41:48PM +0000, Jeremy Sowden wrote:
> On 2017-12-02, at 10:35:06 +0000, Jeremy Sowden wrote:
> > On 2017-12-02, at 13:20:09 +0300, Dan Carpenter wrote:
> > > On Fri, Dec 01, 2017 at 05:19:37PM +0000, Jeremy Sowden wrote:
> > > > -#define DEFAULT_PIPE_INFO \
> > > > -{ \
> > > > -	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* output_info */ \
> > > > -	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* vf_output_info */ \
> > > > -	IA_CSS_BINARY_DEFAULT_FRAME_INFO,	/* raw_output_info */ \
> > > > -	{ 0, 0},				/* output system in res */ \
> > > > -	DEFAULT_SHADING_INFO,			/* shading_info */ \
> > > > -	DEFAULT_GRID_INFO,			/* grid_info */ \
> > > > -	0					/* num_invalid_frames */ \
> > > > -}
> > > > +#define DEFAULT_PIPE_INFO ( \
> > >
> > > Why does this have a ( now?  That can't compile can it??
> >
> > It does.
> 
> That was a bit terse: the macros expand to compound-literals, so
> putting parens around them is no different from:
> 
>   #define THREE (3)

Yeah.  Thanks.  I figured it out despite the terseness...  I try review
as fast as I can, so it means you get the stream of conciousness output
that often has mistakes.  Sorry about that.

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH v2 1/3] media: atomisp: convert default struct values to use compound-literals with designated initializers.
  2017-12-03  5:39                                 ` [PATCH v2 1/3] media: atomisp: convert default struct values to use compound-literals with designated initializers Dan Carpenter
@ 2017-12-03 10:54                                   ` Jeremy Sowden
  0 siblings, 0 replies; 53+ messages in thread
From: Jeremy Sowden @ 2017-12-03 10:54 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: devel, linux-media

[-- Attachment #1: Type: text/plain, Size: 1332 bytes --]

On 2017-12-03, at 08:39:21 +0300, Dan Carpenter wrote:
> On Sat, Dec 02, 2017 at 08:41:48PM +0000, Jeremy Sowden wrote:
> > On 2017-12-02, at 10:35:06 +0000, Jeremy Sowden wrote:
> > > On 2017-12-02, at 13:20:09 +0300, Dan Carpenter wrote:
> > > > On Fri, Dec 01, 2017 at 05:19:37PM +0000, Jeremy Sowden wrote:
> > > > > -#define DEFAULT_PIPE_INFO \
> > > > > -{ \
> > > > > -	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* output_info */ \
> > > > > -	{IA_CSS_BINARY_DEFAULT_FRAME_INFO},	/* vf_output_info */ \
> > > > > -	IA_CSS_BINARY_DEFAULT_FRAME_INFO,	/* raw_output_info */ \
> > > > > -	{ 0, 0},				/* output system in res */ \
> > > > > -	DEFAULT_SHADING_INFO,			/* shading_info */ \
> > > > > -	DEFAULT_GRID_INFO,			/* grid_info */ \
> > > > > -	0					/* num_invalid_frames */ \
> > > > > -}
> > > > > +#define DEFAULT_PIPE_INFO ( \
> > > >
> > > > Why does this have a ( now?  That can't compile can it??
> > >
> > > It does.
> >
> > That was a bit terse: the macros expand to compound-literals, so
> > putting parens around them is no different from:
> >
> >   #define THREE (3)
>
> Yeah.  Thanks.  I figured it out despite the terseness...  I try
> review as fast as I can, so it means you get the stream of
> conciousness output that often has mistakes.  Sorry about that.

No worries.  The feedback has been very helpful.

J.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH v4 1/3] media: atomisp: convert default struct values to use compound-literals with designated initializers.
  2017-12-02 22:11                                     ` [PATCH v4 1/3] media: atomisp: convert default struct values to use compound-literals with designated initializers Jeremy Sowden
@ 2017-12-19 12:07                                       ` Sakari Ailus
  2017-12-21 19:31                                         ` Jeremy Sowden
  0 siblings, 1 reply; 53+ messages in thread
From: Sakari Ailus @ 2017-12-19 12:07 UTC (permalink / raw)
  To: Jeremy Sowden; +Cc: linux-media, devel

Hi Jeremy,

On Sat, Dec 02, 2017 at 10:11:59PM +0000, Jeremy Sowden wrote:
> 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.
> 
> Signed-off-by: Jeremy Sowden <jeremy@azazel.net>

I don't think it's useful to change the struct definition macros only to
remove a large number of assigned fields in the next patch. How about
merging the two patches?

Please also start a new thread when re-posting a set.

Thanks.

-- 
Sakari Ailus
e-mail: sakari.ailus@iki.fi

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH v4 3/3] media: atomisp: delete empty default struct values.
  2017-12-02 22:12                                     ` [PATCH v4 3/3] media: atomisp: delete empty default struct values Jeremy Sowden
@ 2017-12-19 12:08                                       ` Sakari Ailus
  0 siblings, 0 replies; 53+ messages in thread
From: Sakari Ailus @ 2017-12-19 12:08 UTC (permalink / raw)
  To: Jeremy Sowden; +Cc: linux-media, devel

On Sat, Dec 02, 2017 at 10:12:01PM +0000, Jeremy Sowden wrote:
> Removing zero-valued struct-members left a number of the default
> struct-values empty.  These values have now been removed.
> 
> Signed-off-by: Jeremy Sowden <jeremy@azazel.net>

This one should be squashed as well.

-- 
Sakari Ailus
e-mail: sakari.ailus@iki.fi

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH v4 1/3] media: atomisp: convert default struct values to use compound-literals with designated initializers.
  2017-12-19 12:07                                       ` Sakari Ailus
@ 2017-12-21 19:31                                         ` Jeremy Sowden
  0 siblings, 0 replies; 53+ messages in thread
From: Jeremy Sowden @ 2017-12-21 19:31 UTC (permalink / raw)
  To: Sakari Ailus; +Cc: linux-media, devel

[-- Attachment #1: Type: text/plain, Size: 992 bytes --]

On 2017-12-19, at 14:07:49 +0200, Sakari Ailus wrote:
> On Sat, Dec 02, 2017 at 10:11:59PM +0000, Jeremy Sowden wrote:
> > 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.
> >
> > Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
>
> I don't think it's useful to change the struct definition macros only
> to remove a large number of assigned fields in the next patch. How
> about merging the two patches?

I squashed all three, as you suggested.

> Please also start a new thread when re-posting a set.

Done.

J.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 53+ messages in thread

end of thread, other threads:[~2017-12-21 19:31 UTC | newest]

Thread overview: 53+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-27 11:30 [PATCH 0/3] Sparse fixes for the Atom ISP Staging Driver Jeremy Sowden
2017-11-27 11:30 ` [PATCH 1/3] media: staging: atomisp: address member of struct ia_css_host_data is a pointer-to-char, so define default as NULL Jeremy Sowden
2017-11-27 11:30 ` [PATCH 2/3] media: staging: atomisp: defined as static some const arrays which don't need external linkage Jeremy Sowden
2017-11-27 12:21   ` Greg KH
2017-11-27 12:44     ` [PATCH v2 0/3] Sparse fixes for the Atom ISP Staging Driver Jeremy Sowden
2017-11-27 12:44       ` [PATCH v2 1/3] media: staging: atomisp: fix for sparse "using plain integer as NULL pointer" warnings Jeremy Sowden
2017-11-28 14:15         ` Dan Carpenter
2017-11-28 23:33           ` Jeremy Sowden
2017-11-29  0:04             ` Dan Carpenter
2017-11-29  8:38               ` Jeremy Sowden
2017-11-29 13:58                 ` Alan Cox
2017-11-30 21:40                 ` [PATCH 0/3] Clean up of data-structure initialization in the CSS API Jeremy Sowden
2017-11-30 21:40                   ` [PATCH 1/3] media: atomisp: convert default struct values to use compound-literals with designated initializers Jeremy Sowden
2017-12-01 15:07                     ` Dan Carpenter
2017-12-01 15:31                       ` Jeremy Sowden
2017-12-01 17:19                       ` [PATCH v2 0/3] media: atomisp: clean up of data-structure initialization in the CSS API Jeremy Sowden
2017-12-01 17:19                         ` [PATCH v2 1/3] media: atomisp: convert default struct values to use compound-literals with designated initializers Jeremy Sowden
2017-12-02 10:20                           ` Dan Carpenter
2017-12-02 10:35                             ` Jeremy Sowden
2017-12-02 20:41                               ` Jeremy Sowden
2017-12-02 21:34                                 ` Jeremy Sowden
2017-12-02 22:11                                   ` [PATCH v4 0/3] media: atomisp: clean up of data-structure initialization in the CSS API Jeremy Sowden
2017-12-02 22:11                                     ` [PATCH v4 1/3] media: atomisp: convert default struct values to use compound-literals with designated initializers Jeremy Sowden
2017-12-19 12:07                                       ` Sakari Ailus
2017-12-21 19:31                                         ` Jeremy Sowden
2017-12-02 22:12                                     ` [PATCH v4 2/3] media: atomisp: delete zero-valued struct members Jeremy Sowden
2017-12-02 22:12                                     ` [PATCH v4 3/3] media: atomisp: delete empty default struct values Jeremy Sowden
2017-12-19 12:08                                       ` Sakari Ailus
2017-12-03  5:39                                 ` [PATCH v2 1/3] media: atomisp: convert default struct values to use compound-literals with designated initializers Dan Carpenter
2017-12-03 10:54                                   ` Jeremy Sowden
2017-12-01 17:19                         ` [PATCH v2 2/3] media: atomisp: delete zero-valued struct members Jeremy Sowden
2017-12-01 17:41                           ` Alan Cox
2017-12-02 15:00                             ` Jeremy Sowden
2017-12-01 17:19                         ` [PATCH v2 3/3] media: atomisp: delete empty default struct values Jeremy Sowden
2017-12-01 21:45                       ` [PATCH v3 0/3] media: atomisp: clean up of data-structure initialization in the CSS API Jeremy Sowden
2017-12-01 21:45                         ` [PATCH v3 1/3] media: atomisp: convert default struct values to use compound-literals with designated initializers Jeremy Sowden
2017-12-01 21:45                         ` [PATCH v3 2/3] media: atomisp: delete zero-valued struct members Jeremy Sowden
2017-12-01 21:45                         ` [PATCH v3 3/3] media: atomisp: delete empty default struct values Jeremy Sowden
2017-11-30 21:40                   ` [PATCH 2/3] media: atomisp: delete zero-valued struct members Jeremy Sowden
2017-11-30 21:40                   ` [PATCH 3/3] media: atomisp: delete empty default struct values Jeremy Sowden
2017-11-27 12:44       ` [PATCH v2 2/3] media: staging: atomisp: fixes for "symbol was not declared. Should it be static?" sparse warnings Jeremy Sowden
2017-11-27 12:44       ` [PATCH v2 3/3] media: staging: atomisp: fixed some checkpatch integer type warnings Jeremy Sowden
2017-11-27 19:09         ` Alan Cox
2017-11-27 22:02           ` Jeremy Sowden
2017-11-28 10:27           ` [PATCH v2 0/3] Sparse fixes for the Atom ISP Staging Driver Jeremy Sowden
2017-11-28 10:27             ` [PATCH v3 1/2] media: staging: atomisp: fix for sparse "using plain integer as NULL pointer" warnings Jeremy Sowden
2017-11-28 10:27             ` [PATCH v3 2/2] media: staging: atomisp: fixes for "symbol was not declared. Should it be static?" sparse warnings Jeremy Sowden
2017-11-29  8:48             ` [PATCH v2 0/3] Sparse fixes for the Atom ISP Staging Driver Sakari Ailus
2017-11-29  9:08     ` [PATCH 2/3] media: staging: atomisp: defined as static some const arrays which don't need external linkage Sakari Ailus
2017-11-29  9:15       ` Greg KH
2017-11-29  9:26         ` Sakari Ailus
2017-11-27 11:30 ` [PATCH 3/3] media: staging: atomisp: prefer s16 to int16_t Jeremy Sowden
2017-11-29  8:47   ` Sakari Ailus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).