driverdev-devel.linuxdriverproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] staging: media: atomisp: code formatting changes
@ 2021-05-01  6:43 Deepak R Varma
  2021-05-01  6:44 ` [PATCH 1/5] staging: media: atomisp: code formatting changes atomisp_csi2.c Deepak R Varma
                   ` (6 more replies)
  0 siblings, 7 replies; 15+ messages in thread
From: Deepak R Varma @ 2021-05-01  6:43 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Sakari Ailus, Greg Kroah-Hartman
  Cc: devel, drv, linux-kernel, linux-media

This patch set overall improves the code organisation and readability of
the files of atomisp drivers. There are several complaints reported by
checkpatch including ERROR and WARNING types on the files under atomisp/pci
directory.

The changes are proposed on a per file basis since there are many
issues to be addressed in each individual file. The patches are built
on the media_tree/for-v5.14-out1 tree/branch. 

Deepak R Varma (5):
  staging: media: atomisp: code formatting changes atomisp_csi2.c
  staging: media: atomisp: code formatting changes sh_css_mipi.c
  staging: media: atomisp: code formatting changes sh_css_params.c
  staging: media: atomisp: code formatting changes sh_css_sp.c
  staging: media: atomisp: code formatting changes sh_css_version.c

 .../staging/media/atomisp/pci/atomisp_csi2.c  |  72 +-
 .../staging/media/atomisp/pci/sh_css_mipi.c   | 170 ++--
 .../staging/media/atomisp/pci/sh_css_params.c | 929 +++++++++---------
 drivers/staging/media/atomisp/pci/sh_css_sp.c | 471 ++++-----
 .../media/atomisp/pci/sh_css_version.c        |   4 +-
 5 files changed, 754 insertions(+), 892 deletions(-)

-- 
2.30.2



_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* [PATCH 1/5] staging: media: atomisp: code formatting changes atomisp_csi2.c
  2021-05-01  6:43 [PATCH 0/5] staging: media: atomisp: code formatting changes Deepak R Varma
@ 2021-05-01  6:44 ` Deepak R Varma
  2021-05-20 19:02   ` [PATCH RESEND " Deepak R Varma
  2021-05-01  6:45 ` [PATCH 2/5] staging: media: atomisp: code formatting changes sh_css_mipi.c Deepak R Varma
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 15+ messages in thread
From: Deepak R Varma @ 2021-05-01  6:44 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Sakari Ailus, Greg Kroah-Hartman
  Cc: devel, drv, linux-kernel, linux-media

Several trivial code reformatting changes done according to the coding
style guidelines. These changes improves code organisation and readability
and also 4 address many chackpatch error, warning and check complaints.

Signed-off-by: Deepak R Varma <drv@mailo.com>
---
 .../staging/media/atomisp/pci/atomisp_csi2.c  | 72 +++++++++----------
 1 file changed, 35 insertions(+), 37 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp_csi2.c b/drivers/staging/media/atomisp/pci/atomisp_csi2.c
index 060b8765ae96..f33a08b2564f 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_csi2.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_csi2.c
@@ -22,14 +22,12 @@
 #include "atomisp_internal.h"
 #include "atomisp-regs.h"
 
-static struct v4l2_mbus_framefmt *__csi2_get_format(struct
-	atomisp_mipi_csi2_device
-	* csi2,
-	struct
-	v4l2_subdev_pad_config *cfg,
-	enum
-	v4l2_subdev_format_whence
-	which, unsigned int pad) {
+static struct
+v4l2_mbus_framefmt *__csi2_get_format(struct atomisp_mipi_csi2_device *csi2,
+				      struct v4l2_subdev_pad_config *cfg,
+				      enum v4l2_subdev_format_whence which,
+				      unsigned int pad)
+{
 	if (which == V4L2_SUBDEV_FORMAT_TRY)
 		return v4l2_subdev_get_try_format(&csi2->subdev, cfg, pad);
 	else
@@ -42,7 +40,7 @@ static struct v4l2_mbus_framefmt *__csi2_get_format(struct
  * @fh     : V4L2 subdev file handle
  * @code   : pointer to v4l2_subdev_pad_mbus_code_enum structure
  * return -EINVAL or zero on success
-*/
+ */
 static int csi2_enum_mbus_code(struct v4l2_subdev *sd,
 			       struct v4l2_subdev_pad_config *cfg,
 			       struct v4l2_subdev_mbus_code_enum *code)
@@ -68,7 +66,7 @@ static int csi2_enum_mbus_code(struct v4l2_subdev *sd,
  * @pad: pad num
  * @fmt: pointer to v4l2 format structure
  * return -EINVAL or zero on success
-*/
+ */
 static int csi2_get_format(struct v4l2_subdev *sd,
 			   struct v4l2_subdev_pad_config *cfg,
 			   struct v4l2_subdev_format *fmt)
@@ -101,12 +99,12 @@ int atomisp_csi2_set_ffmt(struct v4l2_subdev *sd,
 		else
 			actual_ffmt->code = atomisp_in_fmt_conv[0].code;
 
-		actual_ffmt->width = clamp_t(
-					 u32, ffmt->width, ATOM_ISP_MIN_WIDTH,
-					 ATOM_ISP_MAX_WIDTH);
-		actual_ffmt->height = clamp_t(
-					  u32, ffmt->height, ATOM_ISP_MIN_HEIGHT,
-					  ATOM_ISP_MAX_HEIGHT);
+		actual_ffmt->width = clamp_t(u32, ffmt->width,
+					     ATOM_ISP_MIN_WIDTH,
+					     ATOM_ISP_MAX_WIDTH);
+		actual_ffmt->height = clamp_t(u32, ffmt->height,
+					      ATOM_ISP_MIN_HEIGHT,
+					      ATOM_ISP_MAX_HEIGHT);
 
 		tmp_ffmt = *ffmt = *actual_ffmt;
 
@@ -127,7 +125,7 @@ int atomisp_csi2_set_ffmt(struct v4l2_subdev *sd,
  * @pad: pad num
  * @fmt: pointer to v4l2 format structure
  * return -EINVAL or zero on success
-*/
+ */
 static int csi2_set_format(struct v4l2_subdev *sd,
 			   struct v4l2_subdev_pad_config *cfg,
 			   struct v4l2_subdev_format *fmt)
@@ -142,7 +140,7 @@ static int csi2_set_format(struct v4l2_subdev *sd,
  * @enable: Enable/disable stream (1/0)
  *
  * Return 0 on success or a negative error code otherwise.
-*/
+ */
 static int csi2_set_stream(struct v4l2_subdev *sd, int enable)
 {
 	return 0;
@@ -179,7 +177,7 @@ static const struct v4l2_subdev_ops csi2_ops = {
  * @remote : Pointer to remote pad array
  * @flags  : Link flags
  * return -EINVAL or zero on success
-*/
+ */
 static int csi2_link_setup(struct media_entity *entity,
 			   const struct media_pad *local,
 			   const struct media_pad *remote, u32 flags)
@@ -217,10 +215,10 @@ static const struct media_entity_operations csi2_media_ops = {
 };
 
 /*
-* ispcsi2_init_entities - Initialize subdev and media entity.
-* @csi2: Pointer to ispcsi2 structure.
-* return -ENOMEM or zero on success
-*/
+ * ispcsi2_init_entities - Initialize subdev and media entity.
+ * @csi2: Pointer to ispcsi2 structure.
+ * return -ENOMEM or zero on success
+ */
 static int mipi_csi2_init_entities(struct atomisp_mipi_csi2_device *csi2,
 				   int port)
 {
@@ -244,9 +242,8 @@ static int mipi_csi2_init_entities(struct atomisp_mipi_csi2_device *csi2,
 	if (ret < 0)
 		return ret;
 
-	csi2->formats[CSI2_PAD_SINK].code =
-	    csi2->formats[CSI2_PAD_SOURCE].code =
-		atomisp_in_fmt_conv[0].code;
+	csi2->formats[CSI2_PAD_SINK].code = atomisp_in_fmt_conv[0].code;
+	csi2->formats[CSI2_PAD_SOURCE].code = atomisp_in_fmt_conv[0].code;
 
 	return 0;
 }
@@ -374,21 +371,22 @@ static void atomisp_csi2_configure_isp2401(struct atomisp_sub_device *asd)
 	    (isp->inputs[asd->input_curr].camera->ctrl_handler, &ctrl) == 0)
 		mipi_freq = ctrl.value;
 
-	clk_termen = atomisp_csi2_configure_calc(coeff_clk_termen,
-		     mipi_freq, TERMEN_DEFAULT);
-	clk_settle = atomisp_csi2_configure_calc(coeff_clk_settle,
-		     mipi_freq, SETTLE_DEFAULT);
-	dat_termen = atomisp_csi2_configure_calc(coeff_dat_termen,
-		     mipi_freq, TERMEN_DEFAULT);
-	dat_settle = atomisp_csi2_configure_calc(coeff_dat_settle,
-		     mipi_freq, SETTLE_DEFAULT);
+	clk_termen = atomisp_csi2_configure_calc(coeff_clk_termen, mipi_freq,
+						 TERMEN_DEFAULT);
+	clk_settle = atomisp_csi2_configure_calc(coeff_clk_settle, mipi_freq,
+						 SETTLE_DEFAULT);
+	dat_termen = atomisp_csi2_configure_calc(coeff_dat_termen, mipi_freq,
+						 TERMEN_DEFAULT);
+	dat_settle = atomisp_csi2_configure_calc(coeff_dat_settle, mipi_freq,
+						 SETTLE_DEFAULT);
+
 	for (n = 0; n < csi2_port_lanes[port] + 1; n++) {
 		hrt_address base = csi2_port_base[port] + csi2_lane_base[n];
 
 		atomisp_css2_hw_store_32(base + CSI2_REG_RX_CSI_DLY_CNT_TERMEN,
-				     n == 0 ? clk_termen : dat_termen);
+					 n == 0 ? clk_termen : dat_termen);
 		atomisp_css2_hw_store_32(base + CSI2_REG_RX_CSI_DLY_CNT_SETTLE,
-				     n == 0 ? clk_settle : dat_settle);
+					 n == 0 ? clk_settle : dat_settle);
 	}
 }
 
@@ -400,7 +398,7 @@ void atomisp_csi2_configure(struct atomisp_sub_device *asd)
 
 /*
  * atomisp_mipi_csi2_cleanup - Routine for module driver cleanup
-*/
+ */
 void atomisp_mipi_csi2_cleanup(struct atomisp_device *isp)
 {
 }
-- 
2.30.2



_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* [PATCH 2/5] staging: media: atomisp: code formatting changes sh_css_mipi.c
  2021-05-01  6:43 [PATCH 0/5] staging: media: atomisp: code formatting changes Deepak R Varma
  2021-05-01  6:44 ` [PATCH 1/5] staging: media: atomisp: code formatting changes atomisp_csi2.c Deepak R Varma
@ 2021-05-01  6:45 ` Deepak R Varma
  2021-05-20 19:03   ` [PATCH RESEND " Deepak R Varma
  2021-05-01  6:46 ` [PATCH 3/5] staging: media: atomisp: code formatting changes sh_css_params.c Deepak R Varma
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 15+ messages in thread
From: Deepak R Varma @ 2021-05-01  6:45 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Sakari Ailus, Greg Kroah-Hartman
  Cc: devel, drv, linux-kernel, linux-media

Several trivial code reformatting changes done according to the coding
style guidelines. These code changes overall improve code organisation
and readability and also address many chackpatch error, warning and
check complaints.

Signed-off-by: Deepak R Varma <drv@mailo.com>
---
 .../staging/media/atomisp/pci/sh_css_mipi.c   | 170 ++++++++----------
 1 file changed, 76 insertions(+), 94 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/sh_css_mipi.c b/drivers/staging/media/atomisp/pci/sh_css_mipi.c
index 3f34cc81be87..1ae6c07d4199 100644
--- a/drivers/staging/media/atomisp/pci/sh_css_mipi.c
+++ b/drivers/staging/media/atomisp/pci/sh_css_mipi.c
@@ -37,7 +37,7 @@ ref_count_mipi_allocation[N_CSI_PORTS]; /* Initialized in mipi_init */
  * Check if a source port or TPG/PRBS ID is valid
  */
 static bool ia_css_mipi_is_source_port_valid(struct ia_css_pipe *pipe,
-	unsigned int *pport)
+					     unsigned int *pport)
 {
 	bool ret = true;
 	unsigned int port = 0;
@@ -74,7 +74,8 @@ static bool ia_css_mipi_is_source_port_valid(struct ia_css_pipe *pipe,
 	return ret;
 }
 
-/* Assumptions:
+/*
+ * Assumptions:
  *	- A line is multiple of 4 bytes = 1 word.
  *	- Each frame has SOF and EOF (each 1 word).
  *	- Each line has format header and optionally SOL and EOL (each 1 word).
@@ -91,7 +92,8 @@ ia_css_mipi_frame_calculate_size(const unsigned int width,
 				 const enum atomisp_input_format format,
 				 const bool hasSOLandEOL,
 				 const unsigned int embedded_data_size_words,
-				 unsigned int *size_mem_words) {
+				 unsigned int *size_mem_words)
+{
 	int err = 0;
 
 	unsigned int bits_per_pixel = 0;
@@ -108,7 +110,8 @@ ia_css_mipi_frame_calculate_size(const unsigned int width,
 	unsigned int width_padded = width;
 
 #if defined(ISP2401)
-	/* The changes will be reverted as soon as RAW
+	/*
+	 * The changes will be reverted as soon as RAW
 	 * Buffers are deployed by the 2401 Input System
 	 * in the non-continuous use scenario.
 	 */
@@ -118,8 +121,7 @@ ia_css_mipi_frame_calculate_size(const unsigned int width,
 	IA_CSS_ENTER("padded_width=%d, height=%d, format=%d, hasSOLandEOL=%d, embedded_data_size_words=%d\n",
 		     width_padded, height, format, hasSOLandEOL, embedded_data_size_words);
 
-	switch (format)
-	{
+	switch (format) {
 	case ATOMISP_INPUT_FORMAT_RAW_6:		/* 4p, 3B, 24bits */
 		bits_per_pixel = 6;
 		break;
@@ -134,7 +136,8 @@ ia_css_mipi_frame_calculate_size(const unsigned int width,
 	case ATOMISP_INPUT_FORMAT_YUV420_10:		/* odd 4p, 5B, 40bits, even 4p, 10B, 80bits */
 	case ATOMISP_INPUT_FORMAT_RAW_10:		/* 4p, 5B, 40bits */
 #if !defined(HAS_NO_PACKED_RAW_PIXELS)
-		/* The changes will be reverted as soon as RAW
+		/*
+		 * The changes will be reverted as soon as RAW
 		 * Buffers are deployed by the 2401 Input System
 		 * in the non-continuous use scenario.
 		 */
@@ -176,33 +179,29 @@ ia_css_mipi_frame_calculate_size(const unsigned int width,
 	odd_line_bytes = (width_padded * bits_per_pixel + 7) >> 3; /* ceil ( bits per line / 8) */
 
 	/* Even lines for YUV420 formats are double in bits_per_pixel. */
-	if (format == ATOMISP_INPUT_FORMAT_YUV420_8
-	    || format == ATOMISP_INPUT_FORMAT_YUV420_10
-	    || format == ATOMISP_INPUT_FORMAT_YUV420_16)
-	{
-		even_line_bytes = (width_padded * 2 * bits_per_pixel + 7) >>
-			3; /* ceil ( bits per line / 8) */
-	} else
-	{
+	if (format == ATOMISP_INPUT_FORMAT_YUV420_8  ||
+	    format == ATOMISP_INPUT_FORMAT_YUV420_10 ||
+	    format == ATOMISP_INPUT_FORMAT_YUV420_16)
+		even_line_bytes = (width_padded * 2 * bits_per_pixel + 7) >> 3; /* ceil ( bits per line / 8) */
+	else
 		even_line_bytes = odd_line_bytes;
-	}
 
 	/*  a frame represented in memory:  ()- optional; data - payload words.
-	*  addr		0	1	2	3	4	5	6	7:
-	*  first	SOF	(SOL)	PACK_H	data	data	data	data	data
-	*		data	data	data	data	data	data	data	data
-	*		...
-	*		data	data	0	0	0	0	0	0
-	*  second	(EOL)	(SOL)	PACK_H	data	data	data	data	data
-	*		data	data	data	data	data	data	data	data
-	*		...
-	*		data	data	0	0	0	0	0	0
-	*  ...
-	*  last		(EOL)	EOF	0	0	0	0	0	0
-	*
-	*  Embedded lines are regular lines stored before the first and after
-	*  payload lines.
-	*/
+	 *  addr		0	1	2	3	4	5	6	7:
+	 *  first	SOF	(SOL)	PACK_H	data	data	data	data	data
+	 *		data	data	data	data	data	data	data	data
+	 *		...
+	 *		data	data	0	0	0	0	0	0
+	 *  second	(EOL)	(SOL)	PACK_H	data	data	data	data	data
+	 *		data	data	data	data	data	data	data	data
+	 *		...
+	 *		data	data	0	0	0	0	0	0
+	 *  ...
+	 *  last		(EOL)	EOF	0	0	0	0	0	0
+	 *
+	 *  Embedded lines are regular lines stored before the first and after
+	 *  payload lines.
+	 */
 
 	words_per_odd_line = (odd_line_bytes + 3) >> 2;
 	/* ceil(odd_line_bytes/4); word = 4 bytes */
@@ -220,11 +219,11 @@ ia_css_mipi_frame_calculate_size(const unsigned int width,
 	mem_words_for_EOF        = 1; /* last line consisit of the optional (EOL) and EOF */
 
 	mem_words = ((embedded_data_size_words + 7) >> 3) +
-	mem_words_for_first_line +
-	(((height + 1) >> 1) - 1) * mem_words_per_odd_line +
-	/* ceil (height/2) - 1 (first line is calculated separatelly) */
-	(height      >> 1) * mem_words_per_even_line + /* floor(height/2) */
-	mem_words_for_EOF;
+		      mem_words_for_first_line +
+		      (((height + 1) >> 1) - 1) * mem_words_per_odd_line +
+		      /* ceil (height/2) - 1 (first line is calculated separatelly) */
+		      (height >> 1) * mem_words_per_even_line + /* floor(height/2) */
+		      mem_words_for_EOF;
 
 	*size_mem_words = mem_words; /* ceil(words/8); mem word is 32B = 8words. */
 	/* Check if the above is still needed. */
@@ -236,7 +235,8 @@ ia_css_mipi_frame_calculate_size(const unsigned int width,
 #if !defined(ISP2401)
 int
 ia_css_mipi_frame_enable_check_on_size(const enum mipi_port_id port,
-				       const unsigned int	size_mem_words) {
+				       const unsigned int size_mem_words)
+{
 	u32 idx;
 
 	int err = -EBUSY;
@@ -245,12 +245,10 @@ ia_css_mipi_frame_enable_check_on_size(const enum mipi_port_id port,
 	OP___assert(size_mem_words != 0);
 
 	for (idx = 0; idx < IA_CSS_MIPI_SIZE_CHECK_MAX_NOF_ENTRIES_PER_PORT &&
-	     my_css.mipi_sizes_for_check[port][idx] != 0;
-	     idx++)   /* do nothing */
-	{
-	}
-	if (idx < IA_CSS_MIPI_SIZE_CHECK_MAX_NOF_ENTRIES_PER_PORT)
-	{
+	     my_css.mipi_sizes_for_check[port][idx] != 0;)
+		idx++;
+
+	if (idx < IA_CSS_MIPI_SIZE_CHECK_MAX_NOF_ENTRIES_PER_PORT) {
 		my_css.mipi_sizes_for_check[port][idx] = size_mem_words;
 		err = 0;
 	}
@@ -268,10 +266,9 @@ mipi_init(void)
 		ref_count_mipi_allocation[i] = 0;
 }
 
-int
-calculate_mipi_buff_size(
-    struct ia_css_stream_config *stream_cfg,
-    unsigned int *size_mem_words) {
+int calculate_mipi_buff_size(struct ia_css_stream_config *stream_cfg,
+			     unsigned int *size_mem_words)
+{
 #if !defined(ISP2401)
 	int err = -EINVAL;
 	(void)stream_cfg;
@@ -345,15 +342,11 @@ calculate_mipi_buff_size(
 	odd_line_bytes = (width_padded * bits_per_pixel + 7) >> 3; /* ceil ( bits per line / 8) */
 
 	/* Even lines for YUV420 formats are double in bits_per_pixel. */
-	if (format == ATOMISP_INPUT_FORMAT_YUV420_8
-	    || format == ATOMISP_INPUT_FORMAT_YUV420_10)
-	{
-		even_line_bytes = (width_padded * 2 * bits_per_pixel + 7) >>
-			3; /* ceil ( bits per line / 8) */
-	} else
-	{
+	if (format == ATOMISP_INPUT_FORMAT_YUV420_8 ||
+	    format == ATOMISP_INPUT_FORMAT_YUV420_10)
+		even_line_bytes = (width_padded * 2 * bits_per_pixel + 7) >> 3; /* ceil ( bits per line / 8) */
+	else
 		even_line_bytes = odd_line_bytes;
-	}
 
 	words_per_odd_line	 = (odd_line_bytes   + 3) >> 2;
 	/* ceil(odd_line_bytes/4); word = 4 bytes */
@@ -392,8 +385,8 @@ static bool buffers_needed(struct ia_css_pipe *pipe)
 }
 
 int
-allocate_mipi_frames(struct ia_css_pipe *pipe,
-		     struct ia_css_stream_info *info) {
+allocate_mipi_frames(struct ia_css_pipe *pipe, struct ia_css_stream_info *info)
+{
 	int err = -EINVAL;
 	unsigned int port;
 
@@ -402,8 +395,7 @@ allocate_mipi_frames(struct ia_css_pipe *pipe,
 
 	assert(pipe);
 	assert(pipe->stream);
-	if ((!pipe) || (!pipe->stream))
-	{
+	if (!pipe || !pipe->stream) {
 		ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE,
 				    "allocate_mipi_frames(%p) exit: pipe or stream is null.\n",
 				    pipe);
@@ -411,8 +403,7 @@ allocate_mipi_frames(struct ia_css_pipe *pipe,
 	}
 
 #ifdef ISP2401
-	if (pipe->stream->config.online)
-	{
+	if (pipe->stream->config.online) {
 		ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE,
 				    "allocate_mipi_frames(%p) exit: no buffers needed for 2401 pipe mode.\n",
 				    pipe);
@@ -443,27 +434,25 @@ allocate_mipi_frames(struct ia_css_pipe *pipe,
 	}
 
 #ifdef ISP2401
-	err = calculate_mipi_buff_size(
-	    &pipe->stream->config,
-	    &my_css.mipi_frame_size[port]);
+	err = calculate_mipi_buff_size(&pipe->stream->config,
+				       &my_css.mipi_frame_size[port]);
 #endif
 
 #if !defined(ISP2401)
-	if (ref_count_mipi_allocation[port] != 0)
-	{
+	if (ref_count_mipi_allocation[port] != 0) {
 		ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE,
 				    "allocate_mipi_frames(%p) exit: already allocated for this port (port=%d).\n",
 				    pipe, port);
 		return 0;
 	}
 #else
-	/* 2401 system allows multiple streams to use same physical port. This is not
+	/*
+	 * 2401 system allows multiple streams to use same physical port. This is not
 	 * true for 2400 system. Currently 2401 uses MIPI buffers as a temporary solution.
 	 * TODO AM: Once that is changed (removed) this code should be removed as well.
 	 * In that case only 2400 related code should remain.
 	 */
-	if (ref_count_mipi_allocation[port] != 0)
-	{
+	if (ref_count_mipi_allocation[port] != 0) {
 		ref_count_mipi_allocation[port]++;
 		ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE,
 				    "allocate_mipi_frames(%p) leave: nothing to do, already allocated for this port (port=%d).\n",
@@ -481,8 +470,7 @@ allocate_mipi_frames(struct ia_css_pipe *pipe,
 	{ /* limit the scope of i,j */
 		unsigned int i, j;
 
-		for (i = 0; i < my_css.num_mipi_frames[port]; i++)
-		{
+		for (i = 0; i < my_css.num_mipi_frames[port]; i++) {
 			/* free previous frame */
 			if (my_css.mipi_frames[port][i]) {
 				ia_css_frame_free(my_css.mipi_frames[port][i]);
@@ -534,8 +522,8 @@ allocate_mipi_frames(struct ia_css_pipe *pipe,
 	return err;
 }
 
-int
-free_mipi_frames(struct ia_css_pipe *pipe) {
+int free_mipi_frames(struct ia_css_pipe *pipe)
+{
 	int err = -EINVAL;
 	unsigned int port;
 
@@ -543,8 +531,7 @@ free_mipi_frames(struct ia_css_pipe *pipe) {
 			    "free_mipi_frames(%p) enter:\n", pipe);
 
 	/* assert(pipe != NULL); TEMP: TODO: Should be assert only. */
-	if (pipe)
-	{
+	if (pipe) {
 		assert(pipe->stream);
 		if ((!pipe) || (!pipe->stream)) {
 			ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE,
@@ -606,10 +593,10 @@ free_mipi_frames(struct ia_css_pipe *pipe) {
 
 				ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE,
 						    "free_mipi_frames(%p) exit (deallocated).\n", pipe);
-			}
+			} else {
 #if defined(ISP2401)
-			else {
-				/* 2401 system allows multiple streams to use same physical port. This is not
+				/*
+				 * 2401 system allows multiple streams to use same physical port. This is not
 				 * true for 2400 system. Currently 2401 uses MIPI buffers as a temporary solution.
 				 * TODO AM: Once that is changed (removed) this code should be removed as well.
 				 * In that case only 2400 related code should remain.
@@ -617,11 +604,10 @@ free_mipi_frames(struct ia_css_pipe *pipe) {
 				ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE,
 						    "free_mipi_frames(%p) leave: nothing to do, other streams still use this port (port=%d).\n",
 						    pipe, port);
-			}
 #endif
+			}
 		}
-	} else   /* pipe ==NULL */
-	{
+	} else { /* pipe ==NULL */
 		/* AM TEMP: free-ing all mipi buffers just like a legacy code. */
 		for (port = CSI_PORT0_ID; port < N_CSI_PORTS; port++) {
 			unsigned int i;
@@ -644,8 +630,8 @@ free_mipi_frames(struct ia_css_pipe *pipe) {
 	return 0;
 }
 
-int
-send_mipi_frames(struct ia_css_pipe *pipe) {
+int send_mipi_frames(struct ia_css_pipe *pipe)
+{
 	int err = -EINVAL;
 	unsigned int i;
 #ifndef ISP2401
@@ -658,8 +644,7 @@ send_mipi_frames(struct ia_css_pipe *pipe) {
 
 	assert(pipe);
 	assert(pipe->stream);
-	if (!pipe || !pipe->stream)
-	{
+	if (!pipe || !pipe->stream) {
 		IA_CSS_ERROR("pipe or stream is null");
 		return -EINVAL;
 	}
@@ -686,8 +671,7 @@ send_mipi_frames(struct ia_css_pipe *pipe) {
 	}
 
 	/* Hand-over the SP-internal mipi buffers */
-	for (i = 0; i < my_css.num_mipi_frames[port]; i++)
-	{
+	for (i = 0; i < my_css.num_mipi_frames[port]; i++) {
 		/* Need to include the ofset for port. */
 		sh_css_update_host2sp_mipi_frame(port * NUM_MIPI_FRAMES_PER_STREAM + i,
 						 my_css.mipi_frames[port][i]);
@@ -700,18 +684,16 @@ send_mipi_frames(struct ia_css_pipe *pipe) {
 	 * Send an event to inform the SP
 	 * that all MIPI frames are passed.
 	 **********************************/
-	if (!sh_css_sp_is_running())
-	{
+	if (!sh_css_sp_is_running()) {
 		/* SP is not running. The queues are not valid */
 		IA_CSS_ERROR("sp is not running");
 		return err;
 	}
 
-	ia_css_bufq_enqueue_psys_event(
-	    IA_CSS_PSYS_SW_EVENT_MIPI_BUFFERS_READY,
-	    (uint8_t)port,
-	    (uint8_t)my_css.num_mipi_frames[port],
-	    0 /* not used */);
+	ia_css_bufq_enqueue_psys_event(IA_CSS_PSYS_SW_EVENT_MIPI_BUFFERS_READY,
+				       (uint8_t)port,
+				       (uint8_t)my_css.num_mipi_frames[port],
+				       0 /* not used */);
 	IA_CSS_LEAVE_ERR_PRIVATE(0);
 	return 0;
 }
-- 
2.30.2



_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* [PATCH 3/5] staging: media: atomisp: code formatting changes sh_css_params.c
  2021-05-01  6:43 [PATCH 0/5] staging: media: atomisp: code formatting changes Deepak R Varma
  2021-05-01  6:44 ` [PATCH 1/5] staging: media: atomisp: code formatting changes atomisp_csi2.c Deepak R Varma
  2021-05-01  6:45 ` [PATCH 2/5] staging: media: atomisp: code formatting changes sh_css_mipi.c Deepak R Varma
@ 2021-05-01  6:46 ` Deepak R Varma
  2021-05-20 19:04   ` [PATCH RESEND " Deepak R Varma
  2021-05-21 10:52   ` [PATCH " Dan Carpenter
  2021-05-01  6:47 ` [PATCH 4/5] staging: media: atomisp: code formatting changes sh_css_sp.c Deepak R Varma
                   ` (3 subsequent siblings)
  6 siblings, 2 replies; 15+ messages in thread
From: Deepak R Varma @ 2021-05-01  6:46 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Sakari Ailus, Greg Kroah-Hartman
  Cc: devel, drv, linux-kernel, linux-media

Several trivial code reformatting changes done according to the coding
style guidelines. These code changes overall improve code organisation
and readability and also address many chackpatch error, warning and
check complaints.

Signed-off-by: Deepak R Varma <drv@mailo.com>
---
 .../staging/media/atomisp/pci/sh_css_params.c | 929 +++++++++---------
 1 file changed, 438 insertions(+), 491 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/sh_css_params.c b/drivers/staging/media/atomisp/pci/sh_css_params.c
index 644e14575987..cbb593580dc8 100644
--- a/drivers/staging/media/atomisp/pci/sh_css_params.c
+++ b/drivers/staging/media/atomisp/pci/sh_css_params.c
@@ -120,8 +120,10 @@
 	(SH_CSS_MORPH_TABLE_ELEM_BYTES * (binary)->morph_tbl_aligned_width * \
 	 (binary)->morph_tbl_height)
 
-/* We keep a second copy of the ptr struct for the SP to access.
-   Again, this would not be necessary on the chip. */
+/*
+ * We keep a second copy of the ptr struct for the SP to access.
+ * Again, this would not be necessary on the chip.
+ */
 static ia_css_ptr sp_ddr_ptrs;
 
 /* sp group address on DDR */
@@ -667,7 +669,6 @@ static const struct ia_css_dz_config default_dz_config = {
 	HRT_GDC_N,
 	HRT_GDC_N,
 	{
-		\
 		{0, 0}, \
 		{0, 0}, \
 	}
@@ -690,27 +691,23 @@ struct ia_css_isp_skc_dvs_statistics {
 	ia_css_ptr p_data;
 };
 
-static int
-ref_sh_css_ddr_address_map(
-    struct sh_css_ddr_address_map *map,
-    struct sh_css_ddr_address_map *out);
+static int ref_sh_css_ddr_address_map(struct sh_css_ddr_address_map *map,
+				      struct sh_css_ddr_address_map *out);
 
-static int
-write_ia_css_isp_parameter_set_info_to_ddr(
-    struct ia_css_isp_parameter_set_info *me,
-    ia_css_ptr *out);
+static int write_ia_css_isp_parameter_set_info_to_ddr(
+		struct ia_css_isp_parameter_set_info *me,
+		ia_css_ptr *out);
 
 static int
 free_ia_css_isp_parameter_set_info(ia_css_ptr ptr);
 
-static int
-sh_css_params_write_to_ddr_internal(
-    struct ia_css_pipe *pipe,
-    unsigned int pipe_id,
-    struct ia_css_isp_parameters *params,
-    const struct ia_css_pipeline_stage *stage,
-    struct sh_css_ddr_address_map *ddr_map,
-    struct sh_css_ddr_address_map_size *ddr_map_size);
+static int sh_css_params_write_to_ddr_internal(
+		struct ia_css_pipe *pipe,
+		unsigned int pipe_id,
+		struct ia_css_isp_parameters *params,
+		const struct ia_css_pipeline_stage *stage,
+		struct sh_css_ddr_address_map *ddr_map,
+		struct sh_css_ddr_address_map_size *ddr_map_size);
 
 static int
 sh_css_create_isp_params(struct ia_css_stream *stream,
@@ -729,34 +726,30 @@ sh_css_init_isp_params_from_config(struct ia_css_pipe *pipe,
 				   struct ia_css_pipe *pipe_in);
 
 static int
-sh_css_set_global_isp_config_on_pipe(
-    struct ia_css_pipe *curr_pipe,
-    const struct ia_css_isp_config *config,
-    struct ia_css_pipe *pipe);
+sh_css_set_global_isp_config_on_pipe(struct ia_css_pipe *curr_pipe,
+				     const struct ia_css_isp_config *config,
+				     struct ia_css_pipe *pipe);
 
 #if defined(SH_CSS_ENABLE_PER_FRAME_PARAMS)
-static int
-sh_css_set_per_frame_isp_config_on_pipe(
-    struct ia_css_stream *stream,
-    const struct ia_css_isp_config *config,
-    struct ia_css_pipe *pipe);
+static int sh_css_set_per_frame_isp_config_on_pipe(
+		struct ia_css_stream *stream,
+		const struct ia_css_isp_config *config,
+		struct ia_css_pipe *pipe);
 #endif
 
-static int
-sh_css_update_uds_and_crop_info_based_on_zoom_region(
-    const struct ia_css_binary_info *info,
-    const struct ia_css_frame_info *in_frame_info,
-    const struct ia_css_frame_info *out_frame_info,
-    const struct ia_css_resolution *dvs_env,
-    const struct ia_css_dz_config *zoom,
-    const struct ia_css_vector *motion_vector,
-    struct sh_css_uds_info *uds,		/* out */
-    struct sh_css_crop_pos *sp_out_crop_pos,	/* out */
-    struct ia_css_resolution pipe_in_res,
-    bool enable_zoom);
-
-ia_css_ptr
-sh_css_params_ddr_address_map(void)
+static int sh_css_update_uds_and_crop_info_based_on_zoom_region(
+		const struct ia_css_binary_info *info,
+		const struct ia_css_frame_info *in_frame_info,
+		const struct ia_css_frame_info *out_frame_info,
+		const struct ia_css_resolution *dvs_env,
+		const struct ia_css_dz_config *zoom,
+		const struct ia_css_vector *motion_vector,
+		struct sh_css_uds_info *uds,		/* out */
+		struct sh_css_crop_pos *sp_out_crop_pos,	/* out */
+		struct ia_css_resolution pipe_in_res,
+		bool enable_zoom);
+
+ia_css_ptr sh_css_params_ddr_address_map(void)
 {
 	return sp_ddr_ptrs;
 }
@@ -813,15 +806,15 @@ convert_allocate_fpntbl(struct ia_css_isp_parameters *params)
 }
 
 static int
-store_fpntbl(struct ia_css_isp_parameters *params, ia_css_ptr ptr) {
+store_fpntbl(struct ia_css_isp_parameters *params, ia_css_ptr ptr)
+{
 	struct ia_css_host_data *isp_data;
 
 	assert(params);
 	assert(ptr != mmgr_NULL);
 
 	isp_data = convert_allocate_fpntbl(params);
-	if (!isp_data)
-	{
+	if (!isp_data) {
 		IA_CSS_LEAVE_ERR_PRIVATE(-ENOMEM);
 		return -ENOMEM;
 	}
@@ -886,7 +879,8 @@ ia_css_process_kernel(struct ia_css_stream *stream,
 
 		/* update the other buffers to the pipe specific copies */
 		for (stage = pipeline->stages; stage; stage = stage->next) {
-			if (!stage || !stage->binary) continue;
+			if (!stage || !stage->binary)
+				continue;
 			process(pipeline->pipe_id, stage, params);
 		}
 	}
@@ -894,7 +888,8 @@ ia_css_process_kernel(struct ia_css_stream *stream,
 
 static int
 sh_css_select_dp_10bpp_config(const struct ia_css_pipe *pipe,
-			      bool *is_dp_10bpp) {
+			      bool *is_dp_10bpp)
+{
 	int err = 0;
 	/* Currently we check if 10bpp DPC configuration is required based
 	 * on the use case,i.e. if BDS and DPC is both enabled. The more cleaner
@@ -903,12 +898,10 @@ sh_css_select_dp_10bpp_config(const struct ia_css_pipe *pipe,
 	 * implementation. (This is because the configuration is set before a
 	 * binary is selected, and the binary info is not available)
 	 */
-	if ((!pipe) || (!is_dp_10bpp))
-	{
+	if (!pipe || !is_dp_10bpp) {
 		IA_CSS_LEAVE_ERR_PRIVATE(-EINVAL);
 		err = -EINVAL;
-	} else
-	{
+	} else {
 		*is_dp_10bpp = false;
 
 		/* check if DPC is enabled from the host */
@@ -936,7 +929,8 @@ sh_css_select_dp_10bpp_config(const struct ia_css_pipe *pipe,
 
 int
 sh_css_set_black_frame(struct ia_css_stream *stream,
-		       const struct ia_css_frame *raw_black_frame) {
+		       const struct ia_css_frame *raw_black_frame)
+{
 	struct ia_css_isp_parameters *params;
 	/* this function desperately needs to be moved to the ISP or SP such
 	 * that it can use the DMA.
@@ -957,13 +951,11 @@ sh_css_set_black_frame(struct ia_css_stream *stream,
 	IA_CSS_ENTER_PRIVATE("black_frame=%p", raw_black_frame);
 
 	if (params->fpn_config.data &&
-	    (params->fpn_config.width != width || params->fpn_config.height != height))
-	{
+	    (params->fpn_config.width != width || params->fpn_config.height != height)) {
 		kvfree(params->fpn_config.data);
 		params->fpn_config.data = NULL;
 	}
-	if (!params->fpn_config.data)
-	{
+	if (!params->fpn_config.data) {
 		params->fpn_config.data = kvmalloc(height * width *
 						   sizeof(short), GFP_KERNEL);
 		if (!params->fpn_config.data) {
@@ -977,8 +969,7 @@ sh_css_set_black_frame(struct ia_css_stream *stream,
 	}
 
 	/* store raw to fpntbl */
-	for (y = 0; y < height; y++)
-	{
+	for (y = 0; y < height; y++) {
 		for (x = 0; x < width; x += (ISP_VEC_NELEMS * 2)) {
 			int ofs = y * width + x;
 
@@ -1071,10 +1062,8 @@ sh_css_set_shading_table(struct ia_css_stream *stream,
 	IA_CSS_LEAVE_PRIVATE("void");
 }
 
-void
-ia_css_params_store_ia_css_host_data(
-    ia_css_ptr ddr_addr,
-    struct ia_css_host_data *data)
+void ia_css_params_store_ia_css_host_data(ia_css_ptr ddr_addr,
+					  struct ia_css_host_data *data)
 {
 	assert(data);
 	assert(data->address);
@@ -1089,10 +1078,9 @@ ia_css_params_store_ia_css_host_data(
 	IA_CSS_LEAVE_PRIVATE("void");
 }
 
-struct ia_css_host_data *
-ia_css_params_alloc_convert_sctbl(
-    const struct ia_css_pipeline_stage *stage,
-    const struct ia_css_shading_table *shading_table)
+struct ia_css_host_data *ia_css_params_alloc_convert_sctbl(
+		const struct ia_css_pipeline_stage *stage,
+		const struct ia_css_shading_table *shading_table)
 {
 	const struct ia_css_binary *binary = stage->binary;
 	struct ia_css_host_data    *sctbl;
@@ -1137,10 +1125,9 @@ ia_css_params_alloc_convert_sctbl(
 	return sctbl;
 }
 
-int ia_css_params_store_sctbl(
-    const struct ia_css_pipeline_stage *stage,
-    ia_css_ptr sc_tbl,
-    const struct ia_css_shading_table  *sc_config)
+int ia_css_params_store_sctbl(const struct ia_css_pipeline_stage *stage,
+			      ia_css_ptr sc_tbl,
+			      const struct ia_css_shading_table  *sc_config)
 {
 	struct ia_css_host_data *isp_sc_tbl;
 
@@ -1165,8 +1152,7 @@ int ia_css_params_store_sctbl(
 	return 0;
 }
 
-static void
-sh_css_enable_pipeline(const struct ia_css_binary *binary)
+static void sh_css_enable_pipeline(const struct ia_css_binary *binary)
 {
 	if (!binary)
 		return;
@@ -1179,9 +1165,9 @@ sh_css_enable_pipeline(const struct ia_css_binary *binary)
 }
 
 static int
-ia_css_process_zoom_and_motion(
-    struct ia_css_isp_parameters *params,
-    const struct ia_css_pipeline_stage *first_stage) {
+ia_css_process_zoom_and_motion(struct ia_css_isp_parameters *params,
+			       const struct ia_css_pipeline_stage *first_stage)
+{
 	/* first_stage can be  NULL */
 	const struct ia_css_pipeline_stage *stage;
 	int err = 0;
@@ -1195,13 +1181,13 @@ ia_css_process_zoom_and_motion(
 	IA_CSS_ENTER_PRIVATE("");
 
 	/* Go through all stages to udate uds and cropping */
-	for (stage = first_stage; stage; stage = stage->next)
-	{
+	for (stage = first_stage; stage; stage = stage->next) {
 		struct ia_css_binary *binary;
-		/* note: the var below is made static as it is quite large;
-		   if it is not static it ends up on the stack which could
-		   cause issues for drivers
-		*/
+		/*
+		 * note: the var below is made static as it is quite large;
+		 * if it is not static it ends up on the stack which could
+		 * cause issues for drivers
+		 */
 		static struct ia_css_binary tmp_binary;
 
 		const struct ia_css_binary_xinfo *info = NULL;
@@ -1361,8 +1347,7 @@ sh_css_get_macc_table(const struct ia_css_isp_parameters *params,
 	IA_CSS_LEAVE_PRIVATE("void");
 }
 
-void ia_css_morph_table_free(
-    struct ia_css_morph_table *me)
+void ia_css_morph_table_free(struct ia_css_morph_table *me)
 {
 	unsigned int i;
 
@@ -1387,8 +1372,7 @@ void ia_css_morph_table_free(
 }
 
 struct ia_css_morph_table *ia_css_morph_table_allocate(
-    unsigned int width,
-    unsigned int height)
+		unsigned int width, unsigned int height)
 {
 	unsigned int i;
 	struct ia_css_morph_table *me;
@@ -1427,9 +1411,8 @@ struct ia_css_morph_table *ia_css_morph_table_allocate(
 	return me;
 }
 
-static int sh_css_params_default_morph_table(
-    struct ia_css_morph_table **table,
-    const struct ia_css_binary *binary)
+static int sh_css_params_default_morph_table(struct ia_css_morph_table **table,
+					     const struct ia_css_binary *binary)
 {
 	/* MW 2400 advanced requires different scaling */
 	unsigned int i, j, k, step, width, height;
@@ -1499,10 +1482,9 @@ sh_css_set_morph_table(struct ia_css_isp_parameters *params,
 	IA_CSS_LEAVE_PRIVATE("void");
 }
 
-void
-ia_css_translate_3a_statistics(
-    struct ia_css_3a_statistics               *host_stats,
-    const struct ia_css_isp_3a_statistics_map *isp_stats)
+void ia_css_translate_3a_statistics(
+		struct ia_css_3a_statistics *host_stats,
+		const struct ia_css_isp_3a_statistics_map *isp_stats)
 {
 	IA_CSS_ENTER("");
 	if (host_stats->grid.use_dmem) {
@@ -1521,8 +1503,7 @@ ia_css_translate_3a_statistics(
 	IA_CSS_LEAVE("void");
 }
 
-void
-ia_css_isp_3a_statistics_map_free(struct ia_css_isp_3a_statistics_map *me)
+void ia_css_isp_3a_statistics_map_free(struct ia_css_isp_3a_statistics_map *me)
 {
 	if (me) {
 		if (me->data_allocated) {
@@ -1534,14 +1515,15 @@ ia_css_isp_3a_statistics_map_free(struct ia_css_isp_3a_statistics_map *me)
 	}
 }
 
-struct ia_css_isp_3a_statistics_map *
-ia_css_isp_3a_statistics_map_allocate(
-    const struct ia_css_isp_3a_statistics *isp_stats,
-    void *data_ptr)
+struct ia_css_isp_3a_statistics_map *ia_css_isp_3a_statistics_map_allocate(
+		const struct ia_css_isp_3a_statistics *isp_stats,
+		void *data_ptr)
 {
 	struct ia_css_isp_3a_statistics_map *me;
-	/* Windows compiler does not like adding sizes to a void *
-	 * so we use a local char * instead. */
+	/*
+	 * Windows compiler does not like adding sizes to a void *
+	 * so we use a local char * instead.
+	 */
 	char *base_ptr;
 
 	me = kvmalloc(sizeof(*me), GFP_KERNEL);
@@ -1562,8 +1544,10 @@ ia_css_isp_3a_statistics_map_allocate(
 	base_ptr = me->data_ptr;
 
 	me->size = isp_stats->size;
-	/* GCC complains when we assign a char * to a void *, so these
-	 * casts are necessary unfortunately. */
+	/*
+	 * GCC complains when we assign a char * to a void *, so these
+	 * casts are necessary unfortunately.
+	 */
 	me->dmem_stats    = (void *)base_ptr;
 	me->vmem_stats_hi = (void *)(base_ptr + isp_stats->dmem_size);
 	me->vmem_stats_lo = (void *)(base_ptr + isp_stats->dmem_size +
@@ -1579,9 +1563,9 @@ ia_css_isp_3a_statistics_map_allocate(
 	return NULL;
 }
 
-int
-ia_css_get_3a_statistics(struct ia_css_3a_statistics           *host_stats,
-			 const struct ia_css_isp_3a_statistics *isp_stats) {
+int ia_css_get_3a_statistics(struct ia_css_3a_statistics *host_stats,
+			     const struct ia_css_isp_3a_statistics *isp_stats)
+{
 	struct ia_css_isp_3a_statistics_map *map;
 	int ret = 0;
 
@@ -1591,13 +1575,11 @@ ia_css_get_3a_statistics(struct ia_css_3a_statistics           *host_stats,
 	assert(isp_stats);
 
 	map = ia_css_isp_3a_statistics_map_allocate(isp_stats, NULL);
-	if (map)
-	{
+	if (map) {
 		hmm_load(isp_stats->data_ptr, map->data_ptr, isp_stats->size);
 		ia_css_translate_3a_statistics(host_stats, map);
 		ia_css_isp_3a_statistics_map_free(map);
-	} else
-	{
+	} else {
 		IA_CSS_ERROR("out of memory");
 		ret = -ENOMEM;
 	}
@@ -1606,12 +1588,12 @@ ia_css_get_3a_statistics(struct ia_css_3a_statistics           *host_stats,
 	return ret;
 }
 
-/* Parameter encoding is not yet orthogonal.
-   This function hnadles some of the exceptions.
-*/
-static void
-ia_css_set_param_exceptions(const struct ia_css_pipe *pipe,
-			    struct ia_css_isp_parameters *params)
+/*
+ * Parameter encoding is not yet orthogonal.
+ * This function hnadles some of the exceptions.
+ */
+static void ia_css_set_param_exceptions(const struct ia_css_pipe *pipe,
+					struct ia_css_isp_parameters *params)
 {
 	assert(params);
 
@@ -1635,10 +1617,9 @@ ia_css_set_param_exceptions(const struct ia_css_pipe *pipe,
 }
 
 /* ISP2401 */
-static void
-sh_css_set_dp_config(const struct ia_css_pipe *pipe,
-		     struct ia_css_isp_parameters *params,
-		     const struct ia_css_dp_config *config)
+static void sh_css_set_dp_config(const struct ia_css_pipe *pipe,
+				 struct ia_css_isp_parameters *params,
+				 const struct ia_css_dp_config *config)
 {
 	if (!config)
 		return;
@@ -1656,10 +1637,9 @@ sh_css_set_dp_config(const struct ia_css_pipe *pipe,
 	IA_CSS_LEAVE_PRIVATE("void");
 }
 
-static void
-sh_css_get_dp_config(const struct ia_css_pipe *pipe,
-		     const struct ia_css_isp_parameters *params,
-		     struct ia_css_dp_config *config)
+static void sh_css_get_dp_config(const struct ia_css_pipe *pipe,
+				 const struct ia_css_isp_parameters *params,
+				 struct ia_css_dp_config *config)
 {
 	if (!config)
 		return;
@@ -1673,9 +1653,8 @@ sh_css_get_dp_config(const struct ia_css_pipe *pipe,
 	IA_CSS_LEAVE_PRIVATE("void");
 }
 
-static void
-sh_css_set_nr_config(struct ia_css_isp_parameters *params,
-		     const struct ia_css_nr_config *config)
+static void sh_css_set_nr_config(struct ia_css_isp_parameters *params,
+				 const struct ia_css_nr_config *config)
 {
 	if (!config)
 		return;
@@ -1693,9 +1672,8 @@ sh_css_set_nr_config(struct ia_css_isp_parameters *params,
 	IA_CSS_LEAVE_PRIVATE("void");
 }
 
-static void
-sh_css_set_ee_config(struct ia_css_isp_parameters *params,
-		     const struct ia_css_ee_config *config)
+static void sh_css_set_ee_config(struct ia_css_isp_parameters *params,
+				 const struct ia_css_ee_config *config)
 {
 	if (!config)
 		return;
@@ -1711,9 +1689,8 @@ sh_css_set_ee_config(struct ia_css_isp_parameters *params,
 	IA_CSS_LEAVE_PRIVATE("void");
 }
 
-static void
-sh_css_get_ee_config(const struct ia_css_isp_parameters *params,
-		     struct ia_css_ee_config *config)
+static void sh_css_get_ee_config(const struct ia_css_isp_parameters *params,
+				 struct ia_css_ee_config *config)
 {
 	if (!config)
 		return;
@@ -1781,9 +1758,8 @@ sh_css_get_pipe_dvs_6axis_config(const struct ia_css_pipe *pipe,
 	IA_CSS_LEAVE_PRIVATE("void");
 }
 
-static void
-sh_css_set_baa_config(struct ia_css_isp_parameters *params,
-		      const struct ia_css_aa_config *config)
+static void sh_css_set_baa_config(struct ia_css_isp_parameters *params,
+				  const struct ia_css_aa_config *config)
 {
 	if (!config)
 		return;
@@ -1797,9 +1773,8 @@ sh_css_set_baa_config(struct ia_css_isp_parameters *params,
 	IA_CSS_LEAVE_PRIVATE("void");
 }
 
-static void
-sh_css_get_baa_config(const struct ia_css_isp_parameters *params,
-		      struct ia_css_aa_config *config)
+static void sh_css_get_baa_config(const struct ia_css_isp_parameters *params,
+				  struct ia_css_aa_config *config)
 {
 	if (!config)
 		return;
@@ -1812,9 +1787,8 @@ sh_css_get_baa_config(const struct ia_css_isp_parameters *params,
 	IA_CSS_LEAVE_PRIVATE("void");
 }
 
-static void
-sh_css_set_dz_config(struct ia_css_isp_parameters *params,
-		     const struct ia_css_dz_config *config)
+static void sh_css_set_dz_config(struct ia_css_isp_parameters *params,
+				 const struct ia_css_dz_config *config)
 {
 	if (!config)
 		return;
@@ -1833,9 +1807,8 @@ sh_css_set_dz_config(struct ia_css_isp_parameters *params,
 	IA_CSS_LEAVE_PRIVATE("void");
 }
 
-static void
-sh_css_get_dz_config(const struct ia_css_isp_parameters *params,
-		     struct ia_css_dz_config *config)
+static void sh_css_get_dz_config(const struct ia_css_isp_parameters *params,
+				 struct ia_css_dz_config *config)
 {
 	if (!config)
 		return;
@@ -1848,9 +1821,8 @@ sh_css_get_dz_config(const struct ia_css_isp_parameters *params,
 	IA_CSS_LEAVE_PRIVATE("dx=%d, dy=%d", config->dx, config->dy);
 }
 
-static void
-sh_css_set_motion_vector(struct ia_css_isp_parameters *params,
-			 const struct ia_css_vector *motion)
+static void sh_css_set_motion_vector(struct ia_css_isp_parameters *params,
+				     const struct ia_css_vector *motion)
 {
 	if (!motion)
 		return;
@@ -1866,9 +1838,8 @@ sh_css_set_motion_vector(struct ia_css_isp_parameters *params,
 	IA_CSS_LEAVE_PRIVATE("void");
 }
 
-static void
-sh_css_get_motion_vector(const struct ia_css_isp_parameters *params,
-			 struct ia_css_vector *motion)
+static void sh_css_get_motion_vector(const struct ia_css_isp_parameters *params,
+				     struct ia_css_vector *motion)
 {
 	if (!motion)
 		return;
@@ -1881,8 +1852,7 @@ sh_css_get_motion_vector(const struct ia_css_isp_parameters *params,
 	IA_CSS_LEAVE_PRIVATE("x=%d, y=%d", motion->x, motion->y);
 }
 
-struct ia_css_isp_config *
-sh_css_pipe_isp_config_get(struct ia_css_pipe *pipe)
+struct ia_css_isp_config *sh_css_pipe_isp_config_get(struct ia_css_pipe *pipe)
 {
 	if (!pipe) {
 		IA_CSS_ERROR("pipe=%p", NULL);
@@ -1891,18 +1861,16 @@ sh_css_pipe_isp_config_get(struct ia_css_pipe *pipe)
 	return pipe->config.p_isp_config;
 }
 
-int
-ia_css_stream_set_isp_config(
-    struct ia_css_stream *stream,
-    const struct ia_css_isp_config *config) {
+int ia_css_stream_set_isp_config(struct ia_css_stream *stream,
+				 const struct ia_css_isp_config *config)
+{
 	return ia_css_stream_set_isp_config_on_pipe(stream, config, NULL);
 }
 
-int
-ia_css_stream_set_isp_config_on_pipe(
-    struct ia_css_stream *stream,
-    const struct ia_css_isp_config *config,
-    struct ia_css_pipe *pipe) {
+int ia_css_stream_set_isp_config_on_pipe(struct ia_css_stream *stream,
+					 const struct ia_css_isp_config *config,
+					 struct ia_css_pipe *pipe)
+{
 	int err = 0;
 
 	if ((!stream) || (!config))
@@ -1921,9 +1889,9 @@ ia_css_stream_set_isp_config_on_pipe(
 	return err;
 }
 
-int
-ia_css_pipe_set_isp_config(struct ia_css_pipe *pipe,
-			   struct ia_css_isp_config *config) {
+int ia_css_pipe_set_isp_config(struct ia_css_pipe *pipe,
+			       struct ia_css_isp_config *config)
+{
 	struct ia_css_pipe *pipe_in = pipe;
 	int err = 0;
 
@@ -1944,11 +1912,11 @@ ia_css_pipe_set_isp_config(struct ia_css_pipe *pipe,
 	return err;
 }
 
-static int
-sh_css_set_global_isp_config_on_pipe(
-    struct ia_css_pipe *curr_pipe,
-    const struct ia_css_isp_config *config,
-    struct ia_css_pipe *pipe) {
+static int sh_css_set_global_isp_config_on_pipe(
+		struct ia_css_pipe *curr_pipe,
+		const struct ia_css_isp_config *config,
+		struct ia_css_pipe *pipe)
+{
 	int err = 0;
 	int err1 = 0;
 	int err2 = 0;
@@ -1960,11 +1928,13 @@ sh_css_set_global_isp_config_on_pipe(
 	/* Now commit all changes to the SP */
 	err2 = sh_css_param_update_isp_params(curr_pipe, curr_pipe->stream->isp_params_configs, sh_css_sp_is_running(), pipe);
 
-	/* The following code is intentional. The sh_css_init_isp_params_from_config interface
+	/*
+	 * The following code is intentional. The sh_css_init_isp_params_from_config interface
 	 * throws an error when both DPC and BDS is enabled. The CSS API must pass this error
 	 * information to the caller, ie. the host. We do not return this error immediately,
 	 * but instead continue with updating the ISP params to enable testing of features
-	 * which are currently in TR phase. */
+	 * which are currently in TR phase.
+	 */
 
 	err = (err1 != 0) ? err1 : ((err2 != 0) ? err2 : err);
 
@@ -1973,11 +1943,11 @@ sh_css_set_global_isp_config_on_pipe(
 }
 
 #if defined(SH_CSS_ENABLE_PER_FRAME_PARAMS)
-static int
-sh_css_set_per_frame_isp_config_on_pipe(
-    struct ia_css_stream *stream,
-    const struct ia_css_isp_config *config,
-    struct ia_css_pipe *pipe) {
+static int sh_css_set_per_frame_isp_config_on_pipe(
+		struct ia_css_stream *stream,
+		const struct ia_css_isp_config *config,
+		struct ia_css_pipe *pipe)
+{
 	unsigned int i;
 	bool per_frame_config_created = false;
 	int err = 0;
@@ -1991,17 +1961,16 @@ sh_css_set_per_frame_isp_config_on_pipe(
 
 	IA_CSS_ENTER_PRIVATE("stream=%p, config=%p, pipe=%p", stream, config, pipe);
 
-	if (!pipe)
-	{
+	if (!pipe) {
 		err = -EINVAL;
 		goto exit;
 	}
 
-	/* create per-frame ISP params object with default values
+	/*
+	 * create per-frame ISP params object with default values
 	 * from stream->isp_params_configs if one doesn't already exist
-	*/
-	if (!stream->per_frame_isp_params_configs)
-	{
+	 */
+	if (!stream->per_frame_isp_params_configs) {
 		err = sh_css_create_isp_params(stream,
 					       &stream->per_frame_isp_params_configs);
 		if (err)
@@ -2013,14 +1982,11 @@ sh_css_set_per_frame_isp_config_on_pipe(
 
 	/* update new ISP params object with the new config */
 	if (!sh_css_init_isp_params_from_global(stream, params, false, pipe))
-	{
 		err1 = -EINVAL;
-	}
 
 	err2 = sh_css_init_isp_params_from_config(stream->pipes[0], params, config, pipe);
 
-	if (per_frame_config_created)
-	{
+	if (per_frame_config_created) {
 		ddr_ptrs = &params->ddr_ptrs;
 		ddr_ptrs_size = &params->ddr_ptrs_size;
 		/* create per pipe reference to general ddr_ptrs */
@@ -2033,11 +1999,13 @@ sh_css_set_per_frame_isp_config_on_pipe(
 	/* now commit to ddr */
 	err3 = sh_css_param_update_isp_params(stream->pipes[0], params, sh_css_sp_is_running(), pipe);
 
-	/* The following code is intentional. The sh_css_init_sp_params_from_config and
+	/*
+	 * The following code is intentional. The sh_css_init_sp_params_from_config and
 	 * sh_css_init_isp_params_from_config throws an error when both DPC and BDS is enabled.
 	 * The CSS API must pass this error information to the caller, ie. the host.
 	 * We do not return this error immediately, but instead continue with updating the ISP params
-	 *  to enable testing of features which are currently in TR phase. */
+	 * to enable testing of features which are currently in TR phase.xi
+	 */
 	err = (err1 != 0) ? err1 :
 	      (err2 != 0) ? err2 :
 	      (err3 != 0) ? err3 : err;
@@ -2047,11 +2015,12 @@ sh_css_set_per_frame_isp_config_on_pipe(
 }
 #endif
 
-static int
-sh_css_init_isp_params_from_config(struct ia_css_pipe *pipe,
-				   struct ia_css_isp_parameters *params,
-				   const struct ia_css_isp_config *config,
-				   struct ia_css_pipe *pipe_in) {
+static int sh_css_init_isp_params_from_config(
+		struct ia_css_pipe *pipe,
+		struct ia_css_isp_parameters *params,
+		const struct ia_css_isp_config *config,
+		struct ia_css_pipe *pipe_in)
+{
 	int err = 0;
 	bool is_dp_10bpp = true;
 
@@ -2064,9 +2033,11 @@ sh_css_init_isp_params_from_config(struct ia_css_pipe *pipe,
 	sh_css_set_nr_config(params, config->nr_config);
 	sh_css_set_ee_config(params, config->ee_config);
 	sh_css_set_baa_config(params, config->baa_config);
+
 	if ((pipe->mode < IA_CSS_PIPE_ID_NUM) &&
 	    (params->pipe_dvs_6axis_config[pipe->mode]))
 		sh_css_set_pipe_dvs_6axis_config(pipe, params, config->dvs_6axis_config);
+
 	sh_css_set_dz_config(params, config->dz_config);
 	sh_css_set_motion_vector(params, config->motion_vector);
 	sh_css_update_shading_table_status(pipe_in, params);
@@ -2085,28 +2056,29 @@ sh_css_init_isp_params_from_config(struct ia_css_pipe *pipe,
 	params->output_frame = config->output_frame;
 	params->isp_parameters_id = config->isp_config_id;
 
-	/* Currently we do not offer CSS interface to set different
+	/*
+	 * Currently we do not offer CSS interface to set different
 	 * configurations for DPC, i.e. depending on DPC being enabled
 	 * before (NORM+OBC) or after. The folllowing code to set the
 	 * DPC configuration should be updated when this interface is made
-	 * available */
+	 * available
+	 */
 	if (IS_ISP2401) {
 		sh_css_set_dp_config(pipe, params, config->dp_config);
 		ia_css_set_param_exceptions(pipe, params);
 	}
 
-	if (0 ==
-	    sh_css_select_dp_10bpp_config(pipe, &is_dp_10bpp))
-	{
-		/* return an error when both DPC and BDS is enabled by the
-		 * user. */
-		/* we do not exit from this point immediately to allow internal
-		 * firmware feature testing. */
+	if (0 == sh_css_select_dp_10bpp_config(pipe, &is_dp_10bpp)) {
+		/*
+		 * return an error when both DPC and BDS is enabled by the
+		 * user.
+		 * we do not exit from this point immediately to allow internal
+		 * firmware feature testing.
+		 */
 		if (is_dp_10bpp) {
 			err = -EINVAL;
 		}
-	} else
-	{
+	} else {
 		err = -EINVAL;
 		goto exit;
 	}
@@ -2119,19 +2091,16 @@ sh_css_init_isp_params_from_config(struct ia_css_pipe *pipe,
 	return err;
 }
 
-void
-ia_css_stream_get_isp_config(
-    const struct ia_css_stream *stream,
-    struct ia_css_isp_config *config)
+void ia_css_stream_get_isp_config(const struct ia_css_stream *stream,
+				  struct ia_css_isp_config *config)
 {
 	IA_CSS_ENTER("void");
 	ia_css_pipe_get_isp_config(stream->pipes[0], config);
 	IA_CSS_LEAVE("void");
 }
 
-void
-ia_css_pipe_get_isp_config(struct ia_css_pipe *pipe,
-			   struct ia_css_isp_config *config)
+void ia_css_pipe_get_isp_config(struct ia_css_pipe *pipe,
+				struct ia_css_isp_config *config)
 {
 	struct ia_css_isp_parameters *params = NULL;
 
@@ -2168,19 +2137,17 @@ ia_css_pipe_get_isp_config(struct ia_css_pipe *pipe,
  *
  * Deprecated: Implement mmgr_realloc()
  */
-static bool realloc_isp_css_mm_buf(
-    ia_css_ptr *curr_buf,
-    size_t *curr_size,
-    size_t needed_size,
-    bool force,
-    int *err,
-    uint16_t mmgr_attribute)
+static bool realloc_isp_css_mm_buf(ia_css_ptr *curr_buf, size_t *curr_size,
+				   size_t needed_size, bool force, int *err,
+				   uint16_t mmgr_attribute)
 {
 	s32 id;
 
 	*err = 0;
-	/* Possible optimization: add a function sh_css_isp_css_mm_realloc()
-	 * and implement on top of hmm. */
+	/*
+	 * Possible optimization: add a function sh_css_isp_css_mm_realloc()
+	 * and implement on top of hmm.
+	 */
 
 	IA_CSS_ENTER_PRIVATE("void");
 
@@ -2211,12 +2178,8 @@ static bool realloc_isp_css_mm_buf(
 	return true;
 }
 
-static bool reallocate_buffer(
-    ia_css_ptr *curr_buf,
-    size_t *curr_size,
-    size_t needed_size,
-    bool force,
-    int *err)
+static bool reallocate_buffer(ia_css_ptr *curr_buf, size_t *curr_size,
+			      size_t needed_size, bool force, int *err)
 {
 	bool ret;
 
@@ -2284,8 +2247,7 @@ ia_css_isp_3a_statistics_allocate(const struct ia_css_3a_grid_info *grid)
 	return me;
 }
 
-void
-ia_css_isp_3a_statistics_free(struct ia_css_isp_3a_statistics *me)
+void ia_css_isp_3a_statistics_free(struct ia_css_isp_3a_statistics *me)
 {
 	if (me) {
 		hmm_free(me->data_ptr);
@@ -2327,15 +2289,16 @@ ia_css_metadata_allocate(const struct ia_css_metadata_info *metadata_info)
 	return NULL;
 }
 
-void
-ia_css_metadata_free(struct ia_css_metadata *me)
+void ia_css_metadata_free(struct ia_css_metadata *me)
 {
 	if (me) {
-		/* The enter and leave macros are placed inside
+		/*
+		 * The enter and leave macros are placed inside
 		 * the condition to avoid false logging of metadata
 		 * free events when metadata is disabled.
 		 * We found this to be confusing during development
-		 * and debugging. */
+		 * and debugging.
+		 */
 		IA_CSS_ENTER("me=%p", me);
 		hmm_free(me->address);
 		kvfree(me);
@@ -2343,9 +2306,8 @@ ia_css_metadata_free(struct ia_css_metadata *me)
 	}
 }
 
-void
-ia_css_metadata_free_multiple(unsigned int num_bufs,
-			      struct ia_css_metadata **bufs)
+void ia_css_metadata_free_multiple(unsigned int num_bufs,
+				   struct ia_css_metadata **bufs)
 {
 	unsigned int i;
 
@@ -2358,8 +2320,8 @@ ia_css_metadata_free_multiple(unsigned int num_bufs,
 static unsigned int g_param_buffer_dequeue_count;
 static unsigned int g_param_buffer_enqueue_count;
 
-int
-ia_css_stream_isp_parameters_init(struct ia_css_stream *stream) {
+int ia_css_stream_isp_parameters_init(struct ia_css_stream *stream)
+{
 	int err = 0;
 	unsigned int i;
 	struct sh_css_ddr_address_map *ddr_ptrs;
@@ -2369,8 +2331,7 @@ ia_css_stream_isp_parameters_init(struct ia_css_stream *stream) {
 	assert(stream);
 	IA_CSS_ENTER_PRIVATE("void");
 
-	if (!stream)
-	{
+	if (!stream) {
 		IA_CSS_LEAVE_ERR_PRIVATE(-EINVAL);
 		return -EINVAL;
 	}
@@ -2385,10 +2346,11 @@ ia_css_stream_isp_parameters_init(struct ia_css_stream *stream) {
 		goto ERR;
 
 	params = stream->isp_params_configs;
-	if (!sh_css_init_isp_params_from_global(stream, params, true, NULL))
-	{
-		/* we do not return the error immediately to enable internal
-		 * firmware feature testing */
+	if (!sh_css_init_isp_params_from_global(stream, params, true, NULL)) {
+		/*
+		 * we do not return the error immediately to enable internal
+		 * firmware feature testing
+		 */
 		err = -EINVAL;
 	}
 
@@ -2396,8 +2358,7 @@ ia_css_stream_isp_parameters_init(struct ia_css_stream *stream) {
 	ddr_ptrs_size = &params->ddr_ptrs_size;
 
 	/* create per pipe reference to general ddr_ptrs */
-	for (i = 0; i < IA_CSS_PIPE_ID_NUM; i++)
-	{
+	for (i = 0; i < IA_CSS_PIPE_ID_NUM; i++) {
 		ref_sh_css_ddr_address_map(ddr_ptrs, &params->pipe_ddr_ptrs[i]);
 		params->pipe_ddr_ptrs_size[i] = *ddr_ptrs_size;
 	}
@@ -2407,10 +2368,9 @@ ia_css_stream_isp_parameters_init(struct ia_css_stream *stream) {
 	return err;
 }
 
-static void
-ia_css_set_sdis_config(
-    struct ia_css_isp_parameters *params,
-    const struct ia_css_dvs_coefficients *dvs_coefs)
+static void ia_css_set_sdis_config(
+		struct ia_css_isp_parameters *params,
+		const struct ia_css_dvs_coefficients *dvs_coefs)
 {
 	ia_css_set_sdis_horicoef_config(params, dvs_coefs);
 	ia_css_set_sdis_vertcoef_config(params, dvs_coefs);
@@ -2418,10 +2378,9 @@ ia_css_set_sdis_config(
 	ia_css_set_sdis_vertproj_config(params, dvs_coefs);
 }
 
-static void
-ia_css_set_sdis2_config(
-    struct ia_css_isp_parameters *params,
-    const struct ia_css_dvs2_coefficients *dvs2_coefs)
+static void ia_css_set_sdis2_config(
+		struct ia_css_isp_parameters *params,
+		const struct ia_css_dvs2_coefficients *dvs2_coefs)
 {
 	ia_css_set_sdis2_horicoef_config(params, dvs2_coefs);
 	ia_css_set_sdis2_vertcoef_config(params, dvs2_coefs);
@@ -2431,7 +2390,8 @@ ia_css_set_sdis2_config(
 
 static int
 sh_css_create_isp_params(struct ia_css_stream *stream,
-			 struct ia_css_isp_parameters **isp_params_out) {
+			 struct ia_css_isp_parameters **isp_params_out)
+{
 	bool succ = true;
 	unsigned int i;
 	struct sh_css_ddr_address_map *ddr_ptrs;
@@ -2441,23 +2401,20 @@ sh_css_create_isp_params(struct ia_css_stream *stream,
 	struct ia_css_isp_parameters *params =
 	kvmalloc(sizeof(struct ia_css_isp_parameters), GFP_KERNEL);
 
-	if (!params)
-	{
+	if (!params) {
 		*isp_params_out = NULL;
 		err = -ENOMEM;
 		IA_CSS_ERROR("%s:%d error: cannot allocate memory", __FILE__, __LINE__);
 		IA_CSS_LEAVE_ERR_PRIVATE(err);
 		return err;
-	} else
-	{
+	} else {
 		memset(params, 0, sizeof(struct ia_css_isp_parameters));
 	}
 
 	ddr_ptrs = &params->ddr_ptrs;
 	ddr_ptrs_size = &params->ddr_ptrs_size;
 
-	for (i = 0; i < IA_CSS_PIPE_ID_NUM; i++)
-	{
+	for (i = 0; i < IA_CSS_PIPE_ID_NUM; i++) {
 		memset(&params->pipe_ddr_ptrs[i], 0,
 		       sizeof(params->pipe_ddr_ptrs[i]));
 		memset(&params->pipe_ddr_ptrs_size[i], 0,
@@ -2535,15 +2492,16 @@ sh_css_init_isp_params_from_global(struct ia_css_stream *stream,
 			for (i = 0; i < stream->num_pipes; i++) {
 				if (sh_css_select_dp_10bpp_config(stream->pipes[i],
 								&is_dp_10bpp) == 0) {
-					/* set the return value as false if both DPC and
-					* BDS is enabled by the user. But we do not return
-					* the value immediately to enable internal firmware
-					* feature testing. */
-					if (is_dp_10bpp) {
+					/*
+					 * set the return value as false if both DPC and
+					 * BDS is enabled by the user. But we do not return
+					 * the value immediately to enable internal firmware
+					 * feature testing.
+					 */
+					if (is_dp_10bpp)
 						sh_css_set_dp_config(stream->pipes[i], params, &default_dp_10bpp_config);
-					} else {
+					else
 						sh_css_set_dp_config(stream->pipes[i], params, &default_dp_config);
-					}
 				} else {
 					retval = false;
 					goto exit;
@@ -2643,10 +2601,12 @@ sh_css_init_isp_params_from_global(struct ia_css_stream *stream,
 		for (i = 0; i < stream->num_pipes; i++) {
 			if (0 ==
 			    sh_css_select_dp_10bpp_config(stream->pipes[i], &is_dp_10bpp)) {
-				/* set the return value as false if both DPC and
+				/*
+				 * set the return value as false if both DPC and
 				 * BDS is enabled by the user. But we do not return
 				 * the value immediately to enable internal firmware
-				 * feature testing. */
+				 * feature testing.
+				 */
 
 				if (is_dp_10bpp) {
 					retval = false;
@@ -2713,8 +2673,8 @@ sh_css_init_isp_params_from_global(struct ia_css_stream *stream,
 	return retval;
 }
 
-int
-sh_css_params_init(void) {
+int sh_css_params_init(void)
+{
 	int i, p;
 
 	IA_CSS_ENTER_PRIVATE("void");
@@ -2723,8 +2683,7 @@ sh_css_params_init(void) {
 	g_param_buffer_dequeue_count = 0;
 	g_param_buffer_enqueue_count = 0;
 
-	for (p = 0; p < IA_CSS_PIPE_ID_NUM; p++)
-	{
+	for (p = 0; p < IA_CSS_PIPE_ID_NUM; p++) {
 		for (i = 0; i < SH_CSS_MAX_STAGES; i++) {
 			xmem_sp_stage_ptrs[p][i] =
 			ia_css_refcount_increment(-1,
@@ -2762,8 +2721,7 @@ sh_css_params_init(void) {
 								 ATOMISP_MAP_FLAG_CLEARED));
 
 	if ((sp_ddr_ptrs == mmgr_NULL) ||
-	    (xmem_sp_group_ptrs == mmgr_NULL))
-	{
+	    (xmem_sp_group_ptrs == mmgr_NULL)) {
 		ia_css_uninit();
 		IA_CSS_LEAVE_ERR_PRIVATE(-ENOMEM);
 		return -ENOMEM;
@@ -2792,8 +2750,7 @@ inline void sh_css_params_free_gdc_lut(ia_css_ptr addr)
 		hmm_free(addr);
 }
 
-int ia_css_pipe_set_bci_scaler_lut(struct ia_css_pipe *pipe,
-	const void *lut)
+int ia_css_pipe_set_bci_scaler_lut(struct ia_css_pipe *pipe, const void *lut)
 {
 	int err = 0;
 	bool stream_started = false;
@@ -2806,10 +2763,12 @@ int ia_css_pipe_set_bci_scaler_lut(struct ia_css_pipe *pipe,
 		return err;
 	}
 
-	/* If the pipe belongs to a stream and the stream has started, it is not
+	/*
+	 * If the pipe belongs to a stream and the stream has started, it is not
 	 * safe to store lut to gdc HW. If pipe->stream is NULL, then no stream is
 	 * created with this pipe, so it is safe to do this operation as long as
-	 * ia_css_init() has been called. */
+	 * ia_css_init() has been called.
+	 */
 	if (pipe->stream && pipe->stream->started) {
 		ia_css_debug_dtrace(IA_CSS_DEBUG_ERROR,
 				    "unable to set scaler lut since stream has started\n");
@@ -2899,8 +2858,7 @@ ia_css_ptr sh_css_params_get_default_gdc_lut(void)
 	return default_gdc_lut;
 }
 
-static void free_param_set_callback(
-    ia_css_ptr ptr)
+static void free_param_set_callback(ia_css_ptr ptr)
 {
 	IA_CSS_ENTER_PRIVATE("void");
 
@@ -2909,8 +2867,7 @@ static void free_param_set_callback(
 	IA_CSS_LEAVE_PRIVATE("void");
 }
 
-static void free_buffer_callback(
-    ia_css_ptr ptr)
+static void free_buffer_callback(ia_css_ptr ptr)
 {
 	IA_CSS_ENTER_PRIVATE("void");
 
@@ -2919,8 +2876,7 @@ static void free_buffer_callback(
 	IA_CSS_LEAVE_PRIVATE("void");
 }
 
-void
-sh_css_param_clear_param_sets(void)
+void sh_css_param_clear_param_sets(void)
 {
 	IA_CSS_ENTER_PRIVATE("void");
 
@@ -3040,12 +2996,9 @@ sh_css_params_uninit(void)
 	IA_CSS_LEAVE_PRIVATE("void");
 }
 
-static struct ia_css_host_data *
-convert_allocate_morph_plane(
-    unsigned short *data,
-    unsigned int width,
-    unsigned int height,
-    unsigned int aligned_width)
+static struct ia_css_host_data *convert_allocate_morph_plane(
+		unsigned short *data, unsigned int width,
+		unsigned int height, unsigned int aligned_width)
 {
 	unsigned int i, j, padding, w;
 	struct ia_css_host_data *me;
@@ -3054,9 +3007,11 @@ convert_allocate_morph_plane(
 
 	IA_CSS_ENTER_PRIVATE("void");
 
-	/* currently we don't have morph table interpolation yet,
+	/*
+	 * currently we don't have morph table interpolation yet,
 	 * so we allow a wider table to be used. This will be removed
-	 * in the future. */
+	 * in the future.
+	 */
 	if (width > aligned_width) {
 		padding = 0;
 		w = aligned_width;
@@ -3088,20 +3043,16 @@ convert_allocate_morph_plane(
 	return me;
 }
 
-static int
-store_morph_plane(
-    unsigned short *data,
-    unsigned int width,
-    unsigned int height,
-    ia_css_ptr dest,
-    unsigned int aligned_width) {
+static int store_morph_plane(unsigned short *data, unsigned int width,
+			     unsigned int height, ia_css_ptr dest,
+			     unsigned int aligned_width)
+{
 	struct ia_css_host_data *isp_data;
 
 	assert(dest != mmgr_NULL);
 
 	isp_data = convert_allocate_morph_plane(data, width, height, aligned_width);
-	if (!isp_data)
-	{
+	if (!isp_data) {
 		IA_CSS_LEAVE_ERR_PRIVATE(-ENOMEM);
 		return -ENOMEM;
 	}
@@ -3112,8 +3063,8 @@ store_morph_plane(
 }
 
 static void sh_css_update_isp_params_to_ddr(
-    struct ia_css_isp_parameters *params,
-    ia_css_ptr ddr_ptr)
+		struct ia_css_isp_parameters *params,
+		ia_css_ptr ddr_ptr)
 {
 	size_t size = sizeof(params->uds);
 
@@ -3126,10 +3077,10 @@ static void sh_css_update_isp_params_to_ddr(
 }
 
 static void sh_css_update_isp_mem_params_to_ddr(
-    const struct ia_css_binary *binary,
-    ia_css_ptr ddr_mem_ptr,
-    size_t size,
-    enum ia_css_isp_memories mem)
+		const struct ia_css_binary *binary,
+		ia_css_ptr ddr_mem_ptr,
+		size_t size,
+		enum ia_css_isp_memories mem)
 {
 	const struct ia_css_host_data *params;
 
@@ -3200,10 +3151,10 @@ process_kernel_parameters(unsigned int pipe_id,
 		ia_css_ob_configure(&params->stream_configs.ob,
 				    isp_pipe_version, raw_bit_depth);
 	}
-	if (params->config_changed[IA_CSS_S3A_ID]) {
+	if (params->config_changed[IA_CSS_S3A_ID])
 		ia_css_s3a_configure(raw_bit_depth);
-	}
-	/* Copy stage uds parameters to config, since they can differ per stage.
+	/*
+	 * Copy stage uds parameters to config, since they can differ per stage.
 	 */
 	params->crop_config.crop_pos = params->uds[stage->stage_num].crop_pos;
 	params->uds_config.crop_pos  = params->uds[stage->stage_num].crop_pos;
@@ -3211,7 +3162,8 @@ process_kernel_parameters(unsigned int pipe_id,
 	/* Call parameter process functions for all kernels */
 	/* Skip SC, since that is called on a temp sc table */
 	for (param_id = 0; param_id < IA_CSS_NUM_PARAMETER_IDS; param_id++) {
-		if (param_id == IA_CSS_SC_ID) continue;
+		if (param_id == IA_CSS_SC_ID)
+			continue;
 		if (params->config_changed[param_id])
 			ia_css_kernel_process_param[param_id](pipe_id, stage, params);
 	}
@@ -3221,7 +3173,8 @@ int
 sh_css_param_update_isp_params(struct ia_css_pipe *curr_pipe,
 			       struct ia_css_isp_parameters *params,
 			       bool commit,
-			       struct ia_css_pipe *pipe_in) {
+			       struct ia_css_pipe *pipe_in)
+{
 	int err = 0;
 	ia_css_ptr cpy;
 	int i;
@@ -3238,15 +3191,15 @@ sh_css_param_update_isp_params(struct ia_css_pipe *curr_pipe,
 	raw_bit_depth = ia_css_stream_input_format_bits_per_pixel(curr_pipe->stream);
 
 	/* now make the map available to the sp */
-	if (!commit)
-	{
+	if (!commit) {
 		IA_CSS_LEAVE_ERR_PRIVATE(err);
 		return err;
 	}
-	/* enqueue a copies of the mem_map to
-	   the designated pipelines */
-	for (i = 0; i < curr_pipe->stream->num_pipes; i++)
-	{
+	/*
+	 * enqueue a copies of the mem_map to
+	 * the designated pipelines
+	 */
+	for (i = 0; i < curr_pipe->stream->num_pipes; i++) {
 		struct ia_css_pipe *pipe;
 		struct sh_css_ddr_address_map *cur_map;
 		struct sh_css_ddr_address_map_size *cur_map_size;
@@ -3279,11 +3232,12 @@ sh_css_param_update_isp_params(struct ia_css_pipe *curr_pipe,
 		cur_map = &params->pipe_ddr_ptrs[pipeline->pipe_id];
 		cur_map_size = &params->pipe_ddr_ptrs_size[pipeline->pipe_id];
 
-		/* TODO: Normally, zoom and motion parameters shouldn't
+		/*
+		 * TODO: Normally, zoom and motion parameters shouldn't
 		 * be part of "isp_params" as it is resolution/pipe dependent
 		 * Therefore, move the zoom config elsewhere (e.g. shading
 		 * table can be taken as an example! @GC
-		 * */
+		 */
 		{
 			/* we have to do this per pipeline because */
 			/* the processing is a.o. resolution dependent */
@@ -3293,8 +3247,10 @@ sh_css_param_update_isp_params(struct ia_css_pipe *curr_pipe,
 				return err;
 		}
 		/* check if to actually update the parameters for this pipe */
-		/* When API change is implemented making good distinction between
-		* stream config and pipe config this skipping code can be moved out of the #ifdef */
+		/*
+		 * When API change is implemented making good distinction between
+		 * stream config and pipe config this skipping code can be moved out of the #ifdef
+		 */
 		if (pipe_in && (pipe != pipe_in)) {
 			IA_CSS_LOG("skipping pipe %p", pipe);
 			continue;
@@ -3374,7 +3330,8 @@ sh_css_param_update_isp_params(struct ia_css_pipe *curr_pipe,
 #endif
 			break;
 		} else {
-			/* TMP: check discrepancy between nr of enqueued
+			/*
+			 * TMP: check discrepancy between nr of enqueued
 			 * parameter sets and dequeued sets
 			 */
 			g_param_buffer_enqueue_count++;
@@ -3404,8 +3361,10 @@ sh_css_param_update_isp_params(struct ia_css_pipe *curr_pipe,
 		ia_css_dequeue_param_buffers(/*pipe_num*/);
 		params->pipe_dvs_6axis_config_changed[pipeline->pipe_id] = false;
 	} /* end for each 'active' pipeline */
-	/* clear the changed flags after all params
-	for all pipelines have been updated */
+	/*
+	 * clear the changed flags after all params
+	 * for all pipelines have been updated
+	 */
 	params->isp_params_changed = false;
 	params->sc_table_changed = false;
 	params->dis_coef_table_changed = false;
@@ -3423,14 +3382,14 @@ sh_css_param_update_isp_params(struct ia_css_pipe *curr_pipe,
 	return err;
 }
 
-static int
-sh_css_params_write_to_ddr_internal(
-    struct ia_css_pipe *pipe,
-    unsigned int pipe_id,
-    struct ia_css_isp_parameters *params,
-    const struct ia_css_pipeline_stage *stage,
-    struct sh_css_ddr_address_map *ddr_map,
-    struct sh_css_ddr_address_map_size *ddr_map_size) {
+static int sh_css_params_write_to_ddr_internal(
+		struct ia_css_pipe *pipe,
+		unsigned int pipe_id,
+		struct ia_css_isp_parameters *params,
+		const struct ia_css_pipeline_stage *stage,
+		struct sh_css_ddr_address_map *ddr_map,
+		struct sh_css_ddr_address_map_size *ddr_map_size)
+{
 	int err;
 	const struct ia_css_binary *binary;
 
@@ -3452,8 +3411,7 @@ sh_css_params_write_to_ddr_internal(
 
 	stage_num = stage->stage_num;
 
-	if (binary->info->sp.enable.fpnr)
-	{
+	if (binary->info->sp.enable.fpnr) {
 		buff_realloced = reallocate_buffer(&ddr_map->fpn_tbl,
 						   &ddr_map_size->fpn_tbl,
 						   (size_t)(FPNTBL_BYTES(binary)),
@@ -3474,8 +3432,7 @@ sh_css_params_write_to_ddr_internal(
 		}
 	}
 
-	if (binary->info->sp.enable.sc)
-	{
+	if (binary->info->sp.enable.sc) {
 		u32 enable_conv;
 		size_t bytes;
 
@@ -3573,12 +3530,13 @@ sh_css_params_write_to_ddr_internal(
 		}
 	}
 
-	/* DPC configuration is made pipe specific to allow flexibility in positioning of the
+	/*
+	 * DPC configuration is made pipe specific to allow flexibility in positioning of the
 	 * DPC kernel. The code below sets the pipe specific configuration to
-	 * individual binaries. */
+	 * individual binaries.
+	 */
 	if (IS_ISP2401 &&
-	    params->pipe_dpc_config_changed[pipe_id] && binary->info->sp.enable.dpc)
-	{
+	    params->pipe_dpc_config_changed[pipe_id] && binary->info->sp.enable.dpc) {
 		unsigned int size   =
 		    stage->binary->info->mem_offsets.offsets.param->dmem.dp.size;
 
@@ -3596,8 +3554,7 @@ sh_css_params_write_to_ddr_internal(
 		}
 	}
 
-	if (params->config_changed[IA_CSS_MACC_ID] && binary->info->sp.enable.macc)
-	{
+	if (params->config_changed[IA_CSS_MACC_ID] && binary->info->sp.enable.macc) {
 		unsigned int i, j, idx;
 		unsigned int idx_map[] = {
 			0, 1, 3, 2, 6, 7, 5, 4, 12, 13, 15, 14, 10, 11, 9, 8
@@ -3646,9 +3603,9 @@ sh_css_params_write_to_ddr_internal(
 			   sizeof(converted_macc_table.data));
 	}
 
-	if (binary->info->sp.enable.dvs_6axis)
-	{
-		/* because UV is packed into the Y plane, calc total
+	if (binary->info->sp.enable.dvs_6axis) {
+		/*
+		 * because UV is packed into the Y plane, calc total
 		 * YYU size = /2 gives size of UV-only,
 		 * total YYU size = UV-only * 3.
 		 */
@@ -3667,11 +3624,13 @@ sh_css_params_write_to_ddr_internal(
 			const struct ia_css_frame_info *dvs_in_frame_info;
 
 			if (stage->args.delay_frames[0]) {
-				/*When delay frames are present(as in case of video),
-				they are used for dvs. Configure DVS using those params*/
+				/*
+				 * When delay frames are present(as in case of video),
+				 * they are used for dvs. Configure DVS using those paramsi
+				 */
 				dvs_in_frame_info = &stage->args.delay_frames[0]->info;
 			} else {
-				/*Otherwise, use input frame to configure DVS*/
+				/* Otherwise, use input frame to configure DVS */
 				dvs_in_frame_info = &stage->args.in_frame->info;
 			}
 
@@ -3682,9 +3641,8 @@ sh_css_params_write_to_ddr_internal(
 				if (!IS_ISP2401) {
 					dvs_offset.width = (PIX_SHIFT_FILTER_RUN_IN_X + binary->dvs_envelope.width) / 2;
 				} else {
-					if (binary->dvs_envelope.width || binary->dvs_envelope.height) {
+					if (binary->dvs_envelope.width || binary->dvs_envelope.height)
 						dvs_offset.width  = (PIX_SHIFT_FILTER_RUN_IN_X + binary->dvs_envelope.width) / 2;
-					}
 				}
 				dvs_offset.height = (PIX_SHIFT_FILTER_RUN_IN_Y + binary->dvs_envelope.height) / 2;
 
@@ -3705,21 +3663,13 @@ sh_css_params_write_to_ddr_internal(
 		}
 	}
 
-	if (binary->info->sp.enable.ca_gdc)
-	{
+	if (binary->info->sp.enable.ca_gdc) {
 		unsigned int i;
-		ia_css_ptr *virt_addr_tetra_x[
-
-		IA_CSS_MORPH_TABLE_NUM_PLANES];
-		size_t *virt_size_tetra_x[
-
-		IA_CSS_MORPH_TABLE_NUM_PLANES];
-		ia_css_ptr *virt_addr_tetra_y[
+		ia_css_ptr *virt_addr_tetra_x[IA_CSS_MORPH_TABLE_NUM_PLANES];
+		ia_css_ptr *virt_addr_tetra_y[IA_CSS_MORPH_TABLE_NUM_PLANES];
 
-		IA_CSS_MORPH_TABLE_NUM_PLANES];
-		size_t *virt_size_tetra_y[
-
-		IA_CSS_MORPH_TABLE_NUM_PLANES];
+		size_t *virt_size_tetra_x[IA_CSS_MORPH_TABLE_NUM_PLANES];
+		size_t *virt_size_tetra_y[IA_CSS_MORPH_TABLE_NUM_PLANES];
 
 		virt_addr_tetra_x[0] = &ddr_map->tetra_r_x;
 		virt_addr_tetra_x[1] = &ddr_map->tetra_gr_x;
@@ -3752,23 +3702,19 @@ sh_css_params_write_to_ddr_internal(
 		buff_realloced = false;
 		for (i = 0; i < IA_CSS_MORPH_TABLE_NUM_PLANES; i++) {
 			buff_realloced |=
-			    reallocate_buffer(virt_addr_tetra_x[i],
-					    virt_size_tetra_x[i],
-					    (size_t)
-					    (MORPH_PLANE_BYTES(binary)),
-					    params->morph_table_changed,
-					    &err);
+				reallocate_buffer(virt_addr_tetra_x[i],
+						  virt_size_tetra_x[i],
+						  (size_t) (MORPH_PLANE_BYTES(binary)),
+						  params->morph_table_changed, &err);
 			if (err) {
 				IA_CSS_LEAVE_ERR_PRIVATE(err);
 				return err;
 			}
 			buff_realloced |=
-			    reallocate_buffer(virt_addr_tetra_y[i],
-					    virt_size_tetra_y[i],
-					    (size_t)
-					    (MORPH_PLANE_BYTES(binary)),
-					    params->morph_table_changed,
-					    &err);
+				reallocate_buffer(virt_addr_tetra_y[i],
+						  virt_size_tetra_y[i],
+						  (size_t) (MORPH_PLANE_BYTES(binary)),
+						  params->morph_table_changed, &err);
 			if (err) {
 				IA_CSS_LEAVE_ERR_PRIVATE(err);
 				return err;
@@ -3795,15 +3741,15 @@ sh_css_params_write_to_ddr_internal(
 
 			for (i = 0; i < IA_CSS_MORPH_TABLE_NUM_PLANES; i++) {
 				store_morph_plane(table->coordinates_x[i],
-						table->width,
-						table->height,
-						*virt_addr_tetra_x[i],
-						binary->morph_tbl_aligned_width);
+						  table->width,
+						  table->height,
+						  *virt_addr_tetra_x[i],
+						  binary->morph_tbl_aligned_width);
 				store_morph_plane(table->coordinates_y[i],
-						table->width,
-						table->height,
-						*virt_addr_tetra_y[i],
-						binary->morph_tbl_aligned_width);
+						  table->width,
+						  table->height,
+						  *virt_addr_tetra_y[i],
+						  binary->morph_tbl_aligned_width);
 			}
 			if (id_table)
 				ia_css_morph_table_free(id_table);
@@ -3811,19 +3757,20 @@ sh_css_params_write_to_ddr_internal(
 	}
 
 	/* After special cases like SC, FPN since they may change parameters */
-	for (mem = 0; mem < N_IA_CSS_MEMORIES; mem++)
-	{
+	for (mem = 0; mem < N_IA_CSS_MEMORIES; mem++) {
 		const struct ia_css_isp_data *isp_data =
 		    ia_css_isp_param_get_isp_mem_init(&binary->info->sp.mem_initializers,
-						    IA_CSS_PARAM_CLASS_PARAM, mem);
+						      IA_CSS_PARAM_CLASS_PARAM, mem);
 		size_t size = isp_data->size;
 
-		if (!size) continue;
+		if (!size)
+			continue;
+
 		buff_realloced = reallocate_buffer(&ddr_map->isp_mem_param[stage_num][mem],
-						&ddr_map_size->isp_mem_param[stage_num][mem],
-						size,
-						params->isp_mem_params_changed[pipe_id][stage_num][mem],
-						&err);
+						   &ddr_map_size->isp_mem_param[stage_num][mem],
+						   size,
+						   params->isp_mem_params_changed[pipe_id][stage_num][mem],
+						   &err);
 		if (err) {
 			IA_CSS_LEAVE_ERR_PRIVATE(err);
 			return err;
@@ -3852,8 +3799,8 @@ const struct ia_css_fpn_table *ia_css_get_fpn_table(struct ia_css_stream
 	return &params->fpn_config;
 }
 
-struct ia_css_shading_table *ia_css_get_shading_table(struct ia_css_stream
-	*stream)
+struct ia_css_shading_table *ia_css_get_shading_table(
+		struct ia_css_stream *stream)
 {
 	struct ia_css_shading_table *table = NULL;
 	struct ia_css_isp_parameters *params;
@@ -3870,8 +3817,8 @@ struct ia_css_shading_table *ia_css_get_shading_table(struct ia_css_stream
 		if (params->sc_table) {
 			table = (struct ia_css_shading_table *)params->sc_table;
 		} else {
-			const struct ia_css_binary *binary
-			    = ia_css_stream_get_shading_correction_binary(stream);
+			const struct ia_css_binary *binary =
+				ia_css_stream_get_shading_correction_binary(stream);
 			if (binary) {
 				/* generate the identical shading table */
 				if (params->sc_config) {
@@ -3882,19 +3829,23 @@ struct ia_css_shading_table *ia_css_get_shading_table(struct ia_css_stream
 									binary->sctbl_width_per_color,
 									binary->sctbl_height);
 				table = params->sc_config;
-				/* The sc_config will be freed in the
-				 * ia_css_stream_isp_parameters_uninit function. */
+				/*
+				 * The sc_config will be freed in the
+				 * ia_css_stream_isp_parameters_uninit function.xi
+				 */
 			}
 		}
 	} else {
 		/* ------ deprecated(bz675) : from ------ */
-		const struct ia_css_binary *binary
-		    = ia_css_stream_get_shading_correction_binary(stream);
+		const struct ia_css_binary *binary =
+			ia_css_stream_get_shading_correction_binary(stream);
 		struct ia_css_pipe *pipe;
 
 		/**********************************************************************/
-		/* following code is copied from function ia_css_stream_get_shading_correction_binary()
-		 * to match with the binary */
+		/*
+		 * following code is copied from function ia_css_stream_get_shading_correction_binary()
+		 * to match with the binary
+		 */
 		pipe = stream->pipes[0];
 
 		if (stream->num_pipes == 2) {
@@ -3916,8 +3867,10 @@ struct ia_css_shading_table *ia_css_get_shading_table(struct ia_css_stream
 			    binary, pipe->required_bds_factor);
 
 			table = params->sc_config;
-			/* The sc_config will be freed in the
-			 * ia_css_stream_isp_parameters_uninit function. */
+			/*
+			 * The sc_config will be freed in the
+			 * ia_css_stream_isp_parameters_uninit function.
+			 */
 		}
 		/* ------ deprecated(bz675) : to ------ */
 	}
@@ -3930,45 +3883,38 @@ struct ia_css_shading_table *ia_css_get_shading_table(struct ia_css_stream
 ia_css_ptr sh_css_store_sp_group_to_ddr(void)
 {
 	IA_CSS_ENTER_LEAVE_PRIVATE("void");
-	hmm_store(xmem_sp_group_ptrs,
-		   &sh_css_sp_group,
-		   sizeof(struct sh_css_sp_group));
+	hmm_store(xmem_sp_group_ptrs, &sh_css_sp_group,
+		  sizeof(struct sh_css_sp_group));
 	return xmem_sp_group_ptrs;
 }
 
-ia_css_ptr sh_css_store_sp_stage_to_ddr(
-    unsigned int pipe,
-    unsigned int stage)
+ia_css_ptr sh_css_store_sp_stage_to_ddr(unsigned int pipe, unsigned int stage)
 {
 	IA_CSS_ENTER_LEAVE_PRIVATE("void");
-	hmm_store(xmem_sp_stage_ptrs[pipe][stage],
-		   &sh_css_sp_stage,
-		   sizeof(struct sh_css_sp_stage));
+	hmm_store(xmem_sp_stage_ptrs[pipe][stage], &sh_css_sp_stage,
+		  sizeof(struct sh_css_sp_stage));
 	return xmem_sp_stage_ptrs[pipe][stage];
 }
 
-ia_css_ptr sh_css_store_isp_stage_to_ddr(
-    unsigned int pipe,
-    unsigned int stage)
+ia_css_ptr sh_css_store_isp_stage_to_ddr(unsigned int pipe, unsigned int stage)
 {
 	IA_CSS_ENTER_LEAVE_PRIVATE("void");
-	hmm_store(xmem_isp_stage_ptrs[pipe][stage],
-		   &sh_css_isp_stage,
-		   sizeof(struct sh_css_isp_stage));
+	hmm_store(xmem_isp_stage_ptrs[pipe][stage], &sh_css_isp_stage,
+		  sizeof(struct sh_css_isp_stage));
 	return xmem_isp_stage_ptrs[pipe][stage];
 }
 
-static int ref_sh_css_ddr_address_map(
-    struct sh_css_ddr_address_map *map,
-    struct sh_css_ddr_address_map *out)
+static int ref_sh_css_ddr_address_map(struct sh_css_ddr_address_map *map,
+				      struct sh_css_ddr_address_map *out)
 {
 	int err = 0;
 	unsigned int i;
 
-	/* we will use a union to copy things; overlaying an array
-	   with the struct; that way adding fields in the struct
-	   will keep things working, and we will not get type errors.
-	*/
+	/*
+	 * we will use a union to copy things; overlaying an array
+	 * with the struct; that way adding fields in the struct
+	 * will keep things working, and we will not get type errors.
+	 */
 	union {
 		struct sh_css_ddr_address_map *map;
 		ia_css_ptr *addrs;
@@ -3999,8 +3945,8 @@ static int ref_sh_css_ddr_address_map(
 }
 
 static int write_ia_css_isp_parameter_set_info_to_ddr(
-    struct ia_css_isp_parameter_set_info *me,
-    ia_css_ptr *out)
+		struct ia_css_isp_parameter_set_info *me,
+		ia_css_ptr *out)
 {
 	int err = 0;
 	bool succ;
@@ -4014,8 +3960,8 @@ static int write_ia_css_isp_parameter_set_info_to_ddr(
 					 hmm_alloc(sizeof(struct ia_css_isp_parameter_set_info), HMM_BO_PRIVATE, 0, NULL, 0));
 	succ = (*out != mmgr_NULL);
 	if (succ)
-		hmm_store(*out,
-			   me, sizeof(struct ia_css_isp_parameter_set_info));
+		hmm_store(*out, me,
+			  sizeof(struct ia_css_isp_parameter_set_info));
 	else
 		err = -ENOMEM;
 
@@ -4023,9 +3969,8 @@ static int write_ia_css_isp_parameter_set_info_to_ddr(
 	return err;
 }
 
-static int
-free_ia_css_isp_parameter_set_info(
-    ia_css_ptr ptr) {
+static int free_ia_css_isp_parameter_set_info(ia_css_ptr ptr)
+{
 	int err = 0;
 	struct ia_css_isp_parameter_set_info isp_params_info;
 	unsigned int i;
@@ -4034,8 +3979,7 @@ free_ia_css_isp_parameter_set_info(
 	IA_CSS_ENTER_PRIVATE("ptr = %u", ptr);
 
 	/* sanity check - ptr must be valid */
-	if (!ia_css_refcount_is_valid(ptr))
-	{
+	if (!ia_css_refcount_is_valid(ptr)) {
 		IA_CSS_ERROR("%s: IA_CSS_REFCOUNT_PARAM_SET_POOL(0x%x) invalid arg", __func__,
 			     ptr);
 		err = -EINVAL;
@@ -4046,8 +3990,7 @@ free_ia_css_isp_parameter_set_info(
 	hmm_load(ptr, &isp_params_info.mem_map, sizeof(struct sh_css_ddr_address_map));
 	/* copy map using size info */
 	for (i = 0; i < (sizeof(struct sh_css_ddr_address_map_size) /
-			 sizeof(size_t)); i++)
-	{
+			 sizeof(size_t)); i++) {
 		if (addrs[i] == mmgr_NULL)
 			continue;
 
@@ -4081,9 +4024,8 @@ sh_css_invalidate_params(struct ia_css_stream *stream)
 	params->isp_params_changed = true;
 	for (i = 0; i < IA_CSS_PIPE_ID_NUM; i++) {
 		for (j = 0; j < SH_CSS_MAX_STAGES; j++) {
-			for (mem = 0; mem < N_IA_CSS_MEMORIES; mem++) {
+			for (mem = 0; mem < N_IA_CSS_MEMORIES; mem++)
 				params->isp_mem_params_changed[i][j][mem] = true;
-			}
 		}
 	}
 
@@ -4106,18 +4048,16 @@ sh_css_invalidate_params(struct ia_css_stream *stream)
 	IA_CSS_LEAVE_PRIVATE("void");
 }
 
-void
-sh_css_update_uds_and_crop_info(
-    const struct ia_css_binary_info *info,
-    const struct ia_css_frame_info *in_frame_info,
-    const struct ia_css_frame_info *out_frame_info,
-    const struct ia_css_resolution *dvs_env,
-    const struct ia_css_dz_config *zoom,
-    const struct ia_css_vector *motion_vector,
-    struct sh_css_uds_info *uds,		/* out */
-    struct sh_css_crop_pos *sp_out_crop_pos,	/* out */
-
-    bool enable_zoom)
+void sh_css_update_uds_and_crop_info(
+		const struct ia_css_binary_info *info,
+		const struct ia_css_frame_info *in_frame_info,
+		const struct ia_css_frame_info *out_frame_info,
+		const struct ia_css_resolution *dvs_env,
+		const struct ia_css_dz_config *zoom,
+		const struct ia_css_vector *motion_vector,
+		struct sh_css_uds_info *uds,			/* out */
+		struct sh_css_crop_pos *sp_out_crop_pos,	/* out */
+		bool enable_zoom)
 {
 	IA_CSS_ENTER_PRIVATE("void");
 
@@ -4195,20 +4135,26 @@ sh_css_update_uds_and_crop_info(
 			/* clip the motion vector to +/- half the envelope */
 			motion_x = clamp(motion_x, -half_env_x, half_env_x);
 			motion_y = clamp(motion_y, -half_env_y, half_env_y);
-			/* for video with downscaling, the envelope is included
-			    in the input resolution. */
+			/*
+			 * for video with downscaling, the envelope is included
+			 * in the input resolution.
+			 */
 			uds_xc = in_frame_info->res.width / 2 + motion_x;
 			uds_yc = in_frame_info->res.height / 2 + motion_y;
 			crop_x = info->pipeline.left_cropping;
-			/* ds == 2 (yuv_ds) can be pipelined, remove top
-			   lines */
+			/*
+			 * ds == 2 (yuv_ds) can be pipelined,
+			 * remove top lines
+			 */
 			if (info->enable.ds & 1)
 				crop_y = info->pipeline.top_cropping;
 			else
 				crop_y = 2;
 		} else {
-			/* video nodz: here we can only crop. We make sure we
-			   crop at least the first 8x8 pixels away. */
+			/*
+			 * video nodz: here we can only crop. We make sure we
+			 * crop at least the first 8x8 pixels away.
+			 */
 			env_width  = dvs_env->width -
 				     SH_CSS_MIN_DVS_ENVELOPE;
 			env_height = dvs_env->height -
@@ -4243,28 +4189,29 @@ sh_css_update_uds_and_crop_info(
 	IA_CSS_LEAVE_PRIVATE("void");
 }
 
-static int
-sh_css_update_uds_and_crop_info_based_on_zoom_region(
-    const struct ia_css_binary_info *info,
-    const struct ia_css_frame_info *in_frame_info,
-    const struct ia_css_frame_info *out_frame_info,
-    const struct ia_css_resolution *dvs_env,
-    const struct ia_css_dz_config *zoom,
-    const struct ia_css_vector *motion_vector,
-    struct sh_css_uds_info *uds,		/* out */
-    struct sh_css_crop_pos *sp_out_crop_pos,	/* out */
-    struct ia_css_resolution pipe_in_res,
-    bool enable_zoom) {
+static int sh_css_update_uds_and_crop_info_based_on_zoom_region(
+		const struct ia_css_binary_info *info,
+		const struct ia_css_frame_info *in_frame_info,
+		const struct ia_css_frame_info *out_frame_info,
+		const struct ia_css_resolution *dvs_env,
+		const struct ia_css_dz_config *zoom,
+		const struct ia_css_vector *motion_vector,
+		struct sh_css_uds_info *uds,			/* out */
+		struct sh_css_crop_pos *sp_out_crop_pos,	/* out */
+		struct ia_css_resolution pipe_in_res,
+		bool enable_zoom)
+{
 	unsigned int x0 = 0, y0 = 0, x1 = 0, y1 = 0;
 	int err = 0;
-	/* Note:
-	* Filter_Envelope = 0 for NND/LUT
-	* Filter_Envelope = 1 for BCI
-	* Filter_Envelope = 3 for BLI
-	* Currently, not considering this filter envelope because, In uds.sp.c is recalculating
-	* the dx/dy based on filter envelope and other information (ia_css_uds_sp_scale_params)
-	* Ideally, That should be done on host side not on sp side.
-	*/
+	/*
+	 * Note:
+	 * Filter_Envelope = 0 for NND/LUT
+	 * Filter_Envelope = 1 for BCI
+	 * Filter_Envelope = 3 for BLI
+	 * Currently, not considering this filter envelope because, In uds.sp.c is recalculating
+	 * the dx/dy based on filter envelope and other information (ia_css_uds_sp_scale_params)
+	 * Ideally, That should be done on host side not on sp side.
+	 */
 	unsigned int filter_envelope = 0;
 
 	IA_CSS_ENTER_PRIVATE("void");
@@ -4285,24 +4232,24 @@ sh_css_update_uds_and_crop_info_based_on_zoom_region(
 	if ((x0 > x1) || (y0 > y1) || (x1 > pipe_in_res.width) || (y1 > pipe_in_res.height))
 		return -EINVAL;
 
-	if (!enable_zoom)
-	{
+	if (!enable_zoom) {
 		uds->curr_dx = HRT_GDC_N;
 		uds->curr_dy = HRT_GDC_N;
 	}
 
-	if (info->enable.dvs_envelope)
-	{
-		/* Zoom region is only supported by the UDS module on ISP
-		 * 2 and higher. It is not supported in video mode on ISP 1 */
+	if (info->enable.dvs_envelope) {
+		/*
+		 * Zoom region is only supported by the UDS module on ISP
+		 * 2 and higher. It is not supported in video mode on ISP 1
+		 */
 		return -EINVAL;
-	} else
-	{
+	} else {
 		if (enable_zoom) {
-			/* A. Calculate dx/dy based on crop region using in_frame_info
-			* Scale the crop region if in_frame_info to the stage is not same as
-			* actual effective input of the pipeline
-			*/
+			/*
+			 * A. Calculate dx/dy based on crop region using in_frame_info
+			 * Scale the crop region if in_frame_info to the stage is not same as
+			 * actual effective input of the pipeline
+			 */
 			if (in_frame_info->res.width != pipe_in_res.width ||
 			    in_frame_info->res.height != pipe_in_res.height) {
 				x0 = (x0 * in_frame_info->res.width) / (pipe_in_res.width);
-- 
2.30.2



_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* [PATCH 4/5] staging: media: atomisp: code formatting changes sh_css_sp.c
  2021-05-01  6:43 [PATCH 0/5] staging: media: atomisp: code formatting changes Deepak R Varma
                   ` (2 preceding siblings ...)
  2021-05-01  6:46 ` [PATCH 3/5] staging: media: atomisp: code formatting changes sh_css_params.c Deepak R Varma
@ 2021-05-01  6:47 ` Deepak R Varma
  2021-05-20 19:05   ` [PATCH RESEND " Deepak R Varma
  2021-05-01  6:48 ` [PATCH 5/5] staging: media: atomisp: code formatting changes sh_css_version.c Deepak R Varma
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 15+ messages in thread
From: Deepak R Varma @ 2021-05-01  6:47 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Sakari Ailus, Greg Kroah-Hartman
  Cc: devel, drv, linux-kernel, linux-media

Several trivial code reformatting changes done according to the coding
style guidelines. These code changes overall improve code organisation
and readability and also address many chackpatch error, warning and
check complaints.

Signed-off-by: Deepak R Varma <drv@mailo.com>
---
 drivers/staging/media/atomisp/pci/sh_css_sp.c | 471 ++++++++----------
 1 file changed, 203 insertions(+), 268 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/sh_css_sp.c b/drivers/staging/media/atomisp/pci/sh_css_sp.c
index 02f5a73b4096..b2859dcf9ac6 100644
--- a/drivers/staging/media/atomisp/pci/sh_css_sp.c
+++ b/drivers/staging/media/atomisp/pci/sh_css_sp.c
@@ -91,14 +91,12 @@ static void
 initialize_stage_frames(struct ia_css_frames_sp *frames);
 
 /* This data is stored every frame */
-void
-store_sp_group_data(void)
+void store_sp_group_data(void)
 {
 	per_frame_data.sp_group_addr = sh_css_store_sp_group_to_ddr();
 }
 
-static void
-copy_isp_stage_to_sp_stage(void)
+static void copy_isp_stage_to_sp_stage(void)
 {
 	/* [WW07.5]type casting will cause potential issues */
 	sh_css_sp_stage.num_stripes = (uint8_t)
@@ -109,7 +107,8 @@ copy_isp_stage_to_sp_stage(void)
 		sh_css_isp_stage.binary_info.iterator.row_stripes_overlap_lines;
 	sh_css_sp_stage.top_cropping = (uint16_t)
 				       sh_css_isp_stage.binary_info.pipeline.top_cropping;
-	/* moved to sh_css_sp_init_stage
+	/*
+	 * moved to sh_css_sp_init_stage
 	   sh_css_sp_stage.enable.vf_output =
 	   sh_css_isp_stage.binary_info.enable.vf_veceven ||
 	   sh_css_isp_stage.binary_info.num_output_pins > 1;
@@ -118,9 +117,8 @@ copy_isp_stage_to_sp_stage(void)
 	sh_css_sp_stage.enable.s3a = sh_css_isp_stage.binary_info.enable.s3a;
 }
 
-void
-store_sp_stage_data(enum ia_css_pipe_id id, unsigned int pipe_num,
-		    unsigned int stage)
+void store_sp_stage_data(enum ia_css_pipe_id id, unsigned int pipe_num,
+			 unsigned int stage)
 {
 	unsigned int thread_id;
 
@@ -136,8 +134,7 @@ store_sp_stage_data(enum ia_css_pipe_id id, unsigned int pipe_num,
 	sh_css_sp_stage.program_input_circuit = false;
 }
 
-static void
-store_sp_per_frame_data(const struct ia_css_fw_info *fw)
+static void store_sp_per_frame_data(const struct ia_css_fw_info *fw)
 {
 	unsigned int HIVE_ADDR_sp_per_frame_data = 0;
 
@@ -154,16 +151,13 @@ store_sp_per_frame_data(const struct ia_css_fw_info *fw)
 		return;
 	}
 
-	sp_dmem_store(SP0_ID,
-		      (unsigned int)sp_address_of(sp_per_frame_data),
-		      &per_frame_data,
-		      sizeof(per_frame_data));
+	sp_dmem_store(SP0_ID, (unsigned int)sp_address_of(sp_per_frame_data),
+		      &per_frame_data, sizeof(per_frame_data));
 }
 
-static void
-sh_css_store_sp_per_frame_data(enum ia_css_pipe_id pipe_id,
-			       unsigned int pipe_num,
-			       const struct ia_css_fw_info *sp_fw)
+static void sh_css_store_sp_per_frame_data(enum ia_css_pipe_id pipe_id,
+					   unsigned int pipe_num,
+					   const struct ia_css_fw_info *sp_fw)
 {
 	if (!sp_fw)
 		sp_fw = &sh_css_sp_fw;
@@ -175,8 +169,7 @@ sh_css_store_sp_per_frame_data(enum ia_css_pipe_id pipe_id,
 
 #if SP_DEBUG != SP_DEBUG_NONE
 
-void
-sh_css_sp_get_debug_state(struct sh_css_sp_debug_state *state)
+void sh_css_sp_get_debug_state(struct sh_css_sp_debug_state *state)
 {
 	const struct ia_css_fw_info *fw = &sh_css_sp_fw;
 	unsigned int HIVE_ADDR_sp_output = fw->info.sp.output;
@@ -193,10 +186,9 @@ sh_css_sp_get_debug_state(struct sh_css_sp_debug_state *state)
 
 #endif
 
-void
-sh_css_sp_start_binary_copy(unsigned int pipe_num,
-			    struct ia_css_frame *out_frame,
-			    unsigned int two_ppc)
+void sh_css_sp_start_binary_copy(unsigned int pipe_num,
+				 struct ia_css_frame *out_frame,
+				 unsigned int two_ppc)
 {
 	enum ia_css_pipe_id pipe_id;
 	unsigned int thread_id;
@@ -284,8 +276,10 @@ sh_css_sp_start_raw_copy(struct ia_css_frame *out_frame,
 	pipe->copy.raw.max_input_width = max_input_width;
 	pipe->num_stages = 1;
 	pipe->pipe_id = pipe_id;
-	/* TODO: next indicates from which queues parameters need to be
-		 sampled, needs checking/improvement */
+	/*
+	 * TODO: next indicates from which queues parameters need to be
+	 * sampled, needs checking/improvement
+	 */
 	if (pipe_conf_override == SH_CSS_PIPE_CONFIG_OVRD_NO_OVRD)
 		pipe->pipe_config =
 		    (SH_CSS_PIPE_CONFIG_SAMPLE_PARAMS << thread_id);
@@ -321,10 +315,10 @@ sh_css_sp_start_raw_copy(struct ia_css_frame *out_frame,
 	ia_css_debug_pipe_graph_dump_sp_raw_copy(out_frame);
 }
 
-static void
-sh_css_sp_start_isys_copy(struct ia_css_frame *out_frame,
-			  unsigned int pipe_num, unsigned int max_input_width,
-			  unsigned int if_config_index)
+static void sh_css_sp_start_isys_copy(struct ia_css_frame *out_frame,
+				      unsigned int pipe_num,
+				      unsigned int max_input_width,
+				      unsigned int if_config_index)
 {
 	enum ia_css_pipe_id pipe_id;
 	unsigned int thread_id;
@@ -385,8 +379,7 @@ sh_css_sp_start_isys_copy(struct ia_css_frame *out_frame,
 	ia_css_debug_pipe_graph_dump_sp_raw_copy(out_frame);
 }
 
-unsigned int
-sh_css_sp_get_binary_copy_size(void)
+unsigned int sh_css_sp_get_binary_copy_size(void)
 {
 	const struct ia_css_fw_info *fw = &sh_css_sp_fw;
 	unsigned int HIVE_ADDR_sp_output = fw->info.sp.output;
@@ -396,8 +389,7 @@ sh_css_sp_get_binary_copy_size(void)
 	return load_sp_array_uint(sp_output, offset);
 }
 
-unsigned int
-sh_css_sp_get_sw_interrupt_value(unsigned int irq)
+unsigned int sh_css_sp_get_sw_interrupt_value(unsigned int irq)
 {
 	const struct ia_css_fw_info *fw = &sh_css_sp_fw;
 	unsigned int HIVE_ADDR_sp_output = fw->info.sp.output;
@@ -422,16 +414,17 @@ sh_css_copy_buffer_attr_to_spbuffer(struct ia_css_buffer_sp *dest_buf,
 		 */
 		assert(queue_id < SH_CSS_MAX_NUM_QUEUES);
 
-		/* Klocwork assumes assert can be disabled;
-		   Since we can get there with any type, and it does not
-		   know that frame_in->dynamic_data_index can only be set
-		   for one of the types in the assert) it has to assume we
-		   can get here for any type. however this could lead to an
-		   out of bounds reference when indexing buf_type about 10
-		   lines below. In order to satisfy KW an additional if
-		   has been added. This one will always yield true.
+		/*
+		 * Klocwork assumes assert can be disabled;
+		 * Since we can get there with any type, and it does not
+		 * know that frame_in->dynamic_data_index can only be set
+		 * for one of the types in the assert) it has to assume we
+		 * can get here for any type. however this could lead to an
+		 * out of bounds reference when indexing buf_type about 10
+		 * lines below. In order to satisfy KW an additional if
+		 * has been added. This one will always yield true.
 		 */
-		if ((queue_id < SH_CSS_MAX_NUM_QUEUES)) {
+		if (queue_id < SH_CSS_MAX_NUM_QUEUES) {
 			dest_buf->buf_src.queue_id = queue_id;
 		}
 	} else {
@@ -441,9 +434,8 @@ sh_css_copy_buffer_attr_to_spbuffer(struct ia_css_buffer_sp *dest_buf,
 	dest_buf->buf_type = buf_type;
 }
 
-static void
-sh_css_copy_frame_to_spframe(struct ia_css_frame_sp *sp_frame_out,
-			     const struct ia_css_frame *frame_in)
+static void sh_css_copy_frame_to_spframe(struct ia_css_frame_sp *sp_frame_out,
+					 const struct ia_css_frame *frame_in)
 {
 	assert(frame_in);
 
@@ -534,13 +526,12 @@ sh_css_copy_frame_to_spframe(struct ia_css_frame_sp *sp_frame_out,
 	}
 }
 
-static int
-set_input_frame_buffer(const struct ia_css_frame *frame) {
+static int set_input_frame_buffer(const struct ia_css_frame *frame)
+{
 	if (!frame)
 		return -EINVAL;
 
-	switch (frame->info.format)
-	{
+	switch (frame->info.format) {
 	case IA_CSS_FRAME_FORMAT_QPLANE6:
 	case IA_CSS_FRAME_FORMAT_YUV420_16:
 	case IA_CSS_FRAME_FORMAT_RAW_PACKED:
@@ -564,14 +555,13 @@ set_input_frame_buffer(const struct ia_css_frame *frame) {
 	return 0;
 }
 
-static int
-set_output_frame_buffer(const struct ia_css_frame *frame,
-			unsigned int idx) {
+static int set_output_frame_buffer(const struct ia_css_frame *frame,
+				   unsigned int idx)
+{
 	if (!frame)
 		return -EINVAL;
 
-	switch (frame->info.format)
-	{
+	switch (frame->info.format) {
 	case IA_CSS_FRAME_FORMAT_YUV420:
 	case IA_CSS_FRAME_FORMAT_YUV422:
 	case IA_CSS_FRAME_FORMAT_YUV444:
@@ -606,13 +596,12 @@ set_output_frame_buffer(const struct ia_css_frame *frame,
 	return 0;
 }
 
-static int
-set_view_finder_buffer(const struct ia_css_frame *frame) {
+static int set_view_finder_buffer(const struct ia_css_frame *frame)
+{
 	if (!frame)
 		return -EINVAL;
 
-	switch (frame->info.format)
-	{
+	switch (frame->info.format) {
 	/* the dual output pin */
 	case IA_CSS_FRAME_FORMAT_NV12:
 	case IA_CSS_FRAME_FORMAT_NV12_16:
@@ -637,11 +626,9 @@ set_view_finder_buffer(const struct ia_css_frame *frame) {
 }
 
 #if !defined(ISP2401)
-void sh_css_sp_set_if_configs(
-    const input_formatter_cfg_t	*config_a,
-    const input_formatter_cfg_t	*config_b,
-    const uint8_t		if_config_index
-)
+void sh_css_sp_set_if_configs(const input_formatter_cfg_t *config_a,
+			      const input_formatter_cfg_t *config_b,
+			      const uint8_t if_config_index)
 {
 	assert(if_config_index < SH_CSS_MAX_IF_CONFIGS);
 	assert(config_a);
@@ -661,10 +648,8 @@ void sh_css_sp_set_if_configs(
 #endif
 
 #if !defined(ISP2401)
-void
-sh_css_sp_program_input_circuit(int fmt_type,
-				int ch_id,
-				enum ia_css_input_mode input_mode)
+void sh_css_sp_program_input_circuit(int fmt_type, int ch_id,
+				     enum ia_css_input_mode input_mode)
 {
 	sh_css_sp_group.config.input_circuit.no_side_band = false;
 	sh_css_sp_group.config.input_circuit.fmt_type     = fmt_type;
@@ -680,10 +665,8 @@ sh_css_sp_program_input_circuit(int fmt_type,
 #endif
 
 #if !defined(ISP2401)
-void
-sh_css_sp_configure_sync_gen(int width, int height,
-			     int hblank_cycles,
-			     int vblank_cycles)
+void sh_css_sp_configure_sync_gen(int width, int height,
+				  int hblank_cycles, int vblank_cycles)
 {
 	sh_css_sp_group.config.sync_gen.width	       = width;
 	sh_css_sp_group.config.sync_gen.height	       = height;
@@ -691,12 +674,9 @@ sh_css_sp_configure_sync_gen(int width, int height,
 	sh_css_sp_group.config.sync_gen.vblank_cycles = vblank_cycles;
 }
 
-void
-sh_css_sp_configure_tpg(int x_mask,
-			int y_mask,
-			int x_delta,
-			int y_delta,
-			int xy_mask)
+void sh_css_sp_configure_tpg(int x_mask, int y_mask,
+			     int x_delta, int y_delta,
+			     int xy_mask)
 {
 	sh_css_sp_group.config.tpg.x_mask  = x_mask;
 	sh_css_sp_group.config.tpg.y_mask  = y_mask;
@@ -705,15 +685,13 @@ sh_css_sp_configure_tpg(int x_mask,
 	sh_css_sp_group.config.tpg.xy_mask = xy_mask;
 }
 
-void
-sh_css_sp_configure_prbs(int seed)
+void sh_css_sp_configure_prbs(int seed)
 {
 	sh_css_sp_group.config.prbs.seed = seed;
 }
 #endif
 
-void
-sh_css_sp_configure_enable_raw_pool_locking(bool lock_all)
+void sh_css_sp_configure_enable_raw_pool_locking(bool lock_all)
 {
 	sh_css_sp_group.config.enable_raw_pool_locking = true;
 	sh_css_sp_group.config.lock_all = lock_all;
@@ -725,14 +703,13 @@ sh_css_sp_enable_isys_event_queue(bool enable)
 	sh_css_sp_group.config.enable_isys_event_queue = enable;
 }
 
-void
-sh_css_sp_set_disable_continuous_viewfinder(bool flag)
+void sh_css_sp_set_disable_continuous_viewfinder(bool flag)
 {
 	sh_css_sp_group.config.disable_cont_vf = flag;
 }
 
-static int
-sh_css_sp_write_frame_pointers(const struct sh_css_binary_args *args) {
+static int sh_css_sp_write_frame_pointers(const struct sh_css_binary_args *args)
+{
 	int err = 0;
 	int i;
 
@@ -742,23 +719,23 @@ sh_css_sp_write_frame_pointers(const struct sh_css_binary_args *args) {
 		err = set_input_frame_buffer(args->in_frame);
 	if (!err && args->out_vf_frame)
 		err = set_view_finder_buffer(args->out_vf_frame);
-	for (i = 0; i < IA_CSS_BINARY_MAX_OUTPUT_PORTS; i++)
-	{
+	for (i = 0; i < IA_CSS_BINARY_MAX_OUTPUT_PORTS; i++) {
 		if (!err && args->out_frame[i])
 			err = set_output_frame_buffer(args->out_frame[i], i);
 	}
 
-	/* we don't pass this error back to the upper layer, so we add a assert here
-	   because we actually hit the error here but it still works by accident... */
-	if (err) assert(false);
+	/*
+	 * we don't pass this error back to the upper layer, so we add a assert here
+	 * because we actually hit the error here but it still works by accident...
+	 */
+	if (err)
+		assert(false);
 	return err;
 }
 
-static void
-sh_css_sp_init_group(bool two_ppc,
-		     enum atomisp_input_format input_format,
-		     bool no_isp_sync,
-		     uint8_t if_config_index)
+static void sh_css_sp_init_group(bool two_ppc,
+				 enum atomisp_input_format input_format,
+				 bool no_isp_sync, uint8_t if_config_index)
 {
 #if !defined(ISP2401)
 	sh_css_sp_group.config.input_formatter.isp_2ppc = two_ppc;
@@ -768,7 +745,8 @@ sh_css_sp_init_group(bool two_ppc,
 
 	sh_css_sp_group.config.no_isp_sync = (uint8_t)no_isp_sync;
 	/* decide whether the frame is processed online or offline */
-	if (if_config_index == SH_CSS_IF_CONFIG_NOT_NEEDED) return;
+	if (if_config_index == SH_CSS_IF_CONFIG_NOT_NEEDED)
+		return;
 #if !defined(ISP2401)
 	assert(if_config_index < SH_CSS_MAX_IF_CONFIGS);
 	sh_css_sp_group.config.input_formatter.set[if_config_index].stream_format =
@@ -778,21 +756,19 @@ sh_css_sp_init_group(bool two_ppc,
 #endif
 }
 
-void
-sh_css_stage_write_binary_info(struct ia_css_binary_info *info)
+void sh_css_stage_write_binary_info(struct ia_css_binary_info *info)
 {
 	assert(info);
 	sh_css_isp_stage.binary_info = *info;
 }
 
-static int
-copy_isp_mem_if_to_ddr(struct ia_css_binary *binary) {
+static int copy_isp_mem_if_to_ddr(struct ia_css_binary *binary)
+{
 	int err;
 
-	err = ia_css_isp_param_copy_isp_mem_if_to_ddr(
-	    &binary->css_params,
-	    &binary->mem_params,
-	    IA_CSS_PARAM_CLASS_CONFIG);
+	err = ia_css_isp_param_copy_isp_mem_if_to_ddr(&binary->css_params,
+						      &binary->mem_params,
+						      IA_CSS_PARAM_CLASS_CONFIG);
 	if (err)
 		return err;
 	err = ia_css_isp_param_copy_isp_mem_if_to_ddr(
@@ -804,20 +780,17 @@ copy_isp_mem_if_to_ddr(struct ia_css_binary *binary) {
 	return 0;
 }
 
-static bool
-is_sp_stage(struct ia_css_pipeline_stage *stage)
+static bool is_sp_stage(struct ia_css_pipeline_stage *stage)
 {
 	assert(stage);
 	return stage->sp_func != IA_CSS_PIPELINE_NO_FUNC;
 }
 
-static int
-configure_isp_from_args(
-    const struct sh_css_sp_pipeline *pipeline,
-    const struct ia_css_binary      *binary,
-    const struct sh_css_binary_args *args,
-    bool two_ppc,
-    bool deinterleaved) {
+static int configure_isp_from_args(const struct sh_css_sp_pipeline *pipeline,
+				   const struct ia_css_binary *binary,
+				   const struct sh_css_binary_args *args,
+				   bool two_ppc, bool deinterleaved)
+{
 	ia_css_fpn_configure(binary,  &binary->in_frame_info);
 	ia_css_crop_configure(binary, &args->delay_frames[0]->info);
 	ia_css_qplane_configure(pipeline, binary, &binary->in_frame_info);
@@ -850,34 +823,31 @@ configure_isp_from_args(
 	return 0;
 }
 
-static void
-initialize_isp_states(const struct ia_css_binary *binary)
+static void initialize_isp_states(const struct ia_css_binary *binary)
 {
 	unsigned int i;
 
 	if (!binary->info->mem_offsets.offsets.state)
 		return;
-	for (i = 0; i < IA_CSS_NUM_STATE_IDS; i++) {
+	for (i = 0; i < IA_CSS_NUM_STATE_IDS; i++)
 		ia_css_kernel_init_state[i](binary);
-	}
 }
 
-static void
-initialize_frame_buffer_attribute(struct ia_css_buffer_sp *buf_attr)
+static void initialize_frame_buffer_attribute(struct ia_css_buffer_sp *buf_attr)
 {
 	buf_attr->buf_src.queue_id = SH_CSS_INVALID_QUEUE_ID;
 	buf_attr->buf_type = IA_CSS_BUFFER_TYPE_INVALID;
 }
 
-static void
-initialize_stage_frames(struct ia_css_frames_sp *frames)
+static void initialize_stage_frames(struct ia_css_frames_sp *frames)
 {
 	unsigned int i;
 
 	initialize_frame_buffer_attribute(&frames->in.buf_attr);
-	for (i = 0; i < IA_CSS_BINARY_MAX_OUTPUT_PORTS; i++) {
+
+	for (i = 0; i < IA_CSS_BINARY_MAX_OUTPUT_PORTS; i++)
 		initialize_frame_buffer_attribute(&frames->out[i].buf_attr);
-	}
+
 	initialize_frame_buffer_attribute(&frames->out_vf.buf_attr);
 	initialize_frame_buffer_attribute(&frames->s3a_buf);
 	initialize_frame_buffer_attribute(&frames->dvs_buf);
@@ -896,7 +866,8 @@ sh_css_sp_init_stage(struct ia_css_binary *binary,
 		     bool xnr,
 		     const struct ia_css_isp_param_css_segments *isp_mem_if,
 		     unsigned int if_config_index,
-		     bool two_ppc) {
+		     bool two_ppc)
+{
 	const struct ia_css_binary_xinfo *xinfo;
 	const struct ia_css_binary_info  *info;
 	int err = 0;
@@ -928,8 +899,7 @@ sh_css_sp_init_stage(struct ia_css_binary *binary,
 
 	ia_css_pipeline_get_sp_thread_id(pipe_num, &thread_id);
 
-	if (!info)
-	{
+	if (!info) {
 		sh_css_sp_group.pipe[thread_id].sp_stage_addr[stage] = mmgr_NULL;
 		return 0;
 	}
@@ -953,16 +923,16 @@ sh_css_sp_init_stage(struct ia_css_binary *binary,
 	sh_css_sp_stage.isp_copy_output = (uint8_t)args->copy_output;
 	sh_css_sp_stage.enable.vf_output = (args->out_vf_frame != NULL);
 
-	/* Copy the frame infos first, to be overwritten by the frames,
-	   if these are present.
-	*/
+	/*
+	 * Copy the frame infos first, to be overwritten by the frames,
+	 * if these are present.
+	 */
 	sh_css_sp_stage.frames.effective_in_res.width = binary->effective_in_frame_res.width;
 	sh_css_sp_stage.frames.effective_in_res.height = binary->effective_in_frame_res.height;
 
 	ia_css_frame_info_to_frame_sp_info(&sh_css_sp_stage.frames.in.info,
 					   &binary->in_frame_info);
-	for (i = 0; i < IA_CSS_BINARY_MAX_OUTPUT_PORTS; i++)
-	{
+	for (i = 0; i < IA_CSS_BINARY_MAX_OUTPUT_PORTS; i++) {
 		ia_css_frame_info_to_frame_sp_info(&sh_css_sp_stage.frames.out[i].info,
 						   &binary->out_frame_info[i]);
 	}
@@ -996,16 +966,14 @@ sh_css_sp_init_stage(struct ia_css_binary *binary,
 
 	err = sh_css_sp_write_frame_pointers(args);
 	/* TODO: move it to a better place */
-	if (binary->info->sp.enable.s3a)
-	{
+	if (binary->info->sp.enable.s3a) {
 		ia_css_query_internal_queue_id(IA_CSS_BUFFER_TYPE_3A_STATISTICS, thread_id,
 					       &queue_id);
 		sh_css_copy_buffer_attr_to_spbuffer(&sh_css_sp_stage.frames.s3a_buf, queue_id,
 						    mmgr_EXCEPTION,
 						    IA_CSS_BUFFER_TYPE_3A_STATISTICS);
 	}
-	if (binary->info->sp.enable.dis)
-	{
+	if (binary->info->sp.enable.dis) {
 		ia_css_query_internal_queue_id(IA_CSS_BUFFER_TYPE_DIS_STATISTICS, thread_id,
 					       &queue_id);
 		sh_css_copy_buffer_attr_to_spbuffer(&sh_css_sp_stage.frames.dvs_buf, queue_id,
@@ -1041,21 +1009,24 @@ sh_css_sp_init_stage(struct ia_css_binary *binary,
 
 	initialize_isp_states(binary);
 
-	/* we do this only for preview pipe because in fill_binary_info function
+	/*
+	 * we do this only for preview pipe because in fill_binary_info function
 	 * we assign vf_out res to out res, but for ISP internal processing, we need
 	 * the original out res. for video pipe, it has two output pins --- out and
-	 * vf_out, so it can keep these two resolutions already. */
+	 * vf_out, so it can keep these two resolutions already.
+	 */
 	if (binary->info->sp.pipeline.mode == IA_CSS_BINARY_MODE_PREVIEW &&
-	    (binary->vf_downscale_log2 > 0))
-	{
-		/* TODO: Remove this after preview output decimation is fixed
-		 * by configuring out&vf info fiels properly */
+	    (binary->vf_downscale_log2 > 0)) {
+		/*
+		 * TODO: Remove this after preview output decimation is fixed
+		 * by configuring out&vf info files properly
+		 */
 		sh_css_sp_stage.frames.out[0].info.padded_width
-		<<= binary->vf_downscale_log2;
+			<<= binary->vf_downscale_log2;
 		sh_css_sp_stage.frames.out[0].info.res.width
-		<<= binary->vf_downscale_log2;
+			<<= binary->vf_downscale_log2;
 		sh_css_sp_stage.frames.out[0].info.res.height
-		<<= binary->vf_downscale_log2;
+			<<= binary->vf_downscale_log2;
 	}
 	err = copy_isp_mem_if_to_ddr(binary);
 	if (err)
@@ -1064,12 +1035,10 @@ sh_css_sp_init_stage(struct ia_css_binary *binary,
 	return 0;
 }
 
-static int
-sp_init_stage(struct ia_css_pipeline_stage *stage,
-	      unsigned int pipe_num,
-	      bool xnr,
-	      unsigned int if_config_index,
-	      bool two_ppc) {
+static int sp_init_stage(struct ia_css_pipeline_stage *stage,
+			 unsigned int pipe_num, bool xnr,
+			 unsigned int if_config_index, bool two_ppc)
+{
 	struct ia_css_binary *binary;
 	const struct ia_css_fw_info *firmware;
 	const struct sh_css_binary_args *args;
@@ -1080,20 +1049,22 @@ sp_init_stage(struct ia_css_pipeline_stage *stage,
 	 */
 	const char *binary_name = "";
 	const struct ia_css_binary_xinfo *info = NULL;
-	/* note: the var below is made static as it is quite large;
-	   if it is not static it ends up on the stack which could
-	   cause issues for drivers
-	*/
+	/*
+	 * note: the var below is made static as it is quite large;
+	 * if it is not static it ends up on the stack which could
+	 * cause issues for drivers
+	 */
 	static struct ia_css_binary tmp_binary;
 	const struct ia_css_blob_info *blob_info = NULL;
 	struct ia_css_isp_param_css_segments isp_mem_if;
-	/* LA: should be ia_css_data, should not contain host pointer.
-	   However, CSS/DDR pointer is not available yet.
-	   Hack is to store it in params->ddr_ptrs and then copy it late in the SP just before vmem init.
-	   TODO: Call this after CSS/DDR allocation and store that pointer.
-	   Best is to allocate it at stage creation time together with host pointer.
-	   Remove vmem from params.
-	*/
+	/*
+	 * LA: should be ia_css_data, should not contain host pointer.
+	 * However, CSS/DDR pointer is not available yet.
+	 * Hack is to store it in params->ddr_ptrs and then copy it late in the SP just before vmem init.
+	 * TODO: Call this after CSS/DDR allocation and store that pointer.
+	 * Best is to allocate it at stage creation time together with host pointer.
+	 * Remove vmem from params.
+	 */
 	struct ia_css_isp_param_css_segments *mem_if = &isp_mem_if;
 
 	int err = 0;
@@ -1105,14 +1076,12 @@ sp_init_stage(struct ia_css_pipeline_stage *stage,
 	args = &stage->args;
 	stage_num = stage->stage_num;
 
-	if (binary)
-	{
+	if (binary) {
 		info = binary->info;
 		binary_name = (const char *)(info->blob->name);
 		blob_info = &info->blob->header.blob;
 		ia_css_init_memory_interface(mem_if, &binary->mem_params, &binary->css_params);
-	} else if (firmware)
-	{
+	} else if (firmware) {
 		const struct ia_css_frame_info *out_infos[IA_CSS_BINARY_MAX_OUTPUT_PORTS] = {NULL};
 
 		if (args->out_frame[0])
@@ -1120,49 +1089,37 @@ sp_init_stage(struct ia_css_pipeline_stage *stage,
 		info = &firmware->info.isp;
 		ia_css_binary_fill_info(info, false, false,
 					ATOMISP_INPUT_FORMAT_RAW_10,
-					args->in_frame  ? &args->in_frame->info  : NULL,
-					NULL,
-					out_infos,
-					args->out_vf_frame ? &args->out_vf_frame->info
-					: NULL,
-					&tmp_binary,
-					NULL,
-					-1, true);
+					args->in_frame ? &args->in_frame->info : NULL,
+					NULL, out_infos,
+					args->out_vf_frame ? &args->out_vf_frame->info : NULL,
+					&tmp_binary, NULL, -1, true);
 		binary = &tmp_binary;
 		binary->info = info;
 		binary_name = IA_CSS_EXT_ISP_PROG_NAME(firmware);
 		blob_info = &firmware->blob;
 		mem_if = (struct ia_css_isp_param_css_segments *)&firmware->mem_initializers;
-	} else
-	{
+	} else {
 		/* SP stage */
 		assert(stage->sp_func != IA_CSS_PIPELINE_NO_FUNC);
-		/* binary and blob_info are now NULL.
-		   These will be passed to sh_css_sp_init_stage
-		   and dereferenced there, so passing a NULL
-		   pointer is no good. return an error */
+		/*
+		 * binary and blob_info are now NULL.
+		 * These will be passed to sh_css_sp_init_stage
+		 * and dereferenced there, so passing a NULL
+		 * pointer is no good. return an error
+		 */
 		return -EINVAL;
 	}
 
-	err = sh_css_sp_init_stage(binary,
-				   (const char *)binary_name,
-				   blob_info,
-				   args,
-				   pipe_num,
-				   stage_num,
-				   xnr,
-				   mem_if,
-				   if_config_index,
-				   two_ppc);
+	err = sh_css_sp_init_stage(binary, (const char *)binary_name, blob_info,
+				   args, pipe_num, stage_num, xnr, mem_if,
+				   if_config_index, two_ppc);
 	return err;
 }
 
-static void
-sp_init_sp_stage(struct ia_css_pipeline_stage *stage,
-		 unsigned int pipe_num,
-		 bool two_ppc,
-		 enum sh_css_pipe_config_override copy_ovrd,
-		 unsigned int if_config_index)
+static void sp_init_sp_stage(struct ia_css_pipeline_stage *stage,
+			     unsigned int pipe_num, bool two_ppc,
+			     enum sh_css_pipe_config_override copy_ovrd,
+			     unsigned int if_config_index)
 {
 	const struct sh_css_binary_args *args = &stage->args;
 
@@ -1187,14 +1144,9 @@ sp_init_sp_stage(struct ia_css_pipeline_stage *stage,
 	}
 }
 
-void
-sh_css_sp_init_pipeline(struct ia_css_pipeline *me,
-			enum ia_css_pipe_id id,
-			u8 pipe_num,
-			bool xnr,
-			bool two_ppc,
-			bool continuous,
-			bool offline,
+void sh_css_sp_init_pipeline(struct ia_css_pipeline *me,
+			enum ia_css_pipe_id id, u8 pipe_num, bool xnr,
+			bool two_ppc, bool continuous, bool offline,
 			unsigned int required_bds_factor,
 			enum sh_css_pipe_config_override copy_ovrd,
 			enum ia_css_input_mode input_mode,
@@ -1204,8 +1156,8 @@ sh_css_sp_init_pipeline(struct ia_css_pipeline *me,
 			const struct ia_css_coordinate
 			*internal_frame_origin_bqs_on_sctbl, /* Origin of internal frame
 							positioned on shading table at shading correction in ISP. */
-			const struct ia_css_isp_parameters *params
-		       ) {
+			const struct ia_css_isp_parameters *params)
+{
 	/* Get first stage */
 	struct ia_css_pipeline_stage *stage        = NULL;
 	struct ia_css_binary	     *first_binary = NULL;
@@ -1223,17 +1175,13 @@ sh_css_sp_init_pipeline(struct ia_css_pipeline *me,
 	first_binary = me->stages->binary;
 
 	if (input_mode == IA_CSS_INPUT_MODE_SENSOR ||
-	    input_mode == IA_CSS_INPUT_MODE_BUFFERED_SENSOR)
-	{
+	    input_mode == IA_CSS_INPUT_MODE_BUFFERED_SENSOR) {
 		assert(port_id < N_MIPI_PORT_ID);
 		if (port_id >= N_MIPI_PORT_ID) /* should not happen but KW does not know */
 			return; /* we should be able to return an error */
 		if_config_index  = (uint8_t)(port_id - MIPI_PORT0_ID);
-	} else if (input_mode == IA_CSS_INPUT_MODE_MEMORY)
-	{
-		if_config_index = SH_CSS_IF_CONFIG_NOT_NEEDED;
-	} else
-	{
+	} else if (input_mode == IA_CSS_INPUT_MODE_MEMORY) {
+		if_config_index = SH_CSS_IF_CONFIG_NOT_NEEDED; } else {
 		if_config_index = 0x0;
 	}
 
@@ -1241,15 +1189,13 @@ sh_css_sp_init_pipeline(struct ia_css_pipeline *me,
 	memset(&sh_css_sp_group.pipe[thread_id], 0, sizeof(struct sh_css_sp_pipeline));
 
 	/* Count stages */
-	for (stage = me->stages, num = 0; stage; stage = stage->next, num++)
-	{
+	for (stage = me->stages, num = 0; stage; stage = stage->next, num++) {
 		stage->stage_num = num;
 		ia_css_debug_pipe_graph_dump_stage(stage, id);
 	}
 	me->num_stages = num;
 
-	if (first_binary)
-	{
+	if (first_binary) {
 		/* Init pipeline data */
 		sh_css_sp_init_group(two_ppc, first_binary->input_format,
 				     offline, if_config_index);
@@ -1270,21 +1216,23 @@ sh_css_sp_init_pipeline(struct ia_css_pipeline *me,
 	sh_css_sp_group.pipe[thread_id].num_execs = me->num_execs;
 	sh_css_sp_group.pipe[thread_id].pipe_qos_config = me->pipe_qos_config;
 	sh_css_sp_group.pipe[thread_id].required_bds_factor = required_bds_factor;
-	sh_css_sp_group.pipe[thread_id].input_system_mode
-	= (uint32_t)input_mode;
+	sh_css_sp_group.pipe[thread_id].input_system_mode = (uint32_t)input_mode;
 	sh_css_sp_group.pipe[thread_id].port_id = port_id;
 	sh_css_sp_group.pipe[thread_id].dvs_frame_delay = (uint32_t)me->dvs_frame_delay;
 
-	/* TODO: next indicates from which queues parameters need to be
-		 sampled, needs checking/improvement */
-	if (ia_css_pipeline_uses_params(me))
-	{
+	/*
+	 * TODO: next indicates from which queues parameters need to be
+	 * sampled, needs checking/improvement
+	 */
+	if (ia_css_pipeline_uses_params(me)) {
 		sh_css_sp_group.pipe[thread_id].pipe_config =
 		SH_CSS_PIPE_CONFIG_SAMPLE_PARAMS << thread_id;
 	}
 
-	/* For continuous use-cases, SP copy is responsible for sampling the
-	 * parameters */
+	/*
+	 * For continuous use-cases, SP copy is responsible for sampling the
+	 * parameters
+	 */
 	if (continuous)
 		sh_css_sp_group.pipe[thread_id].pipe_config = 0;
 
@@ -1293,14 +1241,12 @@ sh_css_sp_init_pipeline(struct ia_css_pipeline *me,
 	pipe = find_pipe_by_num(pipe_num);
 	assert(pipe);
 	if (!pipe)
-	{
 		return;
-	}
+
 	sh_css_sp_group.pipe[thread_id].scaler_pp_lut = sh_css_pipe_get_pp_gdc_lut(pipe);
 
 #if defined(SH_CSS_ENABLE_METADATA)
-	if (md_info && md_info->size > 0)
-	{
+	if (md_info && md_info->size > 0) {
 		sh_css_sp_group.pipe[thread_id].metadata.width  = md_info->resolution.width;
 		sh_css_sp_group.pipe[thread_id].metadata.height = md_info->resolution.height;
 		sh_css_sp_group.pipe[thread_id].metadata.stride = md_info->stride;
@@ -1316,8 +1262,7 @@ sh_css_sp_init_pipeline(struct ia_css_pipeline *me,
 
 #if defined(SH_CSS_ENABLE_PER_FRAME_PARAMS)
 	sh_css_sp_group.pipe[thread_id].output_frame_queue_id = (uint32_t)SH_CSS_INVALID_QUEUE_ID;
-	if (pipe_id != IA_CSS_PIPE_ID_COPY)
-	{
+	if (pipe_id != IA_CSS_PIPE_ID_COPY) {
 		ia_css_query_internal_queue_id(IA_CSS_BUFFER_TYPE_OUTPUT_FRAME, thread_id,
 					       (enum sh_css_queue_id *)(
 						   &sh_css_sp_group.pipe[thread_id].output_frame_queue_id));
@@ -1325,18 +1270,17 @@ sh_css_sp_init_pipeline(struct ia_css_pipeline *me,
 #endif
 
 	if (IS_ISP2401) {
-		/* For the shading correction type 1 (the legacy shading table conversion in css is not used),
-		* the parameters are passed to the isp for the shading table centering.
-		*/
+		/*
+		 * For the shading correction type 1 (the legacy shading table conversion in css is not used),
+		 * the parameters are passed to the isp for the shading table centering.
+		 */
 		if (internal_frame_origin_bqs_on_sctbl &&
-		    params && params->shading_settings.enable_shading_table_conversion == 0)
-		{
+		    params && params->shading_settings.enable_shading_table_conversion == 0) {
 			sh_css_sp_group.pipe[thread_id].shading.internal_frame_origin_x_bqs_on_sctbl
 			= (uint32_t)internal_frame_origin_bqs_on_sctbl->x;
 			sh_css_sp_group.pipe[thread_id].shading.internal_frame_origin_y_bqs_on_sctbl
 			= (uint32_t)internal_frame_origin_bqs_on_sctbl->y;
-		} else
-		{
+		} else {
 			sh_css_sp_group.pipe[thread_id].shading.internal_frame_origin_x_bqs_on_sctbl =
 			0;
 			sh_css_sp_group.pipe[thread_id].shading.internal_frame_origin_y_bqs_on_sctbl =
@@ -1347,8 +1291,7 @@ sh_css_sp_init_pipeline(struct ia_css_pipeline *me,
 	IA_CSS_LOG("pipe_id %d port_config %08x",
 		   pipe_id, sh_css_sp_group.pipe[thread_id].inout_port_config);
 
-	for (stage = me->stages, num = 0; stage; stage = stage->next, num++)
-	{
+	for (stage = me->stages, num = 0; stage; stage = stage->next, num++) {
 		sh_css_sp_group.pipe[thread_id].num_stages++;
 		if (is_sp_stage(stage)) {
 			sp_init_sp_stage(stage, pipe_num, two_ppc,
@@ -1370,8 +1313,7 @@ sh_css_sp_init_pipeline(struct ia_css_pipeline *me,
 	store_sp_group_data();
 }
 
-void
-sh_css_sp_uninit_pipeline(unsigned int pipe_num)
+void sh_css_sp_uninit_pipeline(unsigned int pipe_num)
 {
 	unsigned int thread_id;
 
@@ -1399,8 +1341,8 @@ bool sh_css_write_host2sp_command(enum host2sp_commands host2sp_command)
 	return (last_cmd == host2sp_cmd_ready);
 }
 
-enum host2sp_commands
-sh_css_read_host2sp_command(void) {
+enum host2sp_commands sh_css_read_host2sp_command(void)
+{
 	unsigned int HIVE_ADDR_host_sp_com = sh_css_sp_fw.info.sp.host_sp_com;
 	unsigned int offset = (unsigned int)offsetof(struct host_sp_communication, host2sp_command)
 	/ sizeof(int);
@@ -1412,15 +1354,14 @@ sh_css_read_host2sp_command(void) {
  * Frame data is no longer part of the sp_stage structure but part of a
  * separate structure. The aim is to make the sp_data struct static
  * (it defines a pipeline) and that the dynamic (per frame) data is stored
- * separetly.
+ * separately.
  *
  * This function must be called first every where were you start constructing
  * a new pipeline by defining one or more stages with use of variable
  * sh_css_sp_stage. Even the special cases like accelerator and copy_frame
  * These have a pipeline of just 1 stage.
  */
-void
-sh_css_init_host2sp_frame_data(void)
+void sh_css_init_host2sp_frame_data(void)
 {
 	/* Clean table */
 	unsigned int HIVE_ADDR_host_sp_com = sh_css_sp_fw.info.sp.host_sp_com;
@@ -1438,11 +1379,9 @@ sh_css_init_host2sp_frame_data(void)
  * @brief Update the offline frame information in host_sp_communication.
  * Refer to "sh_css_sp.h" for more details.
  */
-void
-sh_css_update_host2sp_offline_frame(
-    unsigned int frame_num,
-    struct ia_css_frame *frame,
-    struct ia_css_metadata *metadata)
+void sh_css_update_host2sp_offline_frame(unsigned int frame_num,
+					 struct ia_css_frame *frame,
+					 struct ia_css_metadata *metadata)
 {
 	unsigned int HIVE_ADDR_host_sp_com;
 	unsigned int offset;
@@ -1469,10 +1408,8 @@ sh_css_update_host2sp_offline_frame(
  * @brief Update the mipi frame information in host_sp_communication.
  * Refer to "sh_css_sp.h" for more details.
  */
-void
-sh_css_update_host2sp_mipi_frame(
-    unsigned int frame_num,
-    struct ia_css_frame *frame)
+void sh_css_update_host2sp_mipi_frame(unsigned int frame_num,
+				      struct ia_css_frame *frame)
 {
 	unsigned int HIVE_ADDR_host_sp_com;
 	unsigned int offset;
@@ -1495,10 +1432,8 @@ sh_css_update_host2sp_mipi_frame(
  * @brief Update the mipi metadata information in host_sp_communication.
  * Refer to "sh_css_sp.h" for more details.
  */
-void
-sh_css_update_host2sp_mipi_metadata(
-    unsigned int frame_num,
-    struct ia_css_metadata *metadata)
+void sh_css_update_host2sp_mipi_metadata(unsigned int frame_num,
+					 struct ia_css_metadata *metadata)
 {
 	unsigned int HIVE_ADDR_host_sp_com;
 	unsigned int o;
@@ -1515,8 +1450,7 @@ sh_css_update_host2sp_mipi_metadata(
 			    metadata ? metadata->address : 0);
 }
 
-void
-sh_css_update_host2sp_num_mipi_frames(unsigned int num_frames)
+void sh_css_update_host2sp_num_mipi_frames(unsigned int num_frames)
 {
 	unsigned int HIVE_ADDR_host_sp_com;
 	unsigned int offset;
@@ -1552,16 +1486,15 @@ sh_css_update_host2sp_cont_num_raw_frames(unsigned int num_frames,
 						      host2sp_cont_extra_num_raw_frames)
 			       / sizeof(int);
 		store_sp_array_uint(host_sp_com, offset_extra, extra_num_frames);
-	} else
+	} else {
 		offset = (unsigned int)offsetof(struct host_sp_communication,
 						host2sp_cont_target_num_raw_frames)
 			 / sizeof(int);
-
+	}
 	store_sp_array_uint(host_sp_com, offset, num_frames);
 }
 
-void
-sh_css_event_init_irq_mask(void)
+void sh_css_event_init_irq_mask(void)
 {
 	int i;
 	unsigned int HIVE_ADDR_host_sp_com = sh_css_sp_fw.info.sp.host_sp_com;
@@ -1586,7 +1519,8 @@ sh_css_event_init_irq_mask(void)
 int
 ia_css_pipe_set_irq_mask(struct ia_css_pipe *pipe,
 			 unsigned int or_mask,
-			 unsigned int and_mask) {
+			 unsigned int and_mask)
+{
 	unsigned int HIVE_ADDR_host_sp_com = sh_css_sp_fw.info.sp.host_sp_com;
 	unsigned int offset;
 	struct sh_css_event_irq_mask event_irq_mask;
@@ -1625,7 +1559,8 @@ ia_css_pipe_set_irq_mask(struct ia_css_pipe *pipe,
 int
 ia_css_event_get_irq_mask(const struct ia_css_pipe *pipe,
 			  unsigned int *or_mask,
-			  unsigned int *and_mask) {
+			  unsigned int *and_mask)
+{
 	unsigned int HIVE_ADDR_host_sp_com = sh_css_sp_fw.info.sp.host_sp_com;
 	unsigned int offset;
 	struct sh_css_event_irq_mask event_irq_mask;
-- 
2.30.2



_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


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

* [PATCH 5/5] staging: media: atomisp: code formatting changes sh_css_version.c
  2021-05-01  6:43 [PATCH 0/5] staging: media: atomisp: code formatting changes Deepak R Varma
                   ` (3 preceding siblings ...)
  2021-05-01  6:47 ` [PATCH 4/5] staging: media: atomisp: code formatting changes sh_css_sp.c Deepak R Varma
@ 2021-05-01  6:48 ` Deepak R Varma
  2021-05-20 19:06   ` [PATCH RESEND " Deepak R Varma
  2021-05-20 19:00 ` [PATCH RESEND 0/5] staging: media: atomisp: code formatting changes Deepak R Varma
  2021-06-12 16:43 ` Deepak R Varma
  6 siblings, 1 reply; 15+ messages in thread
From: Deepak R Varma @ 2021-05-01  6:48 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Sakari Ailus, Greg Kroah-Hartman
  Cc: devel, drv, linux-kernel, linux-media

Trivial code reformatting changes done according to the coding
style guidelines. These code changes overall improve code readability
and also address chackpatch complaints.

Signed-off-by: Deepak R Varma <drv@mailo.com>
---
 drivers/staging/media/atomisp/pci/sh_css_version.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/sh_css_version.c b/drivers/staging/media/atomisp/pci/sh_css_version.c
index fa6de61e4995..f038c61a8499 100644
--- a/drivers/staging/media/atomisp/pci/sh_css_version.c
+++ b/drivers/staging/media/atomisp/pci/sh_css_version.c
@@ -20,8 +20,8 @@
 #include "ia_css_err.h"
 #include "sh_css_firmware.h"
 
-int
-ia_css_get_version(char *version, int max_size) {
+int ia_css_get_version(char *version, int max_size)
+{
 	char *css_version;
 
 	if (!IS_ISP2401)
-- 
2.30.2



_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* [PATCH RESEND 0/5] staging: media: atomisp: code formatting changes
  2021-05-01  6:43 [PATCH 0/5] staging: media: atomisp: code formatting changes Deepak R Varma
                   ` (4 preceding siblings ...)
  2021-05-01  6:48 ` [PATCH 5/5] staging: media: atomisp: code formatting changes sh_css_version.c Deepak R Varma
@ 2021-05-20 19:00 ` Deepak R Varma
  2021-06-12 16:43 ` Deepak R Varma
  6 siblings, 0 replies; 15+ messages in thread
From: Deepak R Varma @ 2021-05-20 19:00 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Sakari Ailus, Greg Kroah-Hartman
  Cc: devel, drv, linux-kernel, linux-media

This patch set overall improves the code organisation and readability of
the files of atomisp drivers. There are several complaints reported by
checkpatch including ERROR and WARNING types on the files under atomisp/pci
directory.

The changes are proposed on a per file basis since there are many
issues to be addressed in each individual file. The patches are built
on the media_tree/for-v5.14-out1 tree/branch.


Deepak R Varma (5):
  staging: media: atomisp: code formatting changes atomisp_csi2.c
  staging: media: atomisp: code formatting changes sh_css_mipi.c
  staging: media: atomisp: code formatting changes sh_css_params.c
  staging: media: atomisp: code formatting changes sh_css_sp.c
  staging: media: atomisp: code formatting changes sh_css_version.c

 .../staging/media/atomisp/pci/atomisp_csi2.c  |  72 +-
 .../staging/media/atomisp/pci/sh_css_mipi.c   | 170 ++--
 .../staging/media/atomisp/pci/sh_css_params.c | 929 +++++++++---------
 drivers/staging/media/atomisp/pci/sh_css_sp.c | 471 ++++-----
 .../media/atomisp/pci/sh_css_version.c        |   4 +-
 5 files changed, 754 insertions(+), 892 deletions(-)

-- 
2.30.2



_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* [PATCH RESEND 1/5] staging: media: atomisp: code formatting changes atomisp_csi2.c
  2021-05-01  6:44 ` [PATCH 1/5] staging: media: atomisp: code formatting changes atomisp_csi2.c Deepak R Varma
@ 2021-05-20 19:02   ` Deepak R Varma
  0 siblings, 0 replies; 15+ messages in thread
From: Deepak R Varma @ 2021-05-20 19:02 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Sakari Ailus, Greg Kroah-Hartman
  Cc: devel, drv, linux-kernel, linux-media

Several trivial code reformatting changes done according to the coding
style guidelines. These changes improves code organisation and readability
and also 4 address many chackpatch error, warning and check complaints.

Signed-off-by: Deepak R Varma <drv@mailo.com>
---
 .../staging/media/atomisp/pci/atomisp_csi2.c  | 72 +++++++++----------
 1 file changed, 35 insertions(+), 37 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp_csi2.c b/drivers/staging/media/atomisp/pci/atomisp_csi2.c
index 060b8765ae96..f33a08b2564f 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_csi2.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_csi2.c
@@ -22,14 +22,12 @@
 #include "atomisp_internal.h"
 #include "atomisp-regs.h"
 
-static struct v4l2_mbus_framefmt *__csi2_get_format(struct
-	atomisp_mipi_csi2_device
-	* csi2,
-	struct
-	v4l2_subdev_pad_config *cfg,
-	enum
-	v4l2_subdev_format_whence
-	which, unsigned int pad) {
+static struct
+v4l2_mbus_framefmt *__csi2_get_format(struct atomisp_mipi_csi2_device *csi2,
+				      struct v4l2_subdev_pad_config *cfg,
+				      enum v4l2_subdev_format_whence which,
+				      unsigned int pad)
+{
 	if (which == V4L2_SUBDEV_FORMAT_TRY)
 		return v4l2_subdev_get_try_format(&csi2->subdev, cfg, pad);
 	else
@@ -42,7 +40,7 @@ static struct v4l2_mbus_framefmt *__csi2_get_format(struct
  * @fh     : V4L2 subdev file handle
  * @code   : pointer to v4l2_subdev_pad_mbus_code_enum structure
  * return -EINVAL or zero on success
-*/
+ */
 static int csi2_enum_mbus_code(struct v4l2_subdev *sd,
 			       struct v4l2_subdev_pad_config *cfg,
 			       struct v4l2_subdev_mbus_code_enum *code)
@@ -68,7 +66,7 @@ static int csi2_enum_mbus_code(struct v4l2_subdev *sd,
  * @pad: pad num
  * @fmt: pointer to v4l2 format structure
  * return -EINVAL or zero on success
-*/
+ */
 static int csi2_get_format(struct v4l2_subdev *sd,
 			   struct v4l2_subdev_pad_config *cfg,
 			   struct v4l2_subdev_format *fmt)
@@ -101,12 +99,12 @@ int atomisp_csi2_set_ffmt(struct v4l2_subdev *sd,
 		else
 			actual_ffmt->code = atomisp_in_fmt_conv[0].code;
 
-		actual_ffmt->width = clamp_t(
-					 u32, ffmt->width, ATOM_ISP_MIN_WIDTH,
-					 ATOM_ISP_MAX_WIDTH);
-		actual_ffmt->height = clamp_t(
-					  u32, ffmt->height, ATOM_ISP_MIN_HEIGHT,
-					  ATOM_ISP_MAX_HEIGHT);
+		actual_ffmt->width = clamp_t(u32, ffmt->width,
+					     ATOM_ISP_MIN_WIDTH,
+					     ATOM_ISP_MAX_WIDTH);
+		actual_ffmt->height = clamp_t(u32, ffmt->height,
+					      ATOM_ISP_MIN_HEIGHT,
+					      ATOM_ISP_MAX_HEIGHT);
 
 		tmp_ffmt = *ffmt = *actual_ffmt;
 
@@ -127,7 +125,7 @@ int atomisp_csi2_set_ffmt(struct v4l2_subdev *sd,
  * @pad: pad num
  * @fmt: pointer to v4l2 format structure
  * return -EINVAL or zero on success
-*/
+ */
 static int csi2_set_format(struct v4l2_subdev *sd,
 			   struct v4l2_subdev_pad_config *cfg,
 			   struct v4l2_subdev_format *fmt)
@@ -142,7 +140,7 @@ static int csi2_set_format(struct v4l2_subdev *sd,
  * @enable: Enable/disable stream (1/0)
  *
  * Return 0 on success or a negative error code otherwise.
-*/
+ */
 static int csi2_set_stream(struct v4l2_subdev *sd, int enable)
 {
 	return 0;
@@ -179,7 +177,7 @@ static const struct v4l2_subdev_ops csi2_ops = {
  * @remote : Pointer to remote pad array
  * @flags  : Link flags
  * return -EINVAL or zero on success
-*/
+ */
 static int csi2_link_setup(struct media_entity *entity,
 			   const struct media_pad *local,
 			   const struct media_pad *remote, u32 flags)
@@ -217,10 +215,10 @@ static const struct media_entity_operations csi2_media_ops = {
 };
 
 /*
-* ispcsi2_init_entities - Initialize subdev and media entity.
-* @csi2: Pointer to ispcsi2 structure.
-* return -ENOMEM or zero on success
-*/
+ * ispcsi2_init_entities - Initialize subdev and media entity.
+ * @csi2: Pointer to ispcsi2 structure.
+ * return -ENOMEM or zero on success
+ */
 static int mipi_csi2_init_entities(struct atomisp_mipi_csi2_device *csi2,
 				   int port)
 {
@@ -244,9 +242,8 @@ static int mipi_csi2_init_entities(struct atomisp_mipi_csi2_device *csi2,
 	if (ret < 0)
 		return ret;
 
-	csi2->formats[CSI2_PAD_SINK].code =
-	    csi2->formats[CSI2_PAD_SOURCE].code =
-		atomisp_in_fmt_conv[0].code;
+	csi2->formats[CSI2_PAD_SINK].code = atomisp_in_fmt_conv[0].code;
+	csi2->formats[CSI2_PAD_SOURCE].code = atomisp_in_fmt_conv[0].code;
 
 	return 0;
 }
@@ -374,21 +371,22 @@ static void atomisp_csi2_configure_isp2401(struct atomisp_sub_device *asd)
 	    (isp->inputs[asd->input_curr].camera->ctrl_handler, &ctrl) == 0)
 		mipi_freq = ctrl.value;
 
-	clk_termen = atomisp_csi2_configure_calc(coeff_clk_termen,
-		     mipi_freq, TERMEN_DEFAULT);
-	clk_settle = atomisp_csi2_configure_calc(coeff_clk_settle,
-		     mipi_freq, SETTLE_DEFAULT);
-	dat_termen = atomisp_csi2_configure_calc(coeff_dat_termen,
-		     mipi_freq, TERMEN_DEFAULT);
-	dat_settle = atomisp_csi2_configure_calc(coeff_dat_settle,
-		     mipi_freq, SETTLE_DEFAULT);
+	clk_termen = atomisp_csi2_configure_calc(coeff_clk_termen, mipi_freq,
+						 TERMEN_DEFAULT);
+	clk_settle = atomisp_csi2_configure_calc(coeff_clk_settle, mipi_freq,
+						 SETTLE_DEFAULT);
+	dat_termen = atomisp_csi2_configure_calc(coeff_dat_termen, mipi_freq,
+						 TERMEN_DEFAULT);
+	dat_settle = atomisp_csi2_configure_calc(coeff_dat_settle, mipi_freq,
+						 SETTLE_DEFAULT);
+
 	for (n = 0; n < csi2_port_lanes[port] + 1; n++) {
 		hrt_address base = csi2_port_base[port] + csi2_lane_base[n];
 
 		atomisp_css2_hw_store_32(base + CSI2_REG_RX_CSI_DLY_CNT_TERMEN,
-				     n == 0 ? clk_termen : dat_termen);
+					 n == 0 ? clk_termen : dat_termen);
 		atomisp_css2_hw_store_32(base + CSI2_REG_RX_CSI_DLY_CNT_SETTLE,
-				     n == 0 ? clk_settle : dat_settle);
+					 n == 0 ? clk_settle : dat_settle);
 	}
 }
 
@@ -400,7 +398,7 @@ void atomisp_csi2_configure(struct atomisp_sub_device *asd)
 
 /*
  * atomisp_mipi_csi2_cleanup - Routine for module driver cleanup
-*/
+ */
 void atomisp_mipi_csi2_cleanup(struct atomisp_device *isp)
 {
 }
-- 
2.30.2



_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* [PATCH RESEND 2/5] staging: media: atomisp: code formatting changes sh_css_mipi.c
  2021-05-01  6:45 ` [PATCH 2/5] staging: media: atomisp: code formatting changes sh_css_mipi.c Deepak R Varma
@ 2021-05-20 19:03   ` Deepak R Varma
  0 siblings, 0 replies; 15+ messages in thread
From: Deepak R Varma @ 2021-05-20 19:03 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Sakari Ailus, Greg Kroah-Hartman
  Cc: devel, drv, linux-kernel, linux-media

Several trivial code reformatting changes done according to the coding
style guidelines. These code changes overall improve code organisation
and readability and also address many chackpatch error, warning and
check complaints.

Signed-off-by: Deepak R Varma <drv@mailo.com>
---
 .../staging/media/atomisp/pci/sh_css_mipi.c   | 170 ++++++++----------
 1 file changed, 76 insertions(+), 94 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/sh_css_mipi.c b/drivers/staging/media/atomisp/pci/sh_css_mipi.c
index 3f34cc81be87..1ae6c07d4199 100644
--- a/drivers/staging/media/atomisp/pci/sh_css_mipi.c
+++ b/drivers/staging/media/atomisp/pci/sh_css_mipi.c
@@ -37,7 +37,7 @@ ref_count_mipi_allocation[N_CSI_PORTS]; /* Initialized in mipi_init */
  * Check if a source port or TPG/PRBS ID is valid
  */
 static bool ia_css_mipi_is_source_port_valid(struct ia_css_pipe *pipe,
-	unsigned int *pport)
+					     unsigned int *pport)
 {
 	bool ret = true;
 	unsigned int port = 0;
@@ -74,7 +74,8 @@ static bool ia_css_mipi_is_source_port_valid(struct ia_css_pipe *pipe,
 	return ret;
 }
 
-/* Assumptions:
+/*
+ * Assumptions:
  *	- A line is multiple of 4 bytes = 1 word.
  *	- Each frame has SOF and EOF (each 1 word).
  *	- Each line has format header and optionally SOL and EOL (each 1 word).
@@ -91,7 +92,8 @@ ia_css_mipi_frame_calculate_size(const unsigned int width,
 				 const enum atomisp_input_format format,
 				 const bool hasSOLandEOL,
 				 const unsigned int embedded_data_size_words,
-				 unsigned int *size_mem_words) {
+				 unsigned int *size_mem_words)
+{
 	int err = 0;
 
 	unsigned int bits_per_pixel = 0;
@@ -108,7 +110,8 @@ ia_css_mipi_frame_calculate_size(const unsigned int width,
 	unsigned int width_padded = width;
 
 #if defined(ISP2401)
-	/* The changes will be reverted as soon as RAW
+	/*
+	 * The changes will be reverted as soon as RAW
 	 * Buffers are deployed by the 2401 Input System
 	 * in the non-continuous use scenario.
 	 */
@@ -118,8 +121,7 @@ ia_css_mipi_frame_calculate_size(const unsigned int width,
 	IA_CSS_ENTER("padded_width=%d, height=%d, format=%d, hasSOLandEOL=%d, embedded_data_size_words=%d\n",
 		     width_padded, height, format, hasSOLandEOL, embedded_data_size_words);
 
-	switch (format)
-	{
+	switch (format) {
 	case ATOMISP_INPUT_FORMAT_RAW_6:		/* 4p, 3B, 24bits */
 		bits_per_pixel = 6;
 		break;
@@ -134,7 +136,8 @@ ia_css_mipi_frame_calculate_size(const unsigned int width,
 	case ATOMISP_INPUT_FORMAT_YUV420_10:		/* odd 4p, 5B, 40bits, even 4p, 10B, 80bits */
 	case ATOMISP_INPUT_FORMAT_RAW_10:		/* 4p, 5B, 40bits */
 #if !defined(HAS_NO_PACKED_RAW_PIXELS)
-		/* The changes will be reverted as soon as RAW
+		/*
+		 * The changes will be reverted as soon as RAW
 		 * Buffers are deployed by the 2401 Input System
 		 * in the non-continuous use scenario.
 		 */
@@ -176,33 +179,29 @@ ia_css_mipi_frame_calculate_size(const unsigned int width,
 	odd_line_bytes = (width_padded * bits_per_pixel + 7) >> 3; /* ceil ( bits per line / 8) */
 
 	/* Even lines for YUV420 formats are double in bits_per_pixel. */
-	if (format == ATOMISP_INPUT_FORMAT_YUV420_8
-	    || format == ATOMISP_INPUT_FORMAT_YUV420_10
-	    || format == ATOMISP_INPUT_FORMAT_YUV420_16)
-	{
-		even_line_bytes = (width_padded * 2 * bits_per_pixel + 7) >>
-			3; /* ceil ( bits per line / 8) */
-	} else
-	{
+	if (format == ATOMISP_INPUT_FORMAT_YUV420_8  ||
+	    format == ATOMISP_INPUT_FORMAT_YUV420_10 ||
+	    format == ATOMISP_INPUT_FORMAT_YUV420_16)
+		even_line_bytes = (width_padded * 2 * bits_per_pixel + 7) >> 3; /* ceil ( bits per line / 8) */
+	else
 		even_line_bytes = odd_line_bytes;
-	}
 
 	/*  a frame represented in memory:  ()- optional; data - payload words.
-	*  addr		0	1	2	3	4	5	6	7:
-	*  first	SOF	(SOL)	PACK_H	data	data	data	data	data
-	*		data	data	data	data	data	data	data	data
-	*		...
-	*		data	data	0	0	0	0	0	0
-	*  second	(EOL)	(SOL)	PACK_H	data	data	data	data	data
-	*		data	data	data	data	data	data	data	data
-	*		...
-	*		data	data	0	0	0	0	0	0
-	*  ...
-	*  last		(EOL)	EOF	0	0	0	0	0	0
-	*
-	*  Embedded lines are regular lines stored before the first and after
-	*  payload lines.
-	*/
+	 *  addr		0	1	2	3	4	5	6	7:
+	 *  first	SOF	(SOL)	PACK_H	data	data	data	data	data
+	 *		data	data	data	data	data	data	data	data
+	 *		...
+	 *		data	data	0	0	0	0	0	0
+	 *  second	(EOL)	(SOL)	PACK_H	data	data	data	data	data
+	 *		data	data	data	data	data	data	data	data
+	 *		...
+	 *		data	data	0	0	0	0	0	0
+	 *  ...
+	 *  last		(EOL)	EOF	0	0	0	0	0	0
+	 *
+	 *  Embedded lines are regular lines stored before the first and after
+	 *  payload lines.
+	 */
 
 	words_per_odd_line = (odd_line_bytes + 3) >> 2;
 	/* ceil(odd_line_bytes/4); word = 4 bytes */
@@ -220,11 +219,11 @@ ia_css_mipi_frame_calculate_size(const unsigned int width,
 	mem_words_for_EOF        = 1; /* last line consisit of the optional (EOL) and EOF */
 
 	mem_words = ((embedded_data_size_words + 7) >> 3) +
-	mem_words_for_first_line +
-	(((height + 1) >> 1) - 1) * mem_words_per_odd_line +
-	/* ceil (height/2) - 1 (first line is calculated separatelly) */
-	(height      >> 1) * mem_words_per_even_line + /* floor(height/2) */
-	mem_words_for_EOF;
+		      mem_words_for_first_line +
+		      (((height + 1) >> 1) - 1) * mem_words_per_odd_line +
+		      /* ceil (height/2) - 1 (first line is calculated separatelly) */
+		      (height >> 1) * mem_words_per_even_line + /* floor(height/2) */
+		      mem_words_for_EOF;
 
 	*size_mem_words = mem_words; /* ceil(words/8); mem word is 32B = 8words. */
 	/* Check if the above is still needed. */
@@ -236,7 +235,8 @@ ia_css_mipi_frame_calculate_size(const unsigned int width,
 #if !defined(ISP2401)
 int
 ia_css_mipi_frame_enable_check_on_size(const enum mipi_port_id port,
-				       const unsigned int	size_mem_words) {
+				       const unsigned int size_mem_words)
+{
 	u32 idx;
 
 	int err = -EBUSY;
@@ -245,12 +245,10 @@ ia_css_mipi_frame_enable_check_on_size(const enum mipi_port_id port,
 	OP___assert(size_mem_words != 0);
 
 	for (idx = 0; idx < IA_CSS_MIPI_SIZE_CHECK_MAX_NOF_ENTRIES_PER_PORT &&
-	     my_css.mipi_sizes_for_check[port][idx] != 0;
-	     idx++)   /* do nothing */
-	{
-	}
-	if (idx < IA_CSS_MIPI_SIZE_CHECK_MAX_NOF_ENTRIES_PER_PORT)
-	{
+	     my_css.mipi_sizes_for_check[port][idx] != 0;)
+		idx++;
+
+	if (idx < IA_CSS_MIPI_SIZE_CHECK_MAX_NOF_ENTRIES_PER_PORT) {
 		my_css.mipi_sizes_for_check[port][idx] = size_mem_words;
 		err = 0;
 	}
@@ -268,10 +266,9 @@ mipi_init(void)
 		ref_count_mipi_allocation[i] = 0;
 }
 
-int
-calculate_mipi_buff_size(
-    struct ia_css_stream_config *stream_cfg,
-    unsigned int *size_mem_words) {
+int calculate_mipi_buff_size(struct ia_css_stream_config *stream_cfg,
+			     unsigned int *size_mem_words)
+{
 #if !defined(ISP2401)
 	int err = -EINVAL;
 	(void)stream_cfg;
@@ -345,15 +342,11 @@ calculate_mipi_buff_size(
 	odd_line_bytes = (width_padded * bits_per_pixel + 7) >> 3; /* ceil ( bits per line / 8) */
 
 	/* Even lines for YUV420 formats are double in bits_per_pixel. */
-	if (format == ATOMISP_INPUT_FORMAT_YUV420_8
-	    || format == ATOMISP_INPUT_FORMAT_YUV420_10)
-	{
-		even_line_bytes = (width_padded * 2 * bits_per_pixel + 7) >>
-			3; /* ceil ( bits per line / 8) */
-	} else
-	{
+	if (format == ATOMISP_INPUT_FORMAT_YUV420_8 ||
+	    format == ATOMISP_INPUT_FORMAT_YUV420_10)
+		even_line_bytes = (width_padded * 2 * bits_per_pixel + 7) >> 3; /* ceil ( bits per line / 8) */
+	else
 		even_line_bytes = odd_line_bytes;
-	}
 
 	words_per_odd_line	 = (odd_line_bytes   + 3) >> 2;
 	/* ceil(odd_line_bytes/4); word = 4 bytes */
@@ -392,8 +385,8 @@ static bool buffers_needed(struct ia_css_pipe *pipe)
 }
 
 int
-allocate_mipi_frames(struct ia_css_pipe *pipe,
-		     struct ia_css_stream_info *info) {
+allocate_mipi_frames(struct ia_css_pipe *pipe, struct ia_css_stream_info *info)
+{
 	int err = -EINVAL;
 	unsigned int port;
 
@@ -402,8 +395,7 @@ allocate_mipi_frames(struct ia_css_pipe *pipe,
 
 	assert(pipe);
 	assert(pipe->stream);
-	if ((!pipe) || (!pipe->stream))
-	{
+	if (!pipe || !pipe->stream) {
 		ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE,
 				    "allocate_mipi_frames(%p) exit: pipe or stream is null.\n",
 				    pipe);
@@ -411,8 +403,7 @@ allocate_mipi_frames(struct ia_css_pipe *pipe,
 	}
 
 #ifdef ISP2401
-	if (pipe->stream->config.online)
-	{
+	if (pipe->stream->config.online) {
 		ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE,
 				    "allocate_mipi_frames(%p) exit: no buffers needed for 2401 pipe mode.\n",
 				    pipe);
@@ -443,27 +434,25 @@ allocate_mipi_frames(struct ia_css_pipe *pipe,
 	}
 
 #ifdef ISP2401
-	err = calculate_mipi_buff_size(
-	    &pipe->stream->config,
-	    &my_css.mipi_frame_size[port]);
+	err = calculate_mipi_buff_size(&pipe->stream->config,
+				       &my_css.mipi_frame_size[port]);
 #endif
 
 #if !defined(ISP2401)
-	if (ref_count_mipi_allocation[port] != 0)
-	{
+	if (ref_count_mipi_allocation[port] != 0) {
 		ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE,
 				    "allocate_mipi_frames(%p) exit: already allocated for this port (port=%d).\n",
 				    pipe, port);
 		return 0;
 	}
 #else
-	/* 2401 system allows multiple streams to use same physical port. This is not
+	/*
+	 * 2401 system allows multiple streams to use same physical port. This is not
 	 * true for 2400 system. Currently 2401 uses MIPI buffers as a temporary solution.
 	 * TODO AM: Once that is changed (removed) this code should be removed as well.
 	 * In that case only 2400 related code should remain.
 	 */
-	if (ref_count_mipi_allocation[port] != 0)
-	{
+	if (ref_count_mipi_allocation[port] != 0) {
 		ref_count_mipi_allocation[port]++;
 		ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE,
 				    "allocate_mipi_frames(%p) leave: nothing to do, already allocated for this port (port=%d).\n",
@@ -481,8 +470,7 @@ allocate_mipi_frames(struct ia_css_pipe *pipe,
 	{ /* limit the scope of i,j */
 		unsigned int i, j;
 
-		for (i = 0; i < my_css.num_mipi_frames[port]; i++)
-		{
+		for (i = 0; i < my_css.num_mipi_frames[port]; i++) {
 			/* free previous frame */
 			if (my_css.mipi_frames[port][i]) {
 				ia_css_frame_free(my_css.mipi_frames[port][i]);
@@ -534,8 +522,8 @@ allocate_mipi_frames(struct ia_css_pipe *pipe,
 	return err;
 }
 
-int
-free_mipi_frames(struct ia_css_pipe *pipe) {
+int free_mipi_frames(struct ia_css_pipe *pipe)
+{
 	int err = -EINVAL;
 	unsigned int port;
 
@@ -543,8 +531,7 @@ free_mipi_frames(struct ia_css_pipe *pipe) {
 			    "free_mipi_frames(%p) enter:\n", pipe);
 
 	/* assert(pipe != NULL); TEMP: TODO: Should be assert only. */
-	if (pipe)
-	{
+	if (pipe) {
 		assert(pipe->stream);
 		if ((!pipe) || (!pipe->stream)) {
 			ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE,
@@ -606,10 +593,10 @@ free_mipi_frames(struct ia_css_pipe *pipe) {
 
 				ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE,
 						    "free_mipi_frames(%p) exit (deallocated).\n", pipe);
-			}
+			} else {
 #if defined(ISP2401)
-			else {
-				/* 2401 system allows multiple streams to use same physical port. This is not
+				/*
+				 * 2401 system allows multiple streams to use same physical port. This is not
 				 * true for 2400 system. Currently 2401 uses MIPI buffers as a temporary solution.
 				 * TODO AM: Once that is changed (removed) this code should be removed as well.
 				 * In that case only 2400 related code should remain.
@@ -617,11 +604,10 @@ free_mipi_frames(struct ia_css_pipe *pipe) {
 				ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE,
 						    "free_mipi_frames(%p) leave: nothing to do, other streams still use this port (port=%d).\n",
 						    pipe, port);
-			}
 #endif
+			}
 		}
-	} else   /* pipe ==NULL */
-	{
+	} else { /* pipe ==NULL */
 		/* AM TEMP: free-ing all mipi buffers just like a legacy code. */
 		for (port = CSI_PORT0_ID; port < N_CSI_PORTS; port++) {
 			unsigned int i;
@@ -644,8 +630,8 @@ free_mipi_frames(struct ia_css_pipe *pipe) {
 	return 0;
 }
 
-int
-send_mipi_frames(struct ia_css_pipe *pipe) {
+int send_mipi_frames(struct ia_css_pipe *pipe)
+{
 	int err = -EINVAL;
 	unsigned int i;
 #ifndef ISP2401
@@ -658,8 +644,7 @@ send_mipi_frames(struct ia_css_pipe *pipe) {
 
 	assert(pipe);
 	assert(pipe->stream);
-	if (!pipe || !pipe->stream)
-	{
+	if (!pipe || !pipe->stream) {
 		IA_CSS_ERROR("pipe or stream is null");
 		return -EINVAL;
 	}
@@ -686,8 +671,7 @@ send_mipi_frames(struct ia_css_pipe *pipe) {
 	}
 
 	/* Hand-over the SP-internal mipi buffers */
-	for (i = 0; i < my_css.num_mipi_frames[port]; i++)
-	{
+	for (i = 0; i < my_css.num_mipi_frames[port]; i++) {
 		/* Need to include the ofset for port. */
 		sh_css_update_host2sp_mipi_frame(port * NUM_MIPI_FRAMES_PER_STREAM + i,
 						 my_css.mipi_frames[port][i]);
@@ -700,18 +684,16 @@ send_mipi_frames(struct ia_css_pipe *pipe) {
 	 * Send an event to inform the SP
 	 * that all MIPI frames are passed.
 	 **********************************/
-	if (!sh_css_sp_is_running())
-	{
+	if (!sh_css_sp_is_running()) {
 		/* SP is not running. The queues are not valid */
 		IA_CSS_ERROR("sp is not running");
 		return err;
 	}
 
-	ia_css_bufq_enqueue_psys_event(
-	    IA_CSS_PSYS_SW_EVENT_MIPI_BUFFERS_READY,
-	    (uint8_t)port,
-	    (uint8_t)my_css.num_mipi_frames[port],
-	    0 /* not used */);
+	ia_css_bufq_enqueue_psys_event(IA_CSS_PSYS_SW_EVENT_MIPI_BUFFERS_READY,
+				       (uint8_t)port,
+				       (uint8_t)my_css.num_mipi_frames[port],
+				       0 /* not used */);
 	IA_CSS_LEAVE_ERR_PRIVATE(0);
 	return 0;
 }
-- 
2.30.2



_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* [PATCH RESEND 3/5] staging: media: atomisp: code formatting changes sh_css_params.c
  2021-05-01  6:46 ` [PATCH 3/5] staging: media: atomisp: code formatting changes sh_css_params.c Deepak R Varma
@ 2021-05-20 19:04   ` Deepak R Varma
  2021-05-21 10:52   ` [PATCH " Dan Carpenter
  1 sibling, 0 replies; 15+ messages in thread
From: Deepak R Varma @ 2021-05-20 19:04 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Sakari Ailus, Greg Kroah-Hartman
  Cc: devel, drv, linux-kernel, linux-media

Several trivial code reformatting changes done according to the coding
style guidelines. These code changes overall improve code organisation
and readability and also address many chackpatch error, warning and
check complaints.

Signed-off-by: Deepak R Varma <drv@mailo.com>
---
 .../staging/media/atomisp/pci/sh_css_params.c | 929 +++++++++---------
 1 file changed, 438 insertions(+), 491 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/sh_css_params.c b/drivers/staging/media/atomisp/pci/sh_css_params.c
index 644e14575987..cbb593580dc8 100644
--- a/drivers/staging/media/atomisp/pci/sh_css_params.c
+++ b/drivers/staging/media/atomisp/pci/sh_css_params.c
@@ -120,8 +120,10 @@
 	(SH_CSS_MORPH_TABLE_ELEM_BYTES * (binary)->morph_tbl_aligned_width * \
 	 (binary)->morph_tbl_height)
 
-/* We keep a second copy of the ptr struct for the SP to access.
-   Again, this would not be necessary on the chip. */
+/*
+ * We keep a second copy of the ptr struct for the SP to access.
+ * Again, this would not be necessary on the chip.
+ */
 static ia_css_ptr sp_ddr_ptrs;
 
 /* sp group address on DDR */
@@ -667,7 +669,6 @@ static const struct ia_css_dz_config default_dz_config = {
 	HRT_GDC_N,
 	HRT_GDC_N,
 	{
-		\
 		{0, 0}, \
 		{0, 0}, \
 	}
@@ -690,27 +691,23 @@ struct ia_css_isp_skc_dvs_statistics {
 	ia_css_ptr p_data;
 };
 
-static int
-ref_sh_css_ddr_address_map(
-    struct sh_css_ddr_address_map *map,
-    struct sh_css_ddr_address_map *out);
+static int ref_sh_css_ddr_address_map(struct sh_css_ddr_address_map *map,
+				      struct sh_css_ddr_address_map *out);
 
-static int
-write_ia_css_isp_parameter_set_info_to_ddr(
-    struct ia_css_isp_parameter_set_info *me,
-    ia_css_ptr *out);
+static int write_ia_css_isp_parameter_set_info_to_ddr(
+		struct ia_css_isp_parameter_set_info *me,
+		ia_css_ptr *out);
 
 static int
 free_ia_css_isp_parameter_set_info(ia_css_ptr ptr);
 
-static int
-sh_css_params_write_to_ddr_internal(
-    struct ia_css_pipe *pipe,
-    unsigned int pipe_id,
-    struct ia_css_isp_parameters *params,
-    const struct ia_css_pipeline_stage *stage,
-    struct sh_css_ddr_address_map *ddr_map,
-    struct sh_css_ddr_address_map_size *ddr_map_size);
+static int sh_css_params_write_to_ddr_internal(
+		struct ia_css_pipe *pipe,
+		unsigned int pipe_id,
+		struct ia_css_isp_parameters *params,
+		const struct ia_css_pipeline_stage *stage,
+		struct sh_css_ddr_address_map *ddr_map,
+		struct sh_css_ddr_address_map_size *ddr_map_size);
 
 static int
 sh_css_create_isp_params(struct ia_css_stream *stream,
@@ -729,34 +726,30 @@ sh_css_init_isp_params_from_config(struct ia_css_pipe *pipe,
 				   struct ia_css_pipe *pipe_in);
 
 static int
-sh_css_set_global_isp_config_on_pipe(
-    struct ia_css_pipe *curr_pipe,
-    const struct ia_css_isp_config *config,
-    struct ia_css_pipe *pipe);
+sh_css_set_global_isp_config_on_pipe(struct ia_css_pipe *curr_pipe,
+				     const struct ia_css_isp_config *config,
+				     struct ia_css_pipe *pipe);
 
 #if defined(SH_CSS_ENABLE_PER_FRAME_PARAMS)
-static int
-sh_css_set_per_frame_isp_config_on_pipe(
-    struct ia_css_stream *stream,
-    const struct ia_css_isp_config *config,
-    struct ia_css_pipe *pipe);
+static int sh_css_set_per_frame_isp_config_on_pipe(
+		struct ia_css_stream *stream,
+		const struct ia_css_isp_config *config,
+		struct ia_css_pipe *pipe);
 #endif
 
-static int
-sh_css_update_uds_and_crop_info_based_on_zoom_region(
-    const struct ia_css_binary_info *info,
-    const struct ia_css_frame_info *in_frame_info,
-    const struct ia_css_frame_info *out_frame_info,
-    const struct ia_css_resolution *dvs_env,
-    const struct ia_css_dz_config *zoom,
-    const struct ia_css_vector *motion_vector,
-    struct sh_css_uds_info *uds,		/* out */
-    struct sh_css_crop_pos *sp_out_crop_pos,	/* out */
-    struct ia_css_resolution pipe_in_res,
-    bool enable_zoom);
-
-ia_css_ptr
-sh_css_params_ddr_address_map(void)
+static int sh_css_update_uds_and_crop_info_based_on_zoom_region(
+		const struct ia_css_binary_info *info,
+		const struct ia_css_frame_info *in_frame_info,
+		const struct ia_css_frame_info *out_frame_info,
+		const struct ia_css_resolution *dvs_env,
+		const struct ia_css_dz_config *zoom,
+		const struct ia_css_vector *motion_vector,
+		struct sh_css_uds_info *uds,		/* out */
+		struct sh_css_crop_pos *sp_out_crop_pos,	/* out */
+		struct ia_css_resolution pipe_in_res,
+		bool enable_zoom);
+
+ia_css_ptr sh_css_params_ddr_address_map(void)
 {
 	return sp_ddr_ptrs;
 }
@@ -813,15 +806,15 @@ convert_allocate_fpntbl(struct ia_css_isp_parameters *params)
 }
 
 static int
-store_fpntbl(struct ia_css_isp_parameters *params, ia_css_ptr ptr) {
+store_fpntbl(struct ia_css_isp_parameters *params, ia_css_ptr ptr)
+{
 	struct ia_css_host_data *isp_data;
 
 	assert(params);
 	assert(ptr != mmgr_NULL);
 
 	isp_data = convert_allocate_fpntbl(params);
-	if (!isp_data)
-	{
+	if (!isp_data) {
 		IA_CSS_LEAVE_ERR_PRIVATE(-ENOMEM);
 		return -ENOMEM;
 	}
@@ -886,7 +879,8 @@ ia_css_process_kernel(struct ia_css_stream *stream,
 
 		/* update the other buffers to the pipe specific copies */
 		for (stage = pipeline->stages; stage; stage = stage->next) {
-			if (!stage || !stage->binary) continue;
+			if (!stage || !stage->binary)
+				continue;
 			process(pipeline->pipe_id, stage, params);
 		}
 	}
@@ -894,7 +888,8 @@ ia_css_process_kernel(struct ia_css_stream *stream,
 
 static int
 sh_css_select_dp_10bpp_config(const struct ia_css_pipe *pipe,
-			      bool *is_dp_10bpp) {
+			      bool *is_dp_10bpp)
+{
 	int err = 0;
 	/* Currently we check if 10bpp DPC configuration is required based
 	 * on the use case,i.e. if BDS and DPC is both enabled. The more cleaner
@@ -903,12 +898,10 @@ sh_css_select_dp_10bpp_config(const struct ia_css_pipe *pipe,
 	 * implementation. (This is because the configuration is set before a
 	 * binary is selected, and the binary info is not available)
 	 */
-	if ((!pipe) || (!is_dp_10bpp))
-	{
+	if (!pipe || !is_dp_10bpp) {
 		IA_CSS_LEAVE_ERR_PRIVATE(-EINVAL);
 		err = -EINVAL;
-	} else
-	{
+	} else {
 		*is_dp_10bpp = false;
 
 		/* check if DPC is enabled from the host */
@@ -936,7 +929,8 @@ sh_css_select_dp_10bpp_config(const struct ia_css_pipe *pipe,
 
 int
 sh_css_set_black_frame(struct ia_css_stream *stream,
-		       const struct ia_css_frame *raw_black_frame) {
+		       const struct ia_css_frame *raw_black_frame)
+{
 	struct ia_css_isp_parameters *params;
 	/* this function desperately needs to be moved to the ISP or SP such
 	 * that it can use the DMA.
@@ -957,13 +951,11 @@ sh_css_set_black_frame(struct ia_css_stream *stream,
 	IA_CSS_ENTER_PRIVATE("black_frame=%p", raw_black_frame);
 
 	if (params->fpn_config.data &&
-	    (params->fpn_config.width != width || params->fpn_config.height != height))
-	{
+	    (params->fpn_config.width != width || params->fpn_config.height != height)) {
 		kvfree(params->fpn_config.data);
 		params->fpn_config.data = NULL;
 	}
-	if (!params->fpn_config.data)
-	{
+	if (!params->fpn_config.data) {
 		params->fpn_config.data = kvmalloc(height * width *
 						   sizeof(short), GFP_KERNEL);
 		if (!params->fpn_config.data) {
@@ -977,8 +969,7 @@ sh_css_set_black_frame(struct ia_css_stream *stream,
 	}
 
 	/* store raw to fpntbl */
-	for (y = 0; y < height; y++)
-	{
+	for (y = 0; y < height; y++) {
 		for (x = 0; x < width; x += (ISP_VEC_NELEMS * 2)) {
 			int ofs = y * width + x;
 
@@ -1071,10 +1062,8 @@ sh_css_set_shading_table(struct ia_css_stream *stream,
 	IA_CSS_LEAVE_PRIVATE("void");
 }
 
-void
-ia_css_params_store_ia_css_host_data(
-    ia_css_ptr ddr_addr,
-    struct ia_css_host_data *data)
+void ia_css_params_store_ia_css_host_data(ia_css_ptr ddr_addr,
+					  struct ia_css_host_data *data)
 {
 	assert(data);
 	assert(data->address);
@@ -1089,10 +1078,9 @@ ia_css_params_store_ia_css_host_data(
 	IA_CSS_LEAVE_PRIVATE("void");
 }
 
-struct ia_css_host_data *
-ia_css_params_alloc_convert_sctbl(
-    const struct ia_css_pipeline_stage *stage,
-    const struct ia_css_shading_table *shading_table)
+struct ia_css_host_data *ia_css_params_alloc_convert_sctbl(
+		const struct ia_css_pipeline_stage *stage,
+		const struct ia_css_shading_table *shading_table)
 {
 	const struct ia_css_binary *binary = stage->binary;
 	struct ia_css_host_data    *sctbl;
@@ -1137,10 +1125,9 @@ ia_css_params_alloc_convert_sctbl(
 	return sctbl;
 }
 
-int ia_css_params_store_sctbl(
-    const struct ia_css_pipeline_stage *stage,
-    ia_css_ptr sc_tbl,
-    const struct ia_css_shading_table  *sc_config)
+int ia_css_params_store_sctbl(const struct ia_css_pipeline_stage *stage,
+			      ia_css_ptr sc_tbl,
+			      const struct ia_css_shading_table  *sc_config)
 {
 	struct ia_css_host_data *isp_sc_tbl;
 
@@ -1165,8 +1152,7 @@ int ia_css_params_store_sctbl(
 	return 0;
 }
 
-static void
-sh_css_enable_pipeline(const struct ia_css_binary *binary)
+static void sh_css_enable_pipeline(const struct ia_css_binary *binary)
 {
 	if (!binary)
 		return;
@@ -1179,9 +1165,9 @@ sh_css_enable_pipeline(const struct ia_css_binary *binary)
 }
 
 static int
-ia_css_process_zoom_and_motion(
-    struct ia_css_isp_parameters *params,
-    const struct ia_css_pipeline_stage *first_stage) {
+ia_css_process_zoom_and_motion(struct ia_css_isp_parameters *params,
+			       const struct ia_css_pipeline_stage *first_stage)
+{
 	/* first_stage can be  NULL */
 	const struct ia_css_pipeline_stage *stage;
 	int err = 0;
@@ -1195,13 +1181,13 @@ ia_css_process_zoom_and_motion(
 	IA_CSS_ENTER_PRIVATE("");
 
 	/* Go through all stages to udate uds and cropping */
-	for (stage = first_stage; stage; stage = stage->next)
-	{
+	for (stage = first_stage; stage; stage = stage->next) {
 		struct ia_css_binary *binary;
-		/* note: the var below is made static as it is quite large;
-		   if it is not static it ends up on the stack which could
-		   cause issues for drivers
-		*/
+		/*
+		 * note: the var below is made static as it is quite large;
+		 * if it is not static it ends up on the stack which could
+		 * cause issues for drivers
+		 */
 		static struct ia_css_binary tmp_binary;
 
 		const struct ia_css_binary_xinfo *info = NULL;
@@ -1361,8 +1347,7 @@ sh_css_get_macc_table(const struct ia_css_isp_parameters *params,
 	IA_CSS_LEAVE_PRIVATE("void");
 }
 
-void ia_css_morph_table_free(
-    struct ia_css_morph_table *me)
+void ia_css_morph_table_free(struct ia_css_morph_table *me)
 {
 	unsigned int i;
 
@@ -1387,8 +1372,7 @@ void ia_css_morph_table_free(
 }
 
 struct ia_css_morph_table *ia_css_morph_table_allocate(
-    unsigned int width,
-    unsigned int height)
+		unsigned int width, unsigned int height)
 {
 	unsigned int i;
 	struct ia_css_morph_table *me;
@@ -1427,9 +1411,8 @@ struct ia_css_morph_table *ia_css_morph_table_allocate(
 	return me;
 }
 
-static int sh_css_params_default_morph_table(
-    struct ia_css_morph_table **table,
-    const struct ia_css_binary *binary)
+static int sh_css_params_default_morph_table(struct ia_css_morph_table **table,
+					     const struct ia_css_binary *binary)
 {
 	/* MW 2400 advanced requires different scaling */
 	unsigned int i, j, k, step, width, height;
@@ -1499,10 +1482,9 @@ sh_css_set_morph_table(struct ia_css_isp_parameters *params,
 	IA_CSS_LEAVE_PRIVATE("void");
 }
 
-void
-ia_css_translate_3a_statistics(
-    struct ia_css_3a_statistics               *host_stats,
-    const struct ia_css_isp_3a_statistics_map *isp_stats)
+void ia_css_translate_3a_statistics(
+		struct ia_css_3a_statistics *host_stats,
+		const struct ia_css_isp_3a_statistics_map *isp_stats)
 {
 	IA_CSS_ENTER("");
 	if (host_stats->grid.use_dmem) {
@@ -1521,8 +1503,7 @@ ia_css_translate_3a_statistics(
 	IA_CSS_LEAVE("void");
 }
 
-void
-ia_css_isp_3a_statistics_map_free(struct ia_css_isp_3a_statistics_map *me)
+void ia_css_isp_3a_statistics_map_free(struct ia_css_isp_3a_statistics_map *me)
 {
 	if (me) {
 		if (me->data_allocated) {
@@ -1534,14 +1515,15 @@ ia_css_isp_3a_statistics_map_free(struct ia_css_isp_3a_statistics_map *me)
 	}
 }
 
-struct ia_css_isp_3a_statistics_map *
-ia_css_isp_3a_statistics_map_allocate(
-    const struct ia_css_isp_3a_statistics *isp_stats,
-    void *data_ptr)
+struct ia_css_isp_3a_statistics_map *ia_css_isp_3a_statistics_map_allocate(
+		const struct ia_css_isp_3a_statistics *isp_stats,
+		void *data_ptr)
 {
 	struct ia_css_isp_3a_statistics_map *me;
-	/* Windows compiler does not like adding sizes to a void *
-	 * so we use a local char * instead. */
+	/*
+	 * Windows compiler does not like adding sizes to a void *
+	 * so we use a local char * instead.
+	 */
 	char *base_ptr;
 
 	me = kvmalloc(sizeof(*me), GFP_KERNEL);
@@ -1562,8 +1544,10 @@ ia_css_isp_3a_statistics_map_allocate(
 	base_ptr = me->data_ptr;
 
 	me->size = isp_stats->size;
-	/* GCC complains when we assign a char * to a void *, so these
-	 * casts are necessary unfortunately. */
+	/*
+	 * GCC complains when we assign a char * to a void *, so these
+	 * casts are necessary unfortunately.
+	 */
 	me->dmem_stats    = (void *)base_ptr;
 	me->vmem_stats_hi = (void *)(base_ptr + isp_stats->dmem_size);
 	me->vmem_stats_lo = (void *)(base_ptr + isp_stats->dmem_size +
@@ -1579,9 +1563,9 @@ ia_css_isp_3a_statistics_map_allocate(
 	return NULL;
 }
 
-int
-ia_css_get_3a_statistics(struct ia_css_3a_statistics           *host_stats,
-			 const struct ia_css_isp_3a_statistics *isp_stats) {
+int ia_css_get_3a_statistics(struct ia_css_3a_statistics *host_stats,
+			     const struct ia_css_isp_3a_statistics *isp_stats)
+{
 	struct ia_css_isp_3a_statistics_map *map;
 	int ret = 0;
 
@@ -1591,13 +1575,11 @@ ia_css_get_3a_statistics(struct ia_css_3a_statistics           *host_stats,
 	assert(isp_stats);
 
 	map = ia_css_isp_3a_statistics_map_allocate(isp_stats, NULL);
-	if (map)
-	{
+	if (map) {
 		hmm_load(isp_stats->data_ptr, map->data_ptr, isp_stats->size);
 		ia_css_translate_3a_statistics(host_stats, map);
 		ia_css_isp_3a_statistics_map_free(map);
-	} else
-	{
+	} else {
 		IA_CSS_ERROR("out of memory");
 		ret = -ENOMEM;
 	}
@@ -1606,12 +1588,12 @@ ia_css_get_3a_statistics(struct ia_css_3a_statistics           *host_stats,
 	return ret;
 }
 
-/* Parameter encoding is not yet orthogonal.
-   This function hnadles some of the exceptions.
-*/
-static void
-ia_css_set_param_exceptions(const struct ia_css_pipe *pipe,
-			    struct ia_css_isp_parameters *params)
+/*
+ * Parameter encoding is not yet orthogonal.
+ * This function hnadles some of the exceptions.
+ */
+static void ia_css_set_param_exceptions(const struct ia_css_pipe *pipe,
+					struct ia_css_isp_parameters *params)
 {
 	assert(params);
 
@@ -1635,10 +1617,9 @@ ia_css_set_param_exceptions(const struct ia_css_pipe *pipe,
 }
 
 /* ISP2401 */
-static void
-sh_css_set_dp_config(const struct ia_css_pipe *pipe,
-		     struct ia_css_isp_parameters *params,
-		     const struct ia_css_dp_config *config)
+static void sh_css_set_dp_config(const struct ia_css_pipe *pipe,
+				 struct ia_css_isp_parameters *params,
+				 const struct ia_css_dp_config *config)
 {
 	if (!config)
 		return;
@@ -1656,10 +1637,9 @@ sh_css_set_dp_config(const struct ia_css_pipe *pipe,
 	IA_CSS_LEAVE_PRIVATE("void");
 }
 
-static void
-sh_css_get_dp_config(const struct ia_css_pipe *pipe,
-		     const struct ia_css_isp_parameters *params,
-		     struct ia_css_dp_config *config)
+static void sh_css_get_dp_config(const struct ia_css_pipe *pipe,
+				 const struct ia_css_isp_parameters *params,
+				 struct ia_css_dp_config *config)
 {
 	if (!config)
 		return;
@@ -1673,9 +1653,8 @@ sh_css_get_dp_config(const struct ia_css_pipe *pipe,
 	IA_CSS_LEAVE_PRIVATE("void");
 }
 
-static void
-sh_css_set_nr_config(struct ia_css_isp_parameters *params,
-		     const struct ia_css_nr_config *config)
+static void sh_css_set_nr_config(struct ia_css_isp_parameters *params,
+				 const struct ia_css_nr_config *config)
 {
 	if (!config)
 		return;
@@ -1693,9 +1672,8 @@ sh_css_set_nr_config(struct ia_css_isp_parameters *params,
 	IA_CSS_LEAVE_PRIVATE("void");
 }
 
-static void
-sh_css_set_ee_config(struct ia_css_isp_parameters *params,
-		     const struct ia_css_ee_config *config)
+static void sh_css_set_ee_config(struct ia_css_isp_parameters *params,
+				 const struct ia_css_ee_config *config)
 {
 	if (!config)
 		return;
@@ -1711,9 +1689,8 @@ sh_css_set_ee_config(struct ia_css_isp_parameters *params,
 	IA_CSS_LEAVE_PRIVATE("void");
 }
 
-static void
-sh_css_get_ee_config(const struct ia_css_isp_parameters *params,
-		     struct ia_css_ee_config *config)
+static void sh_css_get_ee_config(const struct ia_css_isp_parameters *params,
+				 struct ia_css_ee_config *config)
 {
 	if (!config)
 		return;
@@ -1781,9 +1758,8 @@ sh_css_get_pipe_dvs_6axis_config(const struct ia_css_pipe *pipe,
 	IA_CSS_LEAVE_PRIVATE("void");
 }
 
-static void
-sh_css_set_baa_config(struct ia_css_isp_parameters *params,
-		      const struct ia_css_aa_config *config)
+static void sh_css_set_baa_config(struct ia_css_isp_parameters *params,
+				  const struct ia_css_aa_config *config)
 {
 	if (!config)
 		return;
@@ -1797,9 +1773,8 @@ sh_css_set_baa_config(struct ia_css_isp_parameters *params,
 	IA_CSS_LEAVE_PRIVATE("void");
 }
 
-static void
-sh_css_get_baa_config(const struct ia_css_isp_parameters *params,
-		      struct ia_css_aa_config *config)
+static void sh_css_get_baa_config(const struct ia_css_isp_parameters *params,
+				  struct ia_css_aa_config *config)
 {
 	if (!config)
 		return;
@@ -1812,9 +1787,8 @@ sh_css_get_baa_config(const struct ia_css_isp_parameters *params,
 	IA_CSS_LEAVE_PRIVATE("void");
 }
 
-static void
-sh_css_set_dz_config(struct ia_css_isp_parameters *params,
-		     const struct ia_css_dz_config *config)
+static void sh_css_set_dz_config(struct ia_css_isp_parameters *params,
+				 const struct ia_css_dz_config *config)
 {
 	if (!config)
 		return;
@@ -1833,9 +1807,8 @@ sh_css_set_dz_config(struct ia_css_isp_parameters *params,
 	IA_CSS_LEAVE_PRIVATE("void");
 }
 
-static void
-sh_css_get_dz_config(const struct ia_css_isp_parameters *params,
-		     struct ia_css_dz_config *config)
+static void sh_css_get_dz_config(const struct ia_css_isp_parameters *params,
+				 struct ia_css_dz_config *config)
 {
 	if (!config)
 		return;
@@ -1848,9 +1821,8 @@ sh_css_get_dz_config(const struct ia_css_isp_parameters *params,
 	IA_CSS_LEAVE_PRIVATE("dx=%d, dy=%d", config->dx, config->dy);
 }
 
-static void
-sh_css_set_motion_vector(struct ia_css_isp_parameters *params,
-			 const struct ia_css_vector *motion)
+static void sh_css_set_motion_vector(struct ia_css_isp_parameters *params,
+				     const struct ia_css_vector *motion)
 {
 	if (!motion)
 		return;
@@ -1866,9 +1838,8 @@ sh_css_set_motion_vector(struct ia_css_isp_parameters *params,
 	IA_CSS_LEAVE_PRIVATE("void");
 }
 
-static void
-sh_css_get_motion_vector(const struct ia_css_isp_parameters *params,
-			 struct ia_css_vector *motion)
+static void sh_css_get_motion_vector(const struct ia_css_isp_parameters *params,
+				     struct ia_css_vector *motion)
 {
 	if (!motion)
 		return;
@@ -1881,8 +1852,7 @@ sh_css_get_motion_vector(const struct ia_css_isp_parameters *params,
 	IA_CSS_LEAVE_PRIVATE("x=%d, y=%d", motion->x, motion->y);
 }
 
-struct ia_css_isp_config *
-sh_css_pipe_isp_config_get(struct ia_css_pipe *pipe)
+struct ia_css_isp_config *sh_css_pipe_isp_config_get(struct ia_css_pipe *pipe)
 {
 	if (!pipe) {
 		IA_CSS_ERROR("pipe=%p", NULL);
@@ -1891,18 +1861,16 @@ sh_css_pipe_isp_config_get(struct ia_css_pipe *pipe)
 	return pipe->config.p_isp_config;
 }
 
-int
-ia_css_stream_set_isp_config(
-    struct ia_css_stream *stream,
-    const struct ia_css_isp_config *config) {
+int ia_css_stream_set_isp_config(struct ia_css_stream *stream,
+				 const struct ia_css_isp_config *config)
+{
 	return ia_css_stream_set_isp_config_on_pipe(stream, config, NULL);
 }
 
-int
-ia_css_stream_set_isp_config_on_pipe(
-    struct ia_css_stream *stream,
-    const struct ia_css_isp_config *config,
-    struct ia_css_pipe *pipe) {
+int ia_css_stream_set_isp_config_on_pipe(struct ia_css_stream *stream,
+					 const struct ia_css_isp_config *config,
+					 struct ia_css_pipe *pipe)
+{
 	int err = 0;
 
 	if ((!stream) || (!config))
@@ -1921,9 +1889,9 @@ ia_css_stream_set_isp_config_on_pipe(
 	return err;
 }
 
-int
-ia_css_pipe_set_isp_config(struct ia_css_pipe *pipe,
-			   struct ia_css_isp_config *config) {
+int ia_css_pipe_set_isp_config(struct ia_css_pipe *pipe,
+			       struct ia_css_isp_config *config)
+{
 	struct ia_css_pipe *pipe_in = pipe;
 	int err = 0;
 
@@ -1944,11 +1912,11 @@ ia_css_pipe_set_isp_config(struct ia_css_pipe *pipe,
 	return err;
 }
 
-static int
-sh_css_set_global_isp_config_on_pipe(
-    struct ia_css_pipe *curr_pipe,
-    const struct ia_css_isp_config *config,
-    struct ia_css_pipe *pipe) {
+static int sh_css_set_global_isp_config_on_pipe(
+		struct ia_css_pipe *curr_pipe,
+		const struct ia_css_isp_config *config,
+		struct ia_css_pipe *pipe)
+{
 	int err = 0;
 	int err1 = 0;
 	int err2 = 0;
@@ -1960,11 +1928,13 @@ sh_css_set_global_isp_config_on_pipe(
 	/* Now commit all changes to the SP */
 	err2 = sh_css_param_update_isp_params(curr_pipe, curr_pipe->stream->isp_params_configs, sh_css_sp_is_running(), pipe);
 
-	/* The following code is intentional. The sh_css_init_isp_params_from_config interface
+	/*
+	 * The following code is intentional. The sh_css_init_isp_params_from_config interface
 	 * throws an error when both DPC and BDS is enabled. The CSS API must pass this error
 	 * information to the caller, ie. the host. We do not return this error immediately,
 	 * but instead continue with updating the ISP params to enable testing of features
-	 * which are currently in TR phase. */
+	 * which are currently in TR phase.
+	 */
 
 	err = (err1 != 0) ? err1 : ((err2 != 0) ? err2 : err);
 
@@ -1973,11 +1943,11 @@ sh_css_set_global_isp_config_on_pipe(
 }
 
 #if defined(SH_CSS_ENABLE_PER_FRAME_PARAMS)
-static int
-sh_css_set_per_frame_isp_config_on_pipe(
-    struct ia_css_stream *stream,
-    const struct ia_css_isp_config *config,
-    struct ia_css_pipe *pipe) {
+static int sh_css_set_per_frame_isp_config_on_pipe(
+		struct ia_css_stream *stream,
+		const struct ia_css_isp_config *config,
+		struct ia_css_pipe *pipe)
+{
 	unsigned int i;
 	bool per_frame_config_created = false;
 	int err = 0;
@@ -1991,17 +1961,16 @@ sh_css_set_per_frame_isp_config_on_pipe(
 
 	IA_CSS_ENTER_PRIVATE("stream=%p, config=%p, pipe=%p", stream, config, pipe);
 
-	if (!pipe)
-	{
+	if (!pipe) {
 		err = -EINVAL;
 		goto exit;
 	}
 
-	/* create per-frame ISP params object with default values
+	/*
+	 * create per-frame ISP params object with default values
 	 * from stream->isp_params_configs if one doesn't already exist
-	*/
-	if (!stream->per_frame_isp_params_configs)
-	{
+	 */
+	if (!stream->per_frame_isp_params_configs) {
 		err = sh_css_create_isp_params(stream,
 					       &stream->per_frame_isp_params_configs);
 		if (err)
@@ -2013,14 +1982,11 @@ sh_css_set_per_frame_isp_config_on_pipe(
 
 	/* update new ISP params object with the new config */
 	if (!sh_css_init_isp_params_from_global(stream, params, false, pipe))
-	{
 		err1 = -EINVAL;
-	}
 
 	err2 = sh_css_init_isp_params_from_config(stream->pipes[0], params, config, pipe);
 
-	if (per_frame_config_created)
-	{
+	if (per_frame_config_created) {
 		ddr_ptrs = &params->ddr_ptrs;
 		ddr_ptrs_size = &params->ddr_ptrs_size;
 		/* create per pipe reference to general ddr_ptrs */
@@ -2033,11 +1999,13 @@ sh_css_set_per_frame_isp_config_on_pipe(
 	/* now commit to ddr */
 	err3 = sh_css_param_update_isp_params(stream->pipes[0], params, sh_css_sp_is_running(), pipe);
 
-	/* The following code is intentional. The sh_css_init_sp_params_from_config and
+	/*
+	 * The following code is intentional. The sh_css_init_sp_params_from_config and
 	 * sh_css_init_isp_params_from_config throws an error when both DPC and BDS is enabled.
 	 * The CSS API must pass this error information to the caller, ie. the host.
 	 * We do not return this error immediately, but instead continue with updating the ISP params
-	 *  to enable testing of features which are currently in TR phase. */
+	 * to enable testing of features which are currently in TR phase.xi
+	 */
 	err = (err1 != 0) ? err1 :
 	      (err2 != 0) ? err2 :
 	      (err3 != 0) ? err3 : err;
@@ -2047,11 +2015,12 @@ sh_css_set_per_frame_isp_config_on_pipe(
 }
 #endif
 
-static int
-sh_css_init_isp_params_from_config(struct ia_css_pipe *pipe,
-				   struct ia_css_isp_parameters *params,
-				   const struct ia_css_isp_config *config,
-				   struct ia_css_pipe *pipe_in) {
+static int sh_css_init_isp_params_from_config(
+		struct ia_css_pipe *pipe,
+		struct ia_css_isp_parameters *params,
+		const struct ia_css_isp_config *config,
+		struct ia_css_pipe *pipe_in)
+{
 	int err = 0;
 	bool is_dp_10bpp = true;
 
@@ -2064,9 +2033,11 @@ sh_css_init_isp_params_from_config(struct ia_css_pipe *pipe,
 	sh_css_set_nr_config(params, config->nr_config);
 	sh_css_set_ee_config(params, config->ee_config);
 	sh_css_set_baa_config(params, config->baa_config);
+
 	if ((pipe->mode < IA_CSS_PIPE_ID_NUM) &&
 	    (params->pipe_dvs_6axis_config[pipe->mode]))
 		sh_css_set_pipe_dvs_6axis_config(pipe, params, config->dvs_6axis_config);
+
 	sh_css_set_dz_config(params, config->dz_config);
 	sh_css_set_motion_vector(params, config->motion_vector);
 	sh_css_update_shading_table_status(pipe_in, params);
@@ -2085,28 +2056,29 @@ sh_css_init_isp_params_from_config(struct ia_css_pipe *pipe,
 	params->output_frame = config->output_frame;
 	params->isp_parameters_id = config->isp_config_id;
 
-	/* Currently we do not offer CSS interface to set different
+	/*
+	 * Currently we do not offer CSS interface to set different
 	 * configurations for DPC, i.e. depending on DPC being enabled
 	 * before (NORM+OBC) or after. The folllowing code to set the
 	 * DPC configuration should be updated when this interface is made
-	 * available */
+	 * available
+	 */
 	if (IS_ISP2401) {
 		sh_css_set_dp_config(pipe, params, config->dp_config);
 		ia_css_set_param_exceptions(pipe, params);
 	}
 
-	if (0 ==
-	    sh_css_select_dp_10bpp_config(pipe, &is_dp_10bpp))
-	{
-		/* return an error when both DPC and BDS is enabled by the
-		 * user. */
-		/* we do not exit from this point immediately to allow internal
-		 * firmware feature testing. */
+	if (0 == sh_css_select_dp_10bpp_config(pipe, &is_dp_10bpp)) {
+		/*
+		 * return an error when both DPC and BDS is enabled by the
+		 * user.
+		 * we do not exit from this point immediately to allow internal
+		 * firmware feature testing.
+		 */
 		if (is_dp_10bpp) {
 			err = -EINVAL;
 		}
-	} else
-	{
+	} else {
 		err = -EINVAL;
 		goto exit;
 	}
@@ -2119,19 +2091,16 @@ sh_css_init_isp_params_from_config(struct ia_css_pipe *pipe,
 	return err;
 }
 
-void
-ia_css_stream_get_isp_config(
-    const struct ia_css_stream *stream,
-    struct ia_css_isp_config *config)
+void ia_css_stream_get_isp_config(const struct ia_css_stream *stream,
+				  struct ia_css_isp_config *config)
 {
 	IA_CSS_ENTER("void");
 	ia_css_pipe_get_isp_config(stream->pipes[0], config);
 	IA_CSS_LEAVE("void");
 }
 
-void
-ia_css_pipe_get_isp_config(struct ia_css_pipe *pipe,
-			   struct ia_css_isp_config *config)
+void ia_css_pipe_get_isp_config(struct ia_css_pipe *pipe,
+				struct ia_css_isp_config *config)
 {
 	struct ia_css_isp_parameters *params = NULL;
 
@@ -2168,19 +2137,17 @@ ia_css_pipe_get_isp_config(struct ia_css_pipe *pipe,
  *
  * Deprecated: Implement mmgr_realloc()
  */
-static bool realloc_isp_css_mm_buf(
-    ia_css_ptr *curr_buf,
-    size_t *curr_size,
-    size_t needed_size,
-    bool force,
-    int *err,
-    uint16_t mmgr_attribute)
+static bool realloc_isp_css_mm_buf(ia_css_ptr *curr_buf, size_t *curr_size,
+				   size_t needed_size, bool force, int *err,
+				   uint16_t mmgr_attribute)
 {
 	s32 id;
 
 	*err = 0;
-	/* Possible optimization: add a function sh_css_isp_css_mm_realloc()
-	 * and implement on top of hmm. */
+	/*
+	 * Possible optimization: add a function sh_css_isp_css_mm_realloc()
+	 * and implement on top of hmm.
+	 */
 
 	IA_CSS_ENTER_PRIVATE("void");
 
@@ -2211,12 +2178,8 @@ static bool realloc_isp_css_mm_buf(
 	return true;
 }
 
-static bool reallocate_buffer(
-    ia_css_ptr *curr_buf,
-    size_t *curr_size,
-    size_t needed_size,
-    bool force,
-    int *err)
+static bool reallocate_buffer(ia_css_ptr *curr_buf, size_t *curr_size,
+			      size_t needed_size, bool force, int *err)
 {
 	bool ret;
 
@@ -2284,8 +2247,7 @@ ia_css_isp_3a_statistics_allocate(const struct ia_css_3a_grid_info *grid)
 	return me;
 }
 
-void
-ia_css_isp_3a_statistics_free(struct ia_css_isp_3a_statistics *me)
+void ia_css_isp_3a_statistics_free(struct ia_css_isp_3a_statistics *me)
 {
 	if (me) {
 		hmm_free(me->data_ptr);
@@ -2327,15 +2289,16 @@ ia_css_metadata_allocate(const struct ia_css_metadata_info *metadata_info)
 	return NULL;
 }
 
-void
-ia_css_metadata_free(struct ia_css_metadata *me)
+void ia_css_metadata_free(struct ia_css_metadata *me)
 {
 	if (me) {
-		/* The enter and leave macros are placed inside
+		/*
+		 * The enter and leave macros are placed inside
 		 * the condition to avoid false logging of metadata
 		 * free events when metadata is disabled.
 		 * We found this to be confusing during development
-		 * and debugging. */
+		 * and debugging.
+		 */
 		IA_CSS_ENTER("me=%p", me);
 		hmm_free(me->address);
 		kvfree(me);
@@ -2343,9 +2306,8 @@ ia_css_metadata_free(struct ia_css_metadata *me)
 	}
 }
 
-void
-ia_css_metadata_free_multiple(unsigned int num_bufs,
-			      struct ia_css_metadata **bufs)
+void ia_css_metadata_free_multiple(unsigned int num_bufs,
+				   struct ia_css_metadata **bufs)
 {
 	unsigned int i;
 
@@ -2358,8 +2320,8 @@ ia_css_metadata_free_multiple(unsigned int num_bufs,
 static unsigned int g_param_buffer_dequeue_count;
 static unsigned int g_param_buffer_enqueue_count;
 
-int
-ia_css_stream_isp_parameters_init(struct ia_css_stream *stream) {
+int ia_css_stream_isp_parameters_init(struct ia_css_stream *stream)
+{
 	int err = 0;
 	unsigned int i;
 	struct sh_css_ddr_address_map *ddr_ptrs;
@@ -2369,8 +2331,7 @@ ia_css_stream_isp_parameters_init(struct ia_css_stream *stream) {
 	assert(stream);
 	IA_CSS_ENTER_PRIVATE("void");
 
-	if (!stream)
-	{
+	if (!stream) {
 		IA_CSS_LEAVE_ERR_PRIVATE(-EINVAL);
 		return -EINVAL;
 	}
@@ -2385,10 +2346,11 @@ ia_css_stream_isp_parameters_init(struct ia_css_stream *stream) {
 		goto ERR;
 
 	params = stream->isp_params_configs;
-	if (!sh_css_init_isp_params_from_global(stream, params, true, NULL))
-	{
-		/* we do not return the error immediately to enable internal
-		 * firmware feature testing */
+	if (!sh_css_init_isp_params_from_global(stream, params, true, NULL)) {
+		/*
+		 * we do not return the error immediately to enable internal
+		 * firmware feature testing
+		 */
 		err = -EINVAL;
 	}
 
@@ -2396,8 +2358,7 @@ ia_css_stream_isp_parameters_init(struct ia_css_stream *stream) {
 	ddr_ptrs_size = &params->ddr_ptrs_size;
 
 	/* create per pipe reference to general ddr_ptrs */
-	for (i = 0; i < IA_CSS_PIPE_ID_NUM; i++)
-	{
+	for (i = 0; i < IA_CSS_PIPE_ID_NUM; i++) {
 		ref_sh_css_ddr_address_map(ddr_ptrs, &params->pipe_ddr_ptrs[i]);
 		params->pipe_ddr_ptrs_size[i] = *ddr_ptrs_size;
 	}
@@ -2407,10 +2368,9 @@ ia_css_stream_isp_parameters_init(struct ia_css_stream *stream) {
 	return err;
 }
 
-static void
-ia_css_set_sdis_config(
-    struct ia_css_isp_parameters *params,
-    const struct ia_css_dvs_coefficients *dvs_coefs)
+static void ia_css_set_sdis_config(
+		struct ia_css_isp_parameters *params,
+		const struct ia_css_dvs_coefficients *dvs_coefs)
 {
 	ia_css_set_sdis_horicoef_config(params, dvs_coefs);
 	ia_css_set_sdis_vertcoef_config(params, dvs_coefs);
@@ -2418,10 +2378,9 @@ ia_css_set_sdis_config(
 	ia_css_set_sdis_vertproj_config(params, dvs_coefs);
 }
 
-static void
-ia_css_set_sdis2_config(
-    struct ia_css_isp_parameters *params,
-    const struct ia_css_dvs2_coefficients *dvs2_coefs)
+static void ia_css_set_sdis2_config(
+		struct ia_css_isp_parameters *params,
+		const struct ia_css_dvs2_coefficients *dvs2_coefs)
 {
 	ia_css_set_sdis2_horicoef_config(params, dvs2_coefs);
 	ia_css_set_sdis2_vertcoef_config(params, dvs2_coefs);
@@ -2431,7 +2390,8 @@ ia_css_set_sdis2_config(
 
 static int
 sh_css_create_isp_params(struct ia_css_stream *stream,
-			 struct ia_css_isp_parameters **isp_params_out) {
+			 struct ia_css_isp_parameters **isp_params_out)
+{
 	bool succ = true;
 	unsigned int i;
 	struct sh_css_ddr_address_map *ddr_ptrs;
@@ -2441,23 +2401,20 @@ sh_css_create_isp_params(struct ia_css_stream *stream,
 	struct ia_css_isp_parameters *params =
 	kvmalloc(sizeof(struct ia_css_isp_parameters), GFP_KERNEL);
 
-	if (!params)
-	{
+	if (!params) {
 		*isp_params_out = NULL;
 		err = -ENOMEM;
 		IA_CSS_ERROR("%s:%d error: cannot allocate memory", __FILE__, __LINE__);
 		IA_CSS_LEAVE_ERR_PRIVATE(err);
 		return err;
-	} else
-	{
+	} else {
 		memset(params, 0, sizeof(struct ia_css_isp_parameters));
 	}
 
 	ddr_ptrs = &params->ddr_ptrs;
 	ddr_ptrs_size = &params->ddr_ptrs_size;
 
-	for (i = 0; i < IA_CSS_PIPE_ID_NUM; i++)
-	{
+	for (i = 0; i < IA_CSS_PIPE_ID_NUM; i++) {
 		memset(&params->pipe_ddr_ptrs[i], 0,
 		       sizeof(params->pipe_ddr_ptrs[i]));
 		memset(&params->pipe_ddr_ptrs_size[i], 0,
@@ -2535,15 +2492,16 @@ sh_css_init_isp_params_from_global(struct ia_css_stream *stream,
 			for (i = 0; i < stream->num_pipes; i++) {
 				if (sh_css_select_dp_10bpp_config(stream->pipes[i],
 								&is_dp_10bpp) == 0) {
-					/* set the return value as false if both DPC and
-					* BDS is enabled by the user. But we do not return
-					* the value immediately to enable internal firmware
-					* feature testing. */
-					if (is_dp_10bpp) {
+					/*
+					 * set the return value as false if both DPC and
+					 * BDS is enabled by the user. But we do not return
+					 * the value immediately to enable internal firmware
+					 * feature testing.
+					 */
+					if (is_dp_10bpp)
 						sh_css_set_dp_config(stream->pipes[i], params, &default_dp_10bpp_config);
-					} else {
+					else
 						sh_css_set_dp_config(stream->pipes[i], params, &default_dp_config);
-					}
 				} else {
 					retval = false;
 					goto exit;
@@ -2643,10 +2601,12 @@ sh_css_init_isp_params_from_global(struct ia_css_stream *stream,
 		for (i = 0; i < stream->num_pipes; i++) {
 			if (0 ==
 			    sh_css_select_dp_10bpp_config(stream->pipes[i], &is_dp_10bpp)) {
-				/* set the return value as false if both DPC and
+				/*
+				 * set the return value as false if both DPC and
 				 * BDS is enabled by the user. But we do not return
 				 * the value immediately to enable internal firmware
-				 * feature testing. */
+				 * feature testing.
+				 */
 
 				if (is_dp_10bpp) {
 					retval = false;
@@ -2713,8 +2673,8 @@ sh_css_init_isp_params_from_global(struct ia_css_stream *stream,
 	return retval;
 }
 
-int
-sh_css_params_init(void) {
+int sh_css_params_init(void)
+{
 	int i, p;
 
 	IA_CSS_ENTER_PRIVATE("void");
@@ -2723,8 +2683,7 @@ sh_css_params_init(void) {
 	g_param_buffer_dequeue_count = 0;
 	g_param_buffer_enqueue_count = 0;
 
-	for (p = 0; p < IA_CSS_PIPE_ID_NUM; p++)
-	{
+	for (p = 0; p < IA_CSS_PIPE_ID_NUM; p++) {
 		for (i = 0; i < SH_CSS_MAX_STAGES; i++) {
 			xmem_sp_stage_ptrs[p][i] =
 			ia_css_refcount_increment(-1,
@@ -2762,8 +2721,7 @@ sh_css_params_init(void) {
 								 ATOMISP_MAP_FLAG_CLEARED));
 
 	if ((sp_ddr_ptrs == mmgr_NULL) ||
-	    (xmem_sp_group_ptrs == mmgr_NULL))
-	{
+	    (xmem_sp_group_ptrs == mmgr_NULL)) {
 		ia_css_uninit();
 		IA_CSS_LEAVE_ERR_PRIVATE(-ENOMEM);
 		return -ENOMEM;
@@ -2792,8 +2750,7 @@ inline void sh_css_params_free_gdc_lut(ia_css_ptr addr)
 		hmm_free(addr);
 }
 
-int ia_css_pipe_set_bci_scaler_lut(struct ia_css_pipe *pipe,
-	const void *lut)
+int ia_css_pipe_set_bci_scaler_lut(struct ia_css_pipe *pipe, const void *lut)
 {
 	int err = 0;
 	bool stream_started = false;
@@ -2806,10 +2763,12 @@ int ia_css_pipe_set_bci_scaler_lut(struct ia_css_pipe *pipe,
 		return err;
 	}
 
-	/* If the pipe belongs to a stream and the stream has started, it is not
+	/*
+	 * If the pipe belongs to a stream and the stream has started, it is not
 	 * safe to store lut to gdc HW. If pipe->stream is NULL, then no stream is
 	 * created with this pipe, so it is safe to do this operation as long as
-	 * ia_css_init() has been called. */
+	 * ia_css_init() has been called.
+	 */
 	if (pipe->stream && pipe->stream->started) {
 		ia_css_debug_dtrace(IA_CSS_DEBUG_ERROR,
 				    "unable to set scaler lut since stream has started\n");
@@ -2899,8 +2858,7 @@ ia_css_ptr sh_css_params_get_default_gdc_lut(void)
 	return default_gdc_lut;
 }
 
-static void free_param_set_callback(
-    ia_css_ptr ptr)
+static void free_param_set_callback(ia_css_ptr ptr)
 {
 	IA_CSS_ENTER_PRIVATE("void");
 
@@ -2909,8 +2867,7 @@ static void free_param_set_callback(
 	IA_CSS_LEAVE_PRIVATE("void");
 }
 
-static void free_buffer_callback(
-    ia_css_ptr ptr)
+static void free_buffer_callback(ia_css_ptr ptr)
 {
 	IA_CSS_ENTER_PRIVATE("void");
 
@@ -2919,8 +2876,7 @@ static void free_buffer_callback(
 	IA_CSS_LEAVE_PRIVATE("void");
 }
 
-void
-sh_css_param_clear_param_sets(void)
+void sh_css_param_clear_param_sets(void)
 {
 	IA_CSS_ENTER_PRIVATE("void");
 
@@ -3040,12 +2996,9 @@ sh_css_params_uninit(void)
 	IA_CSS_LEAVE_PRIVATE("void");
 }
 
-static struct ia_css_host_data *
-convert_allocate_morph_plane(
-    unsigned short *data,
-    unsigned int width,
-    unsigned int height,
-    unsigned int aligned_width)
+static struct ia_css_host_data *convert_allocate_morph_plane(
+		unsigned short *data, unsigned int width,
+		unsigned int height, unsigned int aligned_width)
 {
 	unsigned int i, j, padding, w;
 	struct ia_css_host_data *me;
@@ -3054,9 +3007,11 @@ convert_allocate_morph_plane(
 
 	IA_CSS_ENTER_PRIVATE("void");
 
-	/* currently we don't have morph table interpolation yet,
+	/*
+	 * currently we don't have morph table interpolation yet,
 	 * so we allow a wider table to be used. This will be removed
-	 * in the future. */
+	 * in the future.
+	 */
 	if (width > aligned_width) {
 		padding = 0;
 		w = aligned_width;
@@ -3088,20 +3043,16 @@ convert_allocate_morph_plane(
 	return me;
 }
 
-static int
-store_morph_plane(
-    unsigned short *data,
-    unsigned int width,
-    unsigned int height,
-    ia_css_ptr dest,
-    unsigned int aligned_width) {
+static int store_morph_plane(unsigned short *data, unsigned int width,
+			     unsigned int height, ia_css_ptr dest,
+			     unsigned int aligned_width)
+{
 	struct ia_css_host_data *isp_data;
 
 	assert(dest != mmgr_NULL);
 
 	isp_data = convert_allocate_morph_plane(data, width, height, aligned_width);
-	if (!isp_data)
-	{
+	if (!isp_data) {
 		IA_CSS_LEAVE_ERR_PRIVATE(-ENOMEM);
 		return -ENOMEM;
 	}
@@ -3112,8 +3063,8 @@ store_morph_plane(
 }
 
 static void sh_css_update_isp_params_to_ddr(
-    struct ia_css_isp_parameters *params,
-    ia_css_ptr ddr_ptr)
+		struct ia_css_isp_parameters *params,
+		ia_css_ptr ddr_ptr)
 {
 	size_t size = sizeof(params->uds);
 
@@ -3126,10 +3077,10 @@ static void sh_css_update_isp_params_to_ddr(
 }
 
 static void sh_css_update_isp_mem_params_to_ddr(
-    const struct ia_css_binary *binary,
-    ia_css_ptr ddr_mem_ptr,
-    size_t size,
-    enum ia_css_isp_memories mem)
+		const struct ia_css_binary *binary,
+		ia_css_ptr ddr_mem_ptr,
+		size_t size,
+		enum ia_css_isp_memories mem)
 {
 	const struct ia_css_host_data *params;
 
@@ -3200,10 +3151,10 @@ process_kernel_parameters(unsigned int pipe_id,
 		ia_css_ob_configure(&params->stream_configs.ob,
 				    isp_pipe_version, raw_bit_depth);
 	}
-	if (params->config_changed[IA_CSS_S3A_ID]) {
+	if (params->config_changed[IA_CSS_S3A_ID])
 		ia_css_s3a_configure(raw_bit_depth);
-	}
-	/* Copy stage uds parameters to config, since they can differ per stage.
+	/*
+	 * Copy stage uds parameters to config, since they can differ per stage.
 	 */
 	params->crop_config.crop_pos = params->uds[stage->stage_num].crop_pos;
 	params->uds_config.crop_pos  = params->uds[stage->stage_num].crop_pos;
@@ -3211,7 +3162,8 @@ process_kernel_parameters(unsigned int pipe_id,
 	/* Call parameter process functions for all kernels */
 	/* Skip SC, since that is called on a temp sc table */
 	for (param_id = 0; param_id < IA_CSS_NUM_PARAMETER_IDS; param_id++) {
-		if (param_id == IA_CSS_SC_ID) continue;
+		if (param_id == IA_CSS_SC_ID)
+			continue;
 		if (params->config_changed[param_id])
 			ia_css_kernel_process_param[param_id](pipe_id, stage, params);
 	}
@@ -3221,7 +3173,8 @@ int
 sh_css_param_update_isp_params(struct ia_css_pipe *curr_pipe,
 			       struct ia_css_isp_parameters *params,
 			       bool commit,
-			       struct ia_css_pipe *pipe_in) {
+			       struct ia_css_pipe *pipe_in)
+{
 	int err = 0;
 	ia_css_ptr cpy;
 	int i;
@@ -3238,15 +3191,15 @@ sh_css_param_update_isp_params(struct ia_css_pipe *curr_pipe,
 	raw_bit_depth = ia_css_stream_input_format_bits_per_pixel(curr_pipe->stream);
 
 	/* now make the map available to the sp */
-	if (!commit)
-	{
+	if (!commit) {
 		IA_CSS_LEAVE_ERR_PRIVATE(err);
 		return err;
 	}
-	/* enqueue a copies of the mem_map to
-	   the designated pipelines */
-	for (i = 0; i < curr_pipe->stream->num_pipes; i++)
-	{
+	/*
+	 * enqueue a copies of the mem_map to
+	 * the designated pipelines
+	 */
+	for (i = 0; i < curr_pipe->stream->num_pipes; i++) {
 		struct ia_css_pipe *pipe;
 		struct sh_css_ddr_address_map *cur_map;
 		struct sh_css_ddr_address_map_size *cur_map_size;
@@ -3279,11 +3232,12 @@ sh_css_param_update_isp_params(struct ia_css_pipe *curr_pipe,
 		cur_map = &params->pipe_ddr_ptrs[pipeline->pipe_id];
 		cur_map_size = &params->pipe_ddr_ptrs_size[pipeline->pipe_id];
 
-		/* TODO: Normally, zoom and motion parameters shouldn't
+		/*
+		 * TODO: Normally, zoom and motion parameters shouldn't
 		 * be part of "isp_params" as it is resolution/pipe dependent
 		 * Therefore, move the zoom config elsewhere (e.g. shading
 		 * table can be taken as an example! @GC
-		 * */
+		 */
 		{
 			/* we have to do this per pipeline because */
 			/* the processing is a.o. resolution dependent */
@@ -3293,8 +3247,10 @@ sh_css_param_update_isp_params(struct ia_css_pipe *curr_pipe,
 				return err;
 		}
 		/* check if to actually update the parameters for this pipe */
-		/* When API change is implemented making good distinction between
-		* stream config and pipe config this skipping code can be moved out of the #ifdef */
+		/*
+		 * When API change is implemented making good distinction between
+		 * stream config and pipe config this skipping code can be moved out of the #ifdef
+		 */
 		if (pipe_in && (pipe != pipe_in)) {
 			IA_CSS_LOG("skipping pipe %p", pipe);
 			continue;
@@ -3374,7 +3330,8 @@ sh_css_param_update_isp_params(struct ia_css_pipe *curr_pipe,
 #endif
 			break;
 		} else {
-			/* TMP: check discrepancy between nr of enqueued
+			/*
+			 * TMP: check discrepancy between nr of enqueued
 			 * parameter sets and dequeued sets
 			 */
 			g_param_buffer_enqueue_count++;
@@ -3404,8 +3361,10 @@ sh_css_param_update_isp_params(struct ia_css_pipe *curr_pipe,
 		ia_css_dequeue_param_buffers(/*pipe_num*/);
 		params->pipe_dvs_6axis_config_changed[pipeline->pipe_id] = false;
 	} /* end for each 'active' pipeline */
-	/* clear the changed flags after all params
-	for all pipelines have been updated */
+	/*
+	 * clear the changed flags after all params
+	 * for all pipelines have been updated
+	 */
 	params->isp_params_changed = false;
 	params->sc_table_changed = false;
 	params->dis_coef_table_changed = false;
@@ -3423,14 +3382,14 @@ sh_css_param_update_isp_params(struct ia_css_pipe *curr_pipe,
 	return err;
 }
 
-static int
-sh_css_params_write_to_ddr_internal(
-    struct ia_css_pipe *pipe,
-    unsigned int pipe_id,
-    struct ia_css_isp_parameters *params,
-    const struct ia_css_pipeline_stage *stage,
-    struct sh_css_ddr_address_map *ddr_map,
-    struct sh_css_ddr_address_map_size *ddr_map_size) {
+static int sh_css_params_write_to_ddr_internal(
+		struct ia_css_pipe *pipe,
+		unsigned int pipe_id,
+		struct ia_css_isp_parameters *params,
+		const struct ia_css_pipeline_stage *stage,
+		struct sh_css_ddr_address_map *ddr_map,
+		struct sh_css_ddr_address_map_size *ddr_map_size)
+{
 	int err;
 	const struct ia_css_binary *binary;
 
@@ -3452,8 +3411,7 @@ sh_css_params_write_to_ddr_internal(
 
 	stage_num = stage->stage_num;
 
-	if (binary->info->sp.enable.fpnr)
-	{
+	if (binary->info->sp.enable.fpnr) {
 		buff_realloced = reallocate_buffer(&ddr_map->fpn_tbl,
 						   &ddr_map_size->fpn_tbl,
 						   (size_t)(FPNTBL_BYTES(binary)),
@@ -3474,8 +3432,7 @@ sh_css_params_write_to_ddr_internal(
 		}
 	}
 
-	if (binary->info->sp.enable.sc)
-	{
+	if (binary->info->sp.enable.sc) {
 		u32 enable_conv;
 		size_t bytes;
 
@@ -3573,12 +3530,13 @@ sh_css_params_write_to_ddr_internal(
 		}
 	}
 
-	/* DPC configuration is made pipe specific to allow flexibility in positioning of the
+	/*
+	 * DPC configuration is made pipe specific to allow flexibility in positioning of the
 	 * DPC kernel. The code below sets the pipe specific configuration to
-	 * individual binaries. */
+	 * individual binaries.
+	 */
 	if (IS_ISP2401 &&
-	    params->pipe_dpc_config_changed[pipe_id] && binary->info->sp.enable.dpc)
-	{
+	    params->pipe_dpc_config_changed[pipe_id] && binary->info->sp.enable.dpc) {
 		unsigned int size   =
 		    stage->binary->info->mem_offsets.offsets.param->dmem.dp.size;
 
@@ -3596,8 +3554,7 @@ sh_css_params_write_to_ddr_internal(
 		}
 	}
 
-	if (params->config_changed[IA_CSS_MACC_ID] && binary->info->sp.enable.macc)
-	{
+	if (params->config_changed[IA_CSS_MACC_ID] && binary->info->sp.enable.macc) {
 		unsigned int i, j, idx;
 		unsigned int idx_map[] = {
 			0, 1, 3, 2, 6, 7, 5, 4, 12, 13, 15, 14, 10, 11, 9, 8
@@ -3646,9 +3603,9 @@ sh_css_params_write_to_ddr_internal(
 			   sizeof(converted_macc_table.data));
 	}
 
-	if (binary->info->sp.enable.dvs_6axis)
-	{
-		/* because UV is packed into the Y plane, calc total
+	if (binary->info->sp.enable.dvs_6axis) {
+		/*
+		 * because UV is packed into the Y plane, calc total
 		 * YYU size = /2 gives size of UV-only,
 		 * total YYU size = UV-only * 3.
 		 */
@@ -3667,11 +3624,13 @@ sh_css_params_write_to_ddr_internal(
 			const struct ia_css_frame_info *dvs_in_frame_info;
 
 			if (stage->args.delay_frames[0]) {
-				/*When delay frames are present(as in case of video),
-				they are used for dvs. Configure DVS using those params*/
+				/*
+				 * When delay frames are present(as in case of video),
+				 * they are used for dvs. Configure DVS using those paramsi
+				 */
 				dvs_in_frame_info = &stage->args.delay_frames[0]->info;
 			} else {
-				/*Otherwise, use input frame to configure DVS*/
+				/* Otherwise, use input frame to configure DVS */
 				dvs_in_frame_info = &stage->args.in_frame->info;
 			}
 
@@ -3682,9 +3641,8 @@ sh_css_params_write_to_ddr_internal(
 				if (!IS_ISP2401) {
 					dvs_offset.width = (PIX_SHIFT_FILTER_RUN_IN_X + binary->dvs_envelope.width) / 2;
 				} else {
-					if (binary->dvs_envelope.width || binary->dvs_envelope.height) {
+					if (binary->dvs_envelope.width || binary->dvs_envelope.height)
 						dvs_offset.width  = (PIX_SHIFT_FILTER_RUN_IN_X + binary->dvs_envelope.width) / 2;
-					}
 				}
 				dvs_offset.height = (PIX_SHIFT_FILTER_RUN_IN_Y + binary->dvs_envelope.height) / 2;
 
@@ -3705,21 +3663,13 @@ sh_css_params_write_to_ddr_internal(
 		}
 	}
 
-	if (binary->info->sp.enable.ca_gdc)
-	{
+	if (binary->info->sp.enable.ca_gdc) {
 		unsigned int i;
-		ia_css_ptr *virt_addr_tetra_x[
-
-		IA_CSS_MORPH_TABLE_NUM_PLANES];
-		size_t *virt_size_tetra_x[
-
-		IA_CSS_MORPH_TABLE_NUM_PLANES];
-		ia_css_ptr *virt_addr_tetra_y[
+		ia_css_ptr *virt_addr_tetra_x[IA_CSS_MORPH_TABLE_NUM_PLANES];
+		ia_css_ptr *virt_addr_tetra_y[IA_CSS_MORPH_TABLE_NUM_PLANES];
 
-		IA_CSS_MORPH_TABLE_NUM_PLANES];
-		size_t *virt_size_tetra_y[
-
-		IA_CSS_MORPH_TABLE_NUM_PLANES];
+		size_t *virt_size_tetra_x[IA_CSS_MORPH_TABLE_NUM_PLANES];
+		size_t *virt_size_tetra_y[IA_CSS_MORPH_TABLE_NUM_PLANES];
 
 		virt_addr_tetra_x[0] = &ddr_map->tetra_r_x;
 		virt_addr_tetra_x[1] = &ddr_map->tetra_gr_x;
@@ -3752,23 +3702,19 @@ sh_css_params_write_to_ddr_internal(
 		buff_realloced = false;
 		for (i = 0; i < IA_CSS_MORPH_TABLE_NUM_PLANES; i++) {
 			buff_realloced |=
-			    reallocate_buffer(virt_addr_tetra_x[i],
-					    virt_size_tetra_x[i],
-					    (size_t)
-					    (MORPH_PLANE_BYTES(binary)),
-					    params->morph_table_changed,
-					    &err);
+				reallocate_buffer(virt_addr_tetra_x[i],
+						  virt_size_tetra_x[i],
+						  (size_t) (MORPH_PLANE_BYTES(binary)),
+						  params->morph_table_changed, &err);
 			if (err) {
 				IA_CSS_LEAVE_ERR_PRIVATE(err);
 				return err;
 			}
 			buff_realloced |=
-			    reallocate_buffer(virt_addr_tetra_y[i],
-					    virt_size_tetra_y[i],
-					    (size_t)
-					    (MORPH_PLANE_BYTES(binary)),
-					    params->morph_table_changed,
-					    &err);
+				reallocate_buffer(virt_addr_tetra_y[i],
+						  virt_size_tetra_y[i],
+						  (size_t) (MORPH_PLANE_BYTES(binary)),
+						  params->morph_table_changed, &err);
 			if (err) {
 				IA_CSS_LEAVE_ERR_PRIVATE(err);
 				return err;
@@ -3795,15 +3741,15 @@ sh_css_params_write_to_ddr_internal(
 
 			for (i = 0; i < IA_CSS_MORPH_TABLE_NUM_PLANES; i++) {
 				store_morph_plane(table->coordinates_x[i],
-						table->width,
-						table->height,
-						*virt_addr_tetra_x[i],
-						binary->morph_tbl_aligned_width);
+						  table->width,
+						  table->height,
+						  *virt_addr_tetra_x[i],
+						  binary->morph_tbl_aligned_width);
 				store_morph_plane(table->coordinates_y[i],
-						table->width,
-						table->height,
-						*virt_addr_tetra_y[i],
-						binary->morph_tbl_aligned_width);
+						  table->width,
+						  table->height,
+						  *virt_addr_tetra_y[i],
+						  binary->morph_tbl_aligned_width);
 			}
 			if (id_table)
 				ia_css_morph_table_free(id_table);
@@ -3811,19 +3757,20 @@ sh_css_params_write_to_ddr_internal(
 	}
 
 	/* After special cases like SC, FPN since they may change parameters */
-	for (mem = 0; mem < N_IA_CSS_MEMORIES; mem++)
-	{
+	for (mem = 0; mem < N_IA_CSS_MEMORIES; mem++) {
 		const struct ia_css_isp_data *isp_data =
 		    ia_css_isp_param_get_isp_mem_init(&binary->info->sp.mem_initializers,
-						    IA_CSS_PARAM_CLASS_PARAM, mem);
+						      IA_CSS_PARAM_CLASS_PARAM, mem);
 		size_t size = isp_data->size;
 
-		if (!size) continue;
+		if (!size)
+			continue;
+
 		buff_realloced = reallocate_buffer(&ddr_map->isp_mem_param[stage_num][mem],
-						&ddr_map_size->isp_mem_param[stage_num][mem],
-						size,
-						params->isp_mem_params_changed[pipe_id][stage_num][mem],
-						&err);
+						   &ddr_map_size->isp_mem_param[stage_num][mem],
+						   size,
+						   params->isp_mem_params_changed[pipe_id][stage_num][mem],
+						   &err);
 		if (err) {
 			IA_CSS_LEAVE_ERR_PRIVATE(err);
 			return err;
@@ -3852,8 +3799,8 @@ const struct ia_css_fpn_table *ia_css_get_fpn_table(struct ia_css_stream
 	return &params->fpn_config;
 }
 
-struct ia_css_shading_table *ia_css_get_shading_table(struct ia_css_stream
-	*stream)
+struct ia_css_shading_table *ia_css_get_shading_table(
+		struct ia_css_stream *stream)
 {
 	struct ia_css_shading_table *table = NULL;
 	struct ia_css_isp_parameters *params;
@@ -3870,8 +3817,8 @@ struct ia_css_shading_table *ia_css_get_shading_table(struct ia_css_stream
 		if (params->sc_table) {
 			table = (struct ia_css_shading_table *)params->sc_table;
 		} else {
-			const struct ia_css_binary *binary
-			    = ia_css_stream_get_shading_correction_binary(stream);
+			const struct ia_css_binary *binary =
+				ia_css_stream_get_shading_correction_binary(stream);
 			if (binary) {
 				/* generate the identical shading table */
 				if (params->sc_config) {
@@ -3882,19 +3829,23 @@ struct ia_css_shading_table *ia_css_get_shading_table(struct ia_css_stream
 									binary->sctbl_width_per_color,
 									binary->sctbl_height);
 				table = params->sc_config;
-				/* The sc_config will be freed in the
-				 * ia_css_stream_isp_parameters_uninit function. */
+				/*
+				 * The sc_config will be freed in the
+				 * ia_css_stream_isp_parameters_uninit function.xi
+				 */
 			}
 		}
 	} else {
 		/* ------ deprecated(bz675) : from ------ */
-		const struct ia_css_binary *binary
-		    = ia_css_stream_get_shading_correction_binary(stream);
+		const struct ia_css_binary *binary =
+			ia_css_stream_get_shading_correction_binary(stream);
 		struct ia_css_pipe *pipe;
 
 		/**********************************************************************/
-		/* following code is copied from function ia_css_stream_get_shading_correction_binary()
-		 * to match with the binary */
+		/*
+		 * following code is copied from function ia_css_stream_get_shading_correction_binary()
+		 * to match with the binary
+		 */
 		pipe = stream->pipes[0];
 
 		if (stream->num_pipes == 2) {
@@ -3916,8 +3867,10 @@ struct ia_css_shading_table *ia_css_get_shading_table(struct ia_css_stream
 			    binary, pipe->required_bds_factor);
 
 			table = params->sc_config;
-			/* The sc_config will be freed in the
-			 * ia_css_stream_isp_parameters_uninit function. */
+			/*
+			 * The sc_config will be freed in the
+			 * ia_css_stream_isp_parameters_uninit function.
+			 */
 		}
 		/* ------ deprecated(bz675) : to ------ */
 	}
@@ -3930,45 +3883,38 @@ struct ia_css_shading_table *ia_css_get_shading_table(struct ia_css_stream
 ia_css_ptr sh_css_store_sp_group_to_ddr(void)
 {
 	IA_CSS_ENTER_LEAVE_PRIVATE("void");
-	hmm_store(xmem_sp_group_ptrs,
-		   &sh_css_sp_group,
-		   sizeof(struct sh_css_sp_group));
+	hmm_store(xmem_sp_group_ptrs, &sh_css_sp_group,
+		  sizeof(struct sh_css_sp_group));
 	return xmem_sp_group_ptrs;
 }
 
-ia_css_ptr sh_css_store_sp_stage_to_ddr(
-    unsigned int pipe,
-    unsigned int stage)
+ia_css_ptr sh_css_store_sp_stage_to_ddr(unsigned int pipe, unsigned int stage)
 {
 	IA_CSS_ENTER_LEAVE_PRIVATE("void");
-	hmm_store(xmem_sp_stage_ptrs[pipe][stage],
-		   &sh_css_sp_stage,
-		   sizeof(struct sh_css_sp_stage));
+	hmm_store(xmem_sp_stage_ptrs[pipe][stage], &sh_css_sp_stage,
+		  sizeof(struct sh_css_sp_stage));
 	return xmem_sp_stage_ptrs[pipe][stage];
 }
 
-ia_css_ptr sh_css_store_isp_stage_to_ddr(
-    unsigned int pipe,
-    unsigned int stage)
+ia_css_ptr sh_css_store_isp_stage_to_ddr(unsigned int pipe, unsigned int stage)
 {
 	IA_CSS_ENTER_LEAVE_PRIVATE("void");
-	hmm_store(xmem_isp_stage_ptrs[pipe][stage],
-		   &sh_css_isp_stage,
-		   sizeof(struct sh_css_isp_stage));
+	hmm_store(xmem_isp_stage_ptrs[pipe][stage], &sh_css_isp_stage,
+		  sizeof(struct sh_css_isp_stage));
 	return xmem_isp_stage_ptrs[pipe][stage];
 }
 
-static int ref_sh_css_ddr_address_map(
-    struct sh_css_ddr_address_map *map,
-    struct sh_css_ddr_address_map *out)
+static int ref_sh_css_ddr_address_map(struct sh_css_ddr_address_map *map,
+				      struct sh_css_ddr_address_map *out)
 {
 	int err = 0;
 	unsigned int i;
 
-	/* we will use a union to copy things; overlaying an array
-	   with the struct; that way adding fields in the struct
-	   will keep things working, and we will not get type errors.
-	*/
+	/*
+	 * we will use a union to copy things; overlaying an array
+	 * with the struct; that way adding fields in the struct
+	 * will keep things working, and we will not get type errors.
+	 */
 	union {
 		struct sh_css_ddr_address_map *map;
 		ia_css_ptr *addrs;
@@ -3999,8 +3945,8 @@ static int ref_sh_css_ddr_address_map(
 }
 
 static int write_ia_css_isp_parameter_set_info_to_ddr(
-    struct ia_css_isp_parameter_set_info *me,
-    ia_css_ptr *out)
+		struct ia_css_isp_parameter_set_info *me,
+		ia_css_ptr *out)
 {
 	int err = 0;
 	bool succ;
@@ -4014,8 +3960,8 @@ static int write_ia_css_isp_parameter_set_info_to_ddr(
 					 hmm_alloc(sizeof(struct ia_css_isp_parameter_set_info), HMM_BO_PRIVATE, 0, NULL, 0));
 	succ = (*out != mmgr_NULL);
 	if (succ)
-		hmm_store(*out,
-			   me, sizeof(struct ia_css_isp_parameter_set_info));
+		hmm_store(*out, me,
+			  sizeof(struct ia_css_isp_parameter_set_info));
 	else
 		err = -ENOMEM;
 
@@ -4023,9 +3969,8 @@ static int write_ia_css_isp_parameter_set_info_to_ddr(
 	return err;
 }
 
-static int
-free_ia_css_isp_parameter_set_info(
-    ia_css_ptr ptr) {
+static int free_ia_css_isp_parameter_set_info(ia_css_ptr ptr)
+{
 	int err = 0;
 	struct ia_css_isp_parameter_set_info isp_params_info;
 	unsigned int i;
@@ -4034,8 +3979,7 @@ free_ia_css_isp_parameter_set_info(
 	IA_CSS_ENTER_PRIVATE("ptr = %u", ptr);
 
 	/* sanity check - ptr must be valid */
-	if (!ia_css_refcount_is_valid(ptr))
-	{
+	if (!ia_css_refcount_is_valid(ptr)) {
 		IA_CSS_ERROR("%s: IA_CSS_REFCOUNT_PARAM_SET_POOL(0x%x) invalid arg", __func__,
 			     ptr);
 		err = -EINVAL;
@@ -4046,8 +3990,7 @@ free_ia_css_isp_parameter_set_info(
 	hmm_load(ptr, &isp_params_info.mem_map, sizeof(struct sh_css_ddr_address_map));
 	/* copy map using size info */
 	for (i = 0; i < (sizeof(struct sh_css_ddr_address_map_size) /
-			 sizeof(size_t)); i++)
-	{
+			 sizeof(size_t)); i++) {
 		if (addrs[i] == mmgr_NULL)
 			continue;
 
@@ -4081,9 +4024,8 @@ sh_css_invalidate_params(struct ia_css_stream *stream)
 	params->isp_params_changed = true;
 	for (i = 0; i < IA_CSS_PIPE_ID_NUM; i++) {
 		for (j = 0; j < SH_CSS_MAX_STAGES; j++) {
-			for (mem = 0; mem < N_IA_CSS_MEMORIES; mem++) {
+			for (mem = 0; mem < N_IA_CSS_MEMORIES; mem++)
 				params->isp_mem_params_changed[i][j][mem] = true;
-			}
 		}
 	}
 
@@ -4106,18 +4048,16 @@ sh_css_invalidate_params(struct ia_css_stream *stream)
 	IA_CSS_LEAVE_PRIVATE("void");
 }
 
-void
-sh_css_update_uds_and_crop_info(
-    const struct ia_css_binary_info *info,
-    const struct ia_css_frame_info *in_frame_info,
-    const struct ia_css_frame_info *out_frame_info,
-    const struct ia_css_resolution *dvs_env,
-    const struct ia_css_dz_config *zoom,
-    const struct ia_css_vector *motion_vector,
-    struct sh_css_uds_info *uds,		/* out */
-    struct sh_css_crop_pos *sp_out_crop_pos,	/* out */
-
-    bool enable_zoom)
+void sh_css_update_uds_and_crop_info(
+		const struct ia_css_binary_info *info,
+		const struct ia_css_frame_info *in_frame_info,
+		const struct ia_css_frame_info *out_frame_info,
+		const struct ia_css_resolution *dvs_env,
+		const struct ia_css_dz_config *zoom,
+		const struct ia_css_vector *motion_vector,
+		struct sh_css_uds_info *uds,			/* out */
+		struct sh_css_crop_pos *sp_out_crop_pos,	/* out */
+		bool enable_zoom)
 {
 	IA_CSS_ENTER_PRIVATE("void");
 
@@ -4195,20 +4135,26 @@ sh_css_update_uds_and_crop_info(
 			/* clip the motion vector to +/- half the envelope */
 			motion_x = clamp(motion_x, -half_env_x, half_env_x);
 			motion_y = clamp(motion_y, -half_env_y, half_env_y);
-			/* for video with downscaling, the envelope is included
-			    in the input resolution. */
+			/*
+			 * for video with downscaling, the envelope is included
+			 * in the input resolution.
+			 */
 			uds_xc = in_frame_info->res.width / 2 + motion_x;
 			uds_yc = in_frame_info->res.height / 2 + motion_y;
 			crop_x = info->pipeline.left_cropping;
-			/* ds == 2 (yuv_ds) can be pipelined, remove top
-			   lines */
+			/*
+			 * ds == 2 (yuv_ds) can be pipelined,
+			 * remove top lines
+			 */
 			if (info->enable.ds & 1)
 				crop_y = info->pipeline.top_cropping;
 			else
 				crop_y = 2;
 		} else {
-			/* video nodz: here we can only crop. We make sure we
-			   crop at least the first 8x8 pixels away. */
+			/*
+			 * video nodz: here we can only crop. We make sure we
+			 * crop at least the first 8x8 pixels away.
+			 */
 			env_width  = dvs_env->width -
 				     SH_CSS_MIN_DVS_ENVELOPE;
 			env_height = dvs_env->height -
@@ -4243,28 +4189,29 @@ sh_css_update_uds_and_crop_info(
 	IA_CSS_LEAVE_PRIVATE("void");
 }
 
-static int
-sh_css_update_uds_and_crop_info_based_on_zoom_region(
-    const struct ia_css_binary_info *info,
-    const struct ia_css_frame_info *in_frame_info,
-    const struct ia_css_frame_info *out_frame_info,
-    const struct ia_css_resolution *dvs_env,
-    const struct ia_css_dz_config *zoom,
-    const struct ia_css_vector *motion_vector,
-    struct sh_css_uds_info *uds,		/* out */
-    struct sh_css_crop_pos *sp_out_crop_pos,	/* out */
-    struct ia_css_resolution pipe_in_res,
-    bool enable_zoom) {
+static int sh_css_update_uds_and_crop_info_based_on_zoom_region(
+		const struct ia_css_binary_info *info,
+		const struct ia_css_frame_info *in_frame_info,
+		const struct ia_css_frame_info *out_frame_info,
+		const struct ia_css_resolution *dvs_env,
+		const struct ia_css_dz_config *zoom,
+		const struct ia_css_vector *motion_vector,
+		struct sh_css_uds_info *uds,			/* out */
+		struct sh_css_crop_pos *sp_out_crop_pos,	/* out */
+		struct ia_css_resolution pipe_in_res,
+		bool enable_zoom)
+{
 	unsigned int x0 = 0, y0 = 0, x1 = 0, y1 = 0;
 	int err = 0;
-	/* Note:
-	* Filter_Envelope = 0 for NND/LUT
-	* Filter_Envelope = 1 for BCI
-	* Filter_Envelope = 3 for BLI
-	* Currently, not considering this filter envelope because, In uds.sp.c is recalculating
-	* the dx/dy based on filter envelope and other information (ia_css_uds_sp_scale_params)
-	* Ideally, That should be done on host side not on sp side.
-	*/
+	/*
+	 * Note:
+	 * Filter_Envelope = 0 for NND/LUT
+	 * Filter_Envelope = 1 for BCI
+	 * Filter_Envelope = 3 for BLI
+	 * Currently, not considering this filter envelope because, In uds.sp.c is recalculating
+	 * the dx/dy based on filter envelope and other information (ia_css_uds_sp_scale_params)
+	 * Ideally, That should be done on host side not on sp side.
+	 */
 	unsigned int filter_envelope = 0;
 
 	IA_CSS_ENTER_PRIVATE("void");
@@ -4285,24 +4232,24 @@ sh_css_update_uds_and_crop_info_based_on_zoom_region(
 	if ((x0 > x1) || (y0 > y1) || (x1 > pipe_in_res.width) || (y1 > pipe_in_res.height))
 		return -EINVAL;
 
-	if (!enable_zoom)
-	{
+	if (!enable_zoom) {
 		uds->curr_dx = HRT_GDC_N;
 		uds->curr_dy = HRT_GDC_N;
 	}
 
-	if (info->enable.dvs_envelope)
-	{
-		/* Zoom region is only supported by the UDS module on ISP
-		 * 2 and higher. It is not supported in video mode on ISP 1 */
+	if (info->enable.dvs_envelope) {
+		/*
+		 * Zoom region is only supported by the UDS module on ISP
+		 * 2 and higher. It is not supported in video mode on ISP 1
+		 */
 		return -EINVAL;
-	} else
-	{
+	} else {
 		if (enable_zoom) {
-			/* A. Calculate dx/dy based on crop region using in_frame_info
-			* Scale the crop region if in_frame_info to the stage is not same as
-			* actual effective input of the pipeline
-			*/
+			/*
+			 * A. Calculate dx/dy based on crop region using in_frame_info
+			 * Scale the crop region if in_frame_info to the stage is not same as
+			 * actual effective input of the pipeline
+			 */
 			if (in_frame_info->res.width != pipe_in_res.width ||
 			    in_frame_info->res.height != pipe_in_res.height) {
 				x0 = (x0 * in_frame_info->res.width) / (pipe_in_res.width);
-- 
2.30.2



_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* [PATCH RESEND 4/5] staging: media: atomisp: code formatting changes sh_css_sp.c
  2021-05-01  6:47 ` [PATCH 4/5] staging: media: atomisp: code formatting changes sh_css_sp.c Deepak R Varma
@ 2021-05-20 19:05   ` Deepak R Varma
  0 siblings, 0 replies; 15+ messages in thread
From: Deepak R Varma @ 2021-05-20 19:05 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Sakari Ailus, Greg Kroah-Hartman
  Cc: devel, drv, linux-kernel, linux-media

Several trivial code reformatting changes done according to the coding
style guidelines. These code changes overall improve code organisation
and readability and also address many chackpatch error, warning and
check complaints.

Signed-off-by: Deepak R Varma <drv@mailo.com>
---
 drivers/staging/media/atomisp/pci/sh_css_sp.c | 471 ++++++++----------
 1 file changed, 203 insertions(+), 268 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/sh_css_sp.c b/drivers/staging/media/atomisp/pci/sh_css_sp.c
index 02f5a73b4096..b2859dcf9ac6 100644
--- a/drivers/staging/media/atomisp/pci/sh_css_sp.c
+++ b/drivers/staging/media/atomisp/pci/sh_css_sp.c
@@ -91,14 +91,12 @@ static void
 initialize_stage_frames(struct ia_css_frames_sp *frames);
 
 /* This data is stored every frame */
-void
-store_sp_group_data(void)
+void store_sp_group_data(void)
 {
 	per_frame_data.sp_group_addr = sh_css_store_sp_group_to_ddr();
 }
 
-static void
-copy_isp_stage_to_sp_stage(void)
+static void copy_isp_stage_to_sp_stage(void)
 {
 	/* [WW07.5]type casting will cause potential issues */
 	sh_css_sp_stage.num_stripes = (uint8_t)
@@ -109,7 +107,8 @@ copy_isp_stage_to_sp_stage(void)
 		sh_css_isp_stage.binary_info.iterator.row_stripes_overlap_lines;
 	sh_css_sp_stage.top_cropping = (uint16_t)
 				       sh_css_isp_stage.binary_info.pipeline.top_cropping;
-	/* moved to sh_css_sp_init_stage
+	/*
+	 * moved to sh_css_sp_init_stage
 	   sh_css_sp_stage.enable.vf_output =
 	   sh_css_isp_stage.binary_info.enable.vf_veceven ||
 	   sh_css_isp_stage.binary_info.num_output_pins > 1;
@@ -118,9 +117,8 @@ copy_isp_stage_to_sp_stage(void)
 	sh_css_sp_stage.enable.s3a = sh_css_isp_stage.binary_info.enable.s3a;
 }
 
-void
-store_sp_stage_data(enum ia_css_pipe_id id, unsigned int pipe_num,
-		    unsigned int stage)
+void store_sp_stage_data(enum ia_css_pipe_id id, unsigned int pipe_num,
+			 unsigned int stage)
 {
 	unsigned int thread_id;
 
@@ -136,8 +134,7 @@ store_sp_stage_data(enum ia_css_pipe_id id, unsigned int pipe_num,
 	sh_css_sp_stage.program_input_circuit = false;
 }
 
-static void
-store_sp_per_frame_data(const struct ia_css_fw_info *fw)
+static void store_sp_per_frame_data(const struct ia_css_fw_info *fw)
 {
 	unsigned int HIVE_ADDR_sp_per_frame_data = 0;
 
@@ -154,16 +151,13 @@ store_sp_per_frame_data(const struct ia_css_fw_info *fw)
 		return;
 	}
 
-	sp_dmem_store(SP0_ID,
-		      (unsigned int)sp_address_of(sp_per_frame_data),
-		      &per_frame_data,
-		      sizeof(per_frame_data));
+	sp_dmem_store(SP0_ID, (unsigned int)sp_address_of(sp_per_frame_data),
+		      &per_frame_data, sizeof(per_frame_data));
 }
 
-static void
-sh_css_store_sp_per_frame_data(enum ia_css_pipe_id pipe_id,
-			       unsigned int pipe_num,
-			       const struct ia_css_fw_info *sp_fw)
+static void sh_css_store_sp_per_frame_data(enum ia_css_pipe_id pipe_id,
+					   unsigned int pipe_num,
+					   const struct ia_css_fw_info *sp_fw)
 {
 	if (!sp_fw)
 		sp_fw = &sh_css_sp_fw;
@@ -175,8 +169,7 @@ sh_css_store_sp_per_frame_data(enum ia_css_pipe_id pipe_id,
 
 #if SP_DEBUG != SP_DEBUG_NONE
 
-void
-sh_css_sp_get_debug_state(struct sh_css_sp_debug_state *state)
+void sh_css_sp_get_debug_state(struct sh_css_sp_debug_state *state)
 {
 	const struct ia_css_fw_info *fw = &sh_css_sp_fw;
 	unsigned int HIVE_ADDR_sp_output = fw->info.sp.output;
@@ -193,10 +186,9 @@ sh_css_sp_get_debug_state(struct sh_css_sp_debug_state *state)
 
 #endif
 
-void
-sh_css_sp_start_binary_copy(unsigned int pipe_num,
-			    struct ia_css_frame *out_frame,
-			    unsigned int two_ppc)
+void sh_css_sp_start_binary_copy(unsigned int pipe_num,
+				 struct ia_css_frame *out_frame,
+				 unsigned int two_ppc)
 {
 	enum ia_css_pipe_id pipe_id;
 	unsigned int thread_id;
@@ -284,8 +276,10 @@ sh_css_sp_start_raw_copy(struct ia_css_frame *out_frame,
 	pipe->copy.raw.max_input_width = max_input_width;
 	pipe->num_stages = 1;
 	pipe->pipe_id = pipe_id;
-	/* TODO: next indicates from which queues parameters need to be
-		 sampled, needs checking/improvement */
+	/*
+	 * TODO: next indicates from which queues parameters need to be
+	 * sampled, needs checking/improvement
+	 */
 	if (pipe_conf_override == SH_CSS_PIPE_CONFIG_OVRD_NO_OVRD)
 		pipe->pipe_config =
 		    (SH_CSS_PIPE_CONFIG_SAMPLE_PARAMS << thread_id);
@@ -321,10 +315,10 @@ sh_css_sp_start_raw_copy(struct ia_css_frame *out_frame,
 	ia_css_debug_pipe_graph_dump_sp_raw_copy(out_frame);
 }
 
-static void
-sh_css_sp_start_isys_copy(struct ia_css_frame *out_frame,
-			  unsigned int pipe_num, unsigned int max_input_width,
-			  unsigned int if_config_index)
+static void sh_css_sp_start_isys_copy(struct ia_css_frame *out_frame,
+				      unsigned int pipe_num,
+				      unsigned int max_input_width,
+				      unsigned int if_config_index)
 {
 	enum ia_css_pipe_id pipe_id;
 	unsigned int thread_id;
@@ -385,8 +379,7 @@ sh_css_sp_start_isys_copy(struct ia_css_frame *out_frame,
 	ia_css_debug_pipe_graph_dump_sp_raw_copy(out_frame);
 }
 
-unsigned int
-sh_css_sp_get_binary_copy_size(void)
+unsigned int sh_css_sp_get_binary_copy_size(void)
 {
 	const struct ia_css_fw_info *fw = &sh_css_sp_fw;
 	unsigned int HIVE_ADDR_sp_output = fw->info.sp.output;
@@ -396,8 +389,7 @@ sh_css_sp_get_binary_copy_size(void)
 	return load_sp_array_uint(sp_output, offset);
 }
 
-unsigned int
-sh_css_sp_get_sw_interrupt_value(unsigned int irq)
+unsigned int sh_css_sp_get_sw_interrupt_value(unsigned int irq)
 {
 	const struct ia_css_fw_info *fw = &sh_css_sp_fw;
 	unsigned int HIVE_ADDR_sp_output = fw->info.sp.output;
@@ -422,16 +414,17 @@ sh_css_copy_buffer_attr_to_spbuffer(struct ia_css_buffer_sp *dest_buf,
 		 */
 		assert(queue_id < SH_CSS_MAX_NUM_QUEUES);
 
-		/* Klocwork assumes assert can be disabled;
-		   Since we can get there with any type, and it does not
-		   know that frame_in->dynamic_data_index can only be set
-		   for one of the types in the assert) it has to assume we
-		   can get here for any type. however this could lead to an
-		   out of bounds reference when indexing buf_type about 10
-		   lines below. In order to satisfy KW an additional if
-		   has been added. This one will always yield true.
+		/*
+		 * Klocwork assumes assert can be disabled;
+		 * Since we can get there with any type, and it does not
+		 * know that frame_in->dynamic_data_index can only be set
+		 * for one of the types in the assert) it has to assume we
+		 * can get here for any type. however this could lead to an
+		 * out of bounds reference when indexing buf_type about 10
+		 * lines below. In order to satisfy KW an additional if
+		 * has been added. This one will always yield true.
 		 */
-		if ((queue_id < SH_CSS_MAX_NUM_QUEUES)) {
+		if (queue_id < SH_CSS_MAX_NUM_QUEUES) {
 			dest_buf->buf_src.queue_id = queue_id;
 		}
 	} else {
@@ -441,9 +434,8 @@ sh_css_copy_buffer_attr_to_spbuffer(struct ia_css_buffer_sp *dest_buf,
 	dest_buf->buf_type = buf_type;
 }
 
-static void
-sh_css_copy_frame_to_spframe(struct ia_css_frame_sp *sp_frame_out,
-			     const struct ia_css_frame *frame_in)
+static void sh_css_copy_frame_to_spframe(struct ia_css_frame_sp *sp_frame_out,
+					 const struct ia_css_frame *frame_in)
 {
 	assert(frame_in);
 
@@ -534,13 +526,12 @@ sh_css_copy_frame_to_spframe(struct ia_css_frame_sp *sp_frame_out,
 	}
 }
 
-static int
-set_input_frame_buffer(const struct ia_css_frame *frame) {
+static int set_input_frame_buffer(const struct ia_css_frame *frame)
+{
 	if (!frame)
 		return -EINVAL;
 
-	switch (frame->info.format)
-	{
+	switch (frame->info.format) {
 	case IA_CSS_FRAME_FORMAT_QPLANE6:
 	case IA_CSS_FRAME_FORMAT_YUV420_16:
 	case IA_CSS_FRAME_FORMAT_RAW_PACKED:
@@ -564,14 +555,13 @@ set_input_frame_buffer(const struct ia_css_frame *frame) {
 	return 0;
 }
 
-static int
-set_output_frame_buffer(const struct ia_css_frame *frame,
-			unsigned int idx) {
+static int set_output_frame_buffer(const struct ia_css_frame *frame,
+				   unsigned int idx)
+{
 	if (!frame)
 		return -EINVAL;
 
-	switch (frame->info.format)
-	{
+	switch (frame->info.format) {
 	case IA_CSS_FRAME_FORMAT_YUV420:
 	case IA_CSS_FRAME_FORMAT_YUV422:
 	case IA_CSS_FRAME_FORMAT_YUV444:
@@ -606,13 +596,12 @@ set_output_frame_buffer(const struct ia_css_frame *frame,
 	return 0;
 }
 
-static int
-set_view_finder_buffer(const struct ia_css_frame *frame) {
+static int set_view_finder_buffer(const struct ia_css_frame *frame)
+{
 	if (!frame)
 		return -EINVAL;
 
-	switch (frame->info.format)
-	{
+	switch (frame->info.format) {
 	/* the dual output pin */
 	case IA_CSS_FRAME_FORMAT_NV12:
 	case IA_CSS_FRAME_FORMAT_NV12_16:
@@ -637,11 +626,9 @@ set_view_finder_buffer(const struct ia_css_frame *frame) {
 }
 
 #if !defined(ISP2401)
-void sh_css_sp_set_if_configs(
-    const input_formatter_cfg_t	*config_a,
-    const input_formatter_cfg_t	*config_b,
-    const uint8_t		if_config_index
-)
+void sh_css_sp_set_if_configs(const input_formatter_cfg_t *config_a,
+			      const input_formatter_cfg_t *config_b,
+			      const uint8_t if_config_index)
 {
 	assert(if_config_index < SH_CSS_MAX_IF_CONFIGS);
 	assert(config_a);
@@ -661,10 +648,8 @@ void sh_css_sp_set_if_configs(
 #endif
 
 #if !defined(ISP2401)
-void
-sh_css_sp_program_input_circuit(int fmt_type,
-				int ch_id,
-				enum ia_css_input_mode input_mode)
+void sh_css_sp_program_input_circuit(int fmt_type, int ch_id,
+				     enum ia_css_input_mode input_mode)
 {
 	sh_css_sp_group.config.input_circuit.no_side_band = false;
 	sh_css_sp_group.config.input_circuit.fmt_type     = fmt_type;
@@ -680,10 +665,8 @@ sh_css_sp_program_input_circuit(int fmt_type,
 #endif
 
 #if !defined(ISP2401)
-void
-sh_css_sp_configure_sync_gen(int width, int height,
-			     int hblank_cycles,
-			     int vblank_cycles)
+void sh_css_sp_configure_sync_gen(int width, int height,
+				  int hblank_cycles, int vblank_cycles)
 {
 	sh_css_sp_group.config.sync_gen.width	       = width;
 	sh_css_sp_group.config.sync_gen.height	       = height;
@@ -691,12 +674,9 @@ sh_css_sp_configure_sync_gen(int width, int height,
 	sh_css_sp_group.config.sync_gen.vblank_cycles = vblank_cycles;
 }
 
-void
-sh_css_sp_configure_tpg(int x_mask,
-			int y_mask,
-			int x_delta,
-			int y_delta,
-			int xy_mask)
+void sh_css_sp_configure_tpg(int x_mask, int y_mask,
+			     int x_delta, int y_delta,
+			     int xy_mask)
 {
 	sh_css_sp_group.config.tpg.x_mask  = x_mask;
 	sh_css_sp_group.config.tpg.y_mask  = y_mask;
@@ -705,15 +685,13 @@ sh_css_sp_configure_tpg(int x_mask,
 	sh_css_sp_group.config.tpg.xy_mask = xy_mask;
 }
 
-void
-sh_css_sp_configure_prbs(int seed)
+void sh_css_sp_configure_prbs(int seed)
 {
 	sh_css_sp_group.config.prbs.seed = seed;
 }
 #endif
 
-void
-sh_css_sp_configure_enable_raw_pool_locking(bool lock_all)
+void sh_css_sp_configure_enable_raw_pool_locking(bool lock_all)
 {
 	sh_css_sp_group.config.enable_raw_pool_locking = true;
 	sh_css_sp_group.config.lock_all = lock_all;
@@ -725,14 +703,13 @@ sh_css_sp_enable_isys_event_queue(bool enable)
 	sh_css_sp_group.config.enable_isys_event_queue = enable;
 }
 
-void
-sh_css_sp_set_disable_continuous_viewfinder(bool flag)
+void sh_css_sp_set_disable_continuous_viewfinder(bool flag)
 {
 	sh_css_sp_group.config.disable_cont_vf = flag;
 }
 
-static int
-sh_css_sp_write_frame_pointers(const struct sh_css_binary_args *args) {
+static int sh_css_sp_write_frame_pointers(const struct sh_css_binary_args *args)
+{
 	int err = 0;
 	int i;
 
@@ -742,23 +719,23 @@ sh_css_sp_write_frame_pointers(const struct sh_css_binary_args *args) {
 		err = set_input_frame_buffer(args->in_frame);
 	if (!err && args->out_vf_frame)
 		err = set_view_finder_buffer(args->out_vf_frame);
-	for (i = 0; i < IA_CSS_BINARY_MAX_OUTPUT_PORTS; i++)
-	{
+	for (i = 0; i < IA_CSS_BINARY_MAX_OUTPUT_PORTS; i++) {
 		if (!err && args->out_frame[i])
 			err = set_output_frame_buffer(args->out_frame[i], i);
 	}
 
-	/* we don't pass this error back to the upper layer, so we add a assert here
-	   because we actually hit the error here but it still works by accident... */
-	if (err) assert(false);
+	/*
+	 * we don't pass this error back to the upper layer, so we add a assert here
+	 * because we actually hit the error here but it still works by accident...
+	 */
+	if (err)
+		assert(false);
 	return err;
 }
 
-static void
-sh_css_sp_init_group(bool two_ppc,
-		     enum atomisp_input_format input_format,
-		     bool no_isp_sync,
-		     uint8_t if_config_index)
+static void sh_css_sp_init_group(bool two_ppc,
+				 enum atomisp_input_format input_format,
+				 bool no_isp_sync, uint8_t if_config_index)
 {
 #if !defined(ISP2401)
 	sh_css_sp_group.config.input_formatter.isp_2ppc = two_ppc;
@@ -768,7 +745,8 @@ sh_css_sp_init_group(bool two_ppc,
 
 	sh_css_sp_group.config.no_isp_sync = (uint8_t)no_isp_sync;
 	/* decide whether the frame is processed online or offline */
-	if (if_config_index == SH_CSS_IF_CONFIG_NOT_NEEDED) return;
+	if (if_config_index == SH_CSS_IF_CONFIG_NOT_NEEDED)
+		return;
 #if !defined(ISP2401)
 	assert(if_config_index < SH_CSS_MAX_IF_CONFIGS);
 	sh_css_sp_group.config.input_formatter.set[if_config_index].stream_format =
@@ -778,21 +756,19 @@ sh_css_sp_init_group(bool two_ppc,
 #endif
 }
 
-void
-sh_css_stage_write_binary_info(struct ia_css_binary_info *info)
+void sh_css_stage_write_binary_info(struct ia_css_binary_info *info)
 {
 	assert(info);
 	sh_css_isp_stage.binary_info = *info;
 }
 
-static int
-copy_isp_mem_if_to_ddr(struct ia_css_binary *binary) {
+static int copy_isp_mem_if_to_ddr(struct ia_css_binary *binary)
+{
 	int err;
 
-	err = ia_css_isp_param_copy_isp_mem_if_to_ddr(
-	    &binary->css_params,
-	    &binary->mem_params,
-	    IA_CSS_PARAM_CLASS_CONFIG);
+	err = ia_css_isp_param_copy_isp_mem_if_to_ddr(&binary->css_params,
+						      &binary->mem_params,
+						      IA_CSS_PARAM_CLASS_CONFIG);
 	if (err)
 		return err;
 	err = ia_css_isp_param_copy_isp_mem_if_to_ddr(
@@ -804,20 +780,17 @@ copy_isp_mem_if_to_ddr(struct ia_css_binary *binary) {
 	return 0;
 }
 
-static bool
-is_sp_stage(struct ia_css_pipeline_stage *stage)
+static bool is_sp_stage(struct ia_css_pipeline_stage *stage)
 {
 	assert(stage);
 	return stage->sp_func != IA_CSS_PIPELINE_NO_FUNC;
 }
 
-static int
-configure_isp_from_args(
-    const struct sh_css_sp_pipeline *pipeline,
-    const struct ia_css_binary      *binary,
-    const struct sh_css_binary_args *args,
-    bool two_ppc,
-    bool deinterleaved) {
+static int configure_isp_from_args(const struct sh_css_sp_pipeline *pipeline,
+				   const struct ia_css_binary *binary,
+				   const struct sh_css_binary_args *args,
+				   bool two_ppc, bool deinterleaved)
+{
 	ia_css_fpn_configure(binary,  &binary->in_frame_info);
 	ia_css_crop_configure(binary, &args->delay_frames[0]->info);
 	ia_css_qplane_configure(pipeline, binary, &binary->in_frame_info);
@@ -850,34 +823,31 @@ configure_isp_from_args(
 	return 0;
 }
 
-static void
-initialize_isp_states(const struct ia_css_binary *binary)
+static void initialize_isp_states(const struct ia_css_binary *binary)
 {
 	unsigned int i;
 
 	if (!binary->info->mem_offsets.offsets.state)
 		return;
-	for (i = 0; i < IA_CSS_NUM_STATE_IDS; i++) {
+	for (i = 0; i < IA_CSS_NUM_STATE_IDS; i++)
 		ia_css_kernel_init_state[i](binary);
-	}
 }
 
-static void
-initialize_frame_buffer_attribute(struct ia_css_buffer_sp *buf_attr)
+static void initialize_frame_buffer_attribute(struct ia_css_buffer_sp *buf_attr)
 {
 	buf_attr->buf_src.queue_id = SH_CSS_INVALID_QUEUE_ID;
 	buf_attr->buf_type = IA_CSS_BUFFER_TYPE_INVALID;
 }
 
-static void
-initialize_stage_frames(struct ia_css_frames_sp *frames)
+static void initialize_stage_frames(struct ia_css_frames_sp *frames)
 {
 	unsigned int i;
 
 	initialize_frame_buffer_attribute(&frames->in.buf_attr);
-	for (i = 0; i < IA_CSS_BINARY_MAX_OUTPUT_PORTS; i++) {
+
+	for (i = 0; i < IA_CSS_BINARY_MAX_OUTPUT_PORTS; i++)
 		initialize_frame_buffer_attribute(&frames->out[i].buf_attr);
-	}
+
 	initialize_frame_buffer_attribute(&frames->out_vf.buf_attr);
 	initialize_frame_buffer_attribute(&frames->s3a_buf);
 	initialize_frame_buffer_attribute(&frames->dvs_buf);
@@ -896,7 +866,8 @@ sh_css_sp_init_stage(struct ia_css_binary *binary,
 		     bool xnr,
 		     const struct ia_css_isp_param_css_segments *isp_mem_if,
 		     unsigned int if_config_index,
-		     bool two_ppc) {
+		     bool two_ppc)
+{
 	const struct ia_css_binary_xinfo *xinfo;
 	const struct ia_css_binary_info  *info;
 	int err = 0;
@@ -928,8 +899,7 @@ sh_css_sp_init_stage(struct ia_css_binary *binary,
 
 	ia_css_pipeline_get_sp_thread_id(pipe_num, &thread_id);
 
-	if (!info)
-	{
+	if (!info) {
 		sh_css_sp_group.pipe[thread_id].sp_stage_addr[stage] = mmgr_NULL;
 		return 0;
 	}
@@ -953,16 +923,16 @@ sh_css_sp_init_stage(struct ia_css_binary *binary,
 	sh_css_sp_stage.isp_copy_output = (uint8_t)args->copy_output;
 	sh_css_sp_stage.enable.vf_output = (args->out_vf_frame != NULL);
 
-	/* Copy the frame infos first, to be overwritten by the frames,
-	   if these are present.
-	*/
+	/*
+	 * Copy the frame infos first, to be overwritten by the frames,
+	 * if these are present.
+	 */
 	sh_css_sp_stage.frames.effective_in_res.width = binary->effective_in_frame_res.width;
 	sh_css_sp_stage.frames.effective_in_res.height = binary->effective_in_frame_res.height;
 
 	ia_css_frame_info_to_frame_sp_info(&sh_css_sp_stage.frames.in.info,
 					   &binary->in_frame_info);
-	for (i = 0; i < IA_CSS_BINARY_MAX_OUTPUT_PORTS; i++)
-	{
+	for (i = 0; i < IA_CSS_BINARY_MAX_OUTPUT_PORTS; i++) {
 		ia_css_frame_info_to_frame_sp_info(&sh_css_sp_stage.frames.out[i].info,
 						   &binary->out_frame_info[i]);
 	}
@@ -996,16 +966,14 @@ sh_css_sp_init_stage(struct ia_css_binary *binary,
 
 	err = sh_css_sp_write_frame_pointers(args);
 	/* TODO: move it to a better place */
-	if (binary->info->sp.enable.s3a)
-	{
+	if (binary->info->sp.enable.s3a) {
 		ia_css_query_internal_queue_id(IA_CSS_BUFFER_TYPE_3A_STATISTICS, thread_id,
 					       &queue_id);
 		sh_css_copy_buffer_attr_to_spbuffer(&sh_css_sp_stage.frames.s3a_buf, queue_id,
 						    mmgr_EXCEPTION,
 						    IA_CSS_BUFFER_TYPE_3A_STATISTICS);
 	}
-	if (binary->info->sp.enable.dis)
-	{
+	if (binary->info->sp.enable.dis) {
 		ia_css_query_internal_queue_id(IA_CSS_BUFFER_TYPE_DIS_STATISTICS, thread_id,
 					       &queue_id);
 		sh_css_copy_buffer_attr_to_spbuffer(&sh_css_sp_stage.frames.dvs_buf, queue_id,
@@ -1041,21 +1009,24 @@ sh_css_sp_init_stage(struct ia_css_binary *binary,
 
 	initialize_isp_states(binary);
 
-	/* we do this only for preview pipe because in fill_binary_info function
+	/*
+	 * we do this only for preview pipe because in fill_binary_info function
 	 * we assign vf_out res to out res, but for ISP internal processing, we need
 	 * the original out res. for video pipe, it has two output pins --- out and
-	 * vf_out, so it can keep these two resolutions already. */
+	 * vf_out, so it can keep these two resolutions already.
+	 */
 	if (binary->info->sp.pipeline.mode == IA_CSS_BINARY_MODE_PREVIEW &&
-	    (binary->vf_downscale_log2 > 0))
-	{
-		/* TODO: Remove this after preview output decimation is fixed
-		 * by configuring out&vf info fiels properly */
+	    (binary->vf_downscale_log2 > 0)) {
+		/*
+		 * TODO: Remove this after preview output decimation is fixed
+		 * by configuring out&vf info files properly
+		 */
 		sh_css_sp_stage.frames.out[0].info.padded_width
-		<<= binary->vf_downscale_log2;
+			<<= binary->vf_downscale_log2;
 		sh_css_sp_stage.frames.out[0].info.res.width
-		<<= binary->vf_downscale_log2;
+			<<= binary->vf_downscale_log2;
 		sh_css_sp_stage.frames.out[0].info.res.height
-		<<= binary->vf_downscale_log2;
+			<<= binary->vf_downscale_log2;
 	}
 	err = copy_isp_mem_if_to_ddr(binary);
 	if (err)
@@ -1064,12 +1035,10 @@ sh_css_sp_init_stage(struct ia_css_binary *binary,
 	return 0;
 }
 
-static int
-sp_init_stage(struct ia_css_pipeline_stage *stage,
-	      unsigned int pipe_num,
-	      bool xnr,
-	      unsigned int if_config_index,
-	      bool two_ppc) {
+static int sp_init_stage(struct ia_css_pipeline_stage *stage,
+			 unsigned int pipe_num, bool xnr,
+			 unsigned int if_config_index, bool two_ppc)
+{
 	struct ia_css_binary *binary;
 	const struct ia_css_fw_info *firmware;
 	const struct sh_css_binary_args *args;
@@ -1080,20 +1049,22 @@ sp_init_stage(struct ia_css_pipeline_stage *stage,
 	 */
 	const char *binary_name = "";
 	const struct ia_css_binary_xinfo *info = NULL;
-	/* note: the var below is made static as it is quite large;
-	   if it is not static it ends up on the stack which could
-	   cause issues for drivers
-	*/
+	/*
+	 * note: the var below is made static as it is quite large;
+	 * if it is not static it ends up on the stack which could
+	 * cause issues for drivers
+	 */
 	static struct ia_css_binary tmp_binary;
 	const struct ia_css_blob_info *blob_info = NULL;
 	struct ia_css_isp_param_css_segments isp_mem_if;
-	/* LA: should be ia_css_data, should not contain host pointer.
-	   However, CSS/DDR pointer is not available yet.
-	   Hack is to store it in params->ddr_ptrs and then copy it late in the SP just before vmem init.
-	   TODO: Call this after CSS/DDR allocation and store that pointer.
-	   Best is to allocate it at stage creation time together with host pointer.
-	   Remove vmem from params.
-	*/
+	/*
+	 * LA: should be ia_css_data, should not contain host pointer.
+	 * However, CSS/DDR pointer is not available yet.
+	 * Hack is to store it in params->ddr_ptrs and then copy it late in the SP just before vmem init.
+	 * TODO: Call this after CSS/DDR allocation and store that pointer.
+	 * Best is to allocate it at stage creation time together with host pointer.
+	 * Remove vmem from params.
+	 */
 	struct ia_css_isp_param_css_segments *mem_if = &isp_mem_if;
 
 	int err = 0;
@@ -1105,14 +1076,12 @@ sp_init_stage(struct ia_css_pipeline_stage *stage,
 	args = &stage->args;
 	stage_num = stage->stage_num;
 
-	if (binary)
-	{
+	if (binary) {
 		info = binary->info;
 		binary_name = (const char *)(info->blob->name);
 		blob_info = &info->blob->header.blob;
 		ia_css_init_memory_interface(mem_if, &binary->mem_params, &binary->css_params);
-	} else if (firmware)
-	{
+	} else if (firmware) {
 		const struct ia_css_frame_info *out_infos[IA_CSS_BINARY_MAX_OUTPUT_PORTS] = {NULL};
 
 		if (args->out_frame[0])
@@ -1120,49 +1089,37 @@ sp_init_stage(struct ia_css_pipeline_stage *stage,
 		info = &firmware->info.isp;
 		ia_css_binary_fill_info(info, false, false,
 					ATOMISP_INPUT_FORMAT_RAW_10,
-					args->in_frame  ? &args->in_frame->info  : NULL,
-					NULL,
-					out_infos,
-					args->out_vf_frame ? &args->out_vf_frame->info
-					: NULL,
-					&tmp_binary,
-					NULL,
-					-1, true);
+					args->in_frame ? &args->in_frame->info : NULL,
+					NULL, out_infos,
+					args->out_vf_frame ? &args->out_vf_frame->info : NULL,
+					&tmp_binary, NULL, -1, true);
 		binary = &tmp_binary;
 		binary->info = info;
 		binary_name = IA_CSS_EXT_ISP_PROG_NAME(firmware);
 		blob_info = &firmware->blob;
 		mem_if = (struct ia_css_isp_param_css_segments *)&firmware->mem_initializers;
-	} else
-	{
+	} else {
 		/* SP stage */
 		assert(stage->sp_func != IA_CSS_PIPELINE_NO_FUNC);
-		/* binary and blob_info are now NULL.
-		   These will be passed to sh_css_sp_init_stage
-		   and dereferenced there, so passing a NULL
-		   pointer is no good. return an error */
+		/*
+		 * binary and blob_info are now NULL.
+		 * These will be passed to sh_css_sp_init_stage
+		 * and dereferenced there, so passing a NULL
+		 * pointer is no good. return an error
+		 */
 		return -EINVAL;
 	}
 
-	err = sh_css_sp_init_stage(binary,
-				   (const char *)binary_name,
-				   blob_info,
-				   args,
-				   pipe_num,
-				   stage_num,
-				   xnr,
-				   mem_if,
-				   if_config_index,
-				   two_ppc);
+	err = sh_css_sp_init_stage(binary, (const char *)binary_name, blob_info,
+				   args, pipe_num, stage_num, xnr, mem_if,
+				   if_config_index, two_ppc);
 	return err;
 }
 
-static void
-sp_init_sp_stage(struct ia_css_pipeline_stage *stage,
-		 unsigned int pipe_num,
-		 bool two_ppc,
-		 enum sh_css_pipe_config_override copy_ovrd,
-		 unsigned int if_config_index)
+static void sp_init_sp_stage(struct ia_css_pipeline_stage *stage,
+			     unsigned int pipe_num, bool two_ppc,
+			     enum sh_css_pipe_config_override copy_ovrd,
+			     unsigned int if_config_index)
 {
 	const struct sh_css_binary_args *args = &stage->args;
 
@@ -1187,14 +1144,9 @@ sp_init_sp_stage(struct ia_css_pipeline_stage *stage,
 	}
 }
 
-void
-sh_css_sp_init_pipeline(struct ia_css_pipeline *me,
-			enum ia_css_pipe_id id,
-			u8 pipe_num,
-			bool xnr,
-			bool two_ppc,
-			bool continuous,
-			bool offline,
+void sh_css_sp_init_pipeline(struct ia_css_pipeline *me,
+			enum ia_css_pipe_id id, u8 pipe_num, bool xnr,
+			bool two_ppc, bool continuous, bool offline,
 			unsigned int required_bds_factor,
 			enum sh_css_pipe_config_override copy_ovrd,
 			enum ia_css_input_mode input_mode,
@@ -1204,8 +1156,8 @@ sh_css_sp_init_pipeline(struct ia_css_pipeline *me,
 			const struct ia_css_coordinate
 			*internal_frame_origin_bqs_on_sctbl, /* Origin of internal frame
 							positioned on shading table at shading correction in ISP. */
-			const struct ia_css_isp_parameters *params
-		       ) {
+			const struct ia_css_isp_parameters *params)
+{
 	/* Get first stage */
 	struct ia_css_pipeline_stage *stage        = NULL;
 	struct ia_css_binary	     *first_binary = NULL;
@@ -1223,17 +1175,13 @@ sh_css_sp_init_pipeline(struct ia_css_pipeline *me,
 	first_binary = me->stages->binary;
 
 	if (input_mode == IA_CSS_INPUT_MODE_SENSOR ||
-	    input_mode == IA_CSS_INPUT_MODE_BUFFERED_SENSOR)
-	{
+	    input_mode == IA_CSS_INPUT_MODE_BUFFERED_SENSOR) {
 		assert(port_id < N_MIPI_PORT_ID);
 		if (port_id >= N_MIPI_PORT_ID) /* should not happen but KW does not know */
 			return; /* we should be able to return an error */
 		if_config_index  = (uint8_t)(port_id - MIPI_PORT0_ID);
-	} else if (input_mode == IA_CSS_INPUT_MODE_MEMORY)
-	{
-		if_config_index = SH_CSS_IF_CONFIG_NOT_NEEDED;
-	} else
-	{
+	} else if (input_mode == IA_CSS_INPUT_MODE_MEMORY) {
+		if_config_index = SH_CSS_IF_CONFIG_NOT_NEEDED; } else {
 		if_config_index = 0x0;
 	}
 
@@ -1241,15 +1189,13 @@ sh_css_sp_init_pipeline(struct ia_css_pipeline *me,
 	memset(&sh_css_sp_group.pipe[thread_id], 0, sizeof(struct sh_css_sp_pipeline));
 
 	/* Count stages */
-	for (stage = me->stages, num = 0; stage; stage = stage->next, num++)
-	{
+	for (stage = me->stages, num = 0; stage; stage = stage->next, num++) {
 		stage->stage_num = num;
 		ia_css_debug_pipe_graph_dump_stage(stage, id);
 	}
 	me->num_stages = num;
 
-	if (first_binary)
-	{
+	if (first_binary) {
 		/* Init pipeline data */
 		sh_css_sp_init_group(two_ppc, first_binary->input_format,
 				     offline, if_config_index);
@@ -1270,21 +1216,23 @@ sh_css_sp_init_pipeline(struct ia_css_pipeline *me,
 	sh_css_sp_group.pipe[thread_id].num_execs = me->num_execs;
 	sh_css_sp_group.pipe[thread_id].pipe_qos_config = me->pipe_qos_config;
 	sh_css_sp_group.pipe[thread_id].required_bds_factor = required_bds_factor;
-	sh_css_sp_group.pipe[thread_id].input_system_mode
-	= (uint32_t)input_mode;
+	sh_css_sp_group.pipe[thread_id].input_system_mode = (uint32_t)input_mode;
 	sh_css_sp_group.pipe[thread_id].port_id = port_id;
 	sh_css_sp_group.pipe[thread_id].dvs_frame_delay = (uint32_t)me->dvs_frame_delay;
 
-	/* TODO: next indicates from which queues parameters need to be
-		 sampled, needs checking/improvement */
-	if (ia_css_pipeline_uses_params(me))
-	{
+	/*
+	 * TODO: next indicates from which queues parameters need to be
+	 * sampled, needs checking/improvement
+	 */
+	if (ia_css_pipeline_uses_params(me)) {
 		sh_css_sp_group.pipe[thread_id].pipe_config =
 		SH_CSS_PIPE_CONFIG_SAMPLE_PARAMS << thread_id;
 	}
 
-	/* For continuous use-cases, SP copy is responsible for sampling the
-	 * parameters */
+	/*
+	 * For continuous use-cases, SP copy is responsible for sampling the
+	 * parameters
+	 */
 	if (continuous)
 		sh_css_sp_group.pipe[thread_id].pipe_config = 0;
 
@@ -1293,14 +1241,12 @@ sh_css_sp_init_pipeline(struct ia_css_pipeline *me,
 	pipe = find_pipe_by_num(pipe_num);
 	assert(pipe);
 	if (!pipe)
-	{
 		return;
-	}
+
 	sh_css_sp_group.pipe[thread_id].scaler_pp_lut = sh_css_pipe_get_pp_gdc_lut(pipe);
 
 #if defined(SH_CSS_ENABLE_METADATA)
-	if (md_info && md_info->size > 0)
-	{
+	if (md_info && md_info->size > 0) {
 		sh_css_sp_group.pipe[thread_id].metadata.width  = md_info->resolution.width;
 		sh_css_sp_group.pipe[thread_id].metadata.height = md_info->resolution.height;
 		sh_css_sp_group.pipe[thread_id].metadata.stride = md_info->stride;
@@ -1316,8 +1262,7 @@ sh_css_sp_init_pipeline(struct ia_css_pipeline *me,
 
 #if defined(SH_CSS_ENABLE_PER_FRAME_PARAMS)
 	sh_css_sp_group.pipe[thread_id].output_frame_queue_id = (uint32_t)SH_CSS_INVALID_QUEUE_ID;
-	if (pipe_id != IA_CSS_PIPE_ID_COPY)
-	{
+	if (pipe_id != IA_CSS_PIPE_ID_COPY) {
 		ia_css_query_internal_queue_id(IA_CSS_BUFFER_TYPE_OUTPUT_FRAME, thread_id,
 					       (enum sh_css_queue_id *)(
 						   &sh_css_sp_group.pipe[thread_id].output_frame_queue_id));
@@ -1325,18 +1270,17 @@ sh_css_sp_init_pipeline(struct ia_css_pipeline *me,
 #endif
 
 	if (IS_ISP2401) {
-		/* For the shading correction type 1 (the legacy shading table conversion in css is not used),
-		* the parameters are passed to the isp for the shading table centering.
-		*/
+		/*
+		 * For the shading correction type 1 (the legacy shading table conversion in css is not used),
+		 * the parameters are passed to the isp for the shading table centering.
+		 */
 		if (internal_frame_origin_bqs_on_sctbl &&
-		    params && params->shading_settings.enable_shading_table_conversion == 0)
-		{
+		    params && params->shading_settings.enable_shading_table_conversion == 0) {
 			sh_css_sp_group.pipe[thread_id].shading.internal_frame_origin_x_bqs_on_sctbl
 			= (uint32_t)internal_frame_origin_bqs_on_sctbl->x;
 			sh_css_sp_group.pipe[thread_id].shading.internal_frame_origin_y_bqs_on_sctbl
 			= (uint32_t)internal_frame_origin_bqs_on_sctbl->y;
-		} else
-		{
+		} else {
 			sh_css_sp_group.pipe[thread_id].shading.internal_frame_origin_x_bqs_on_sctbl =
 			0;
 			sh_css_sp_group.pipe[thread_id].shading.internal_frame_origin_y_bqs_on_sctbl =
@@ -1347,8 +1291,7 @@ sh_css_sp_init_pipeline(struct ia_css_pipeline *me,
 	IA_CSS_LOG("pipe_id %d port_config %08x",
 		   pipe_id, sh_css_sp_group.pipe[thread_id].inout_port_config);
 
-	for (stage = me->stages, num = 0; stage; stage = stage->next, num++)
-	{
+	for (stage = me->stages, num = 0; stage; stage = stage->next, num++) {
 		sh_css_sp_group.pipe[thread_id].num_stages++;
 		if (is_sp_stage(stage)) {
 			sp_init_sp_stage(stage, pipe_num, two_ppc,
@@ -1370,8 +1313,7 @@ sh_css_sp_init_pipeline(struct ia_css_pipeline *me,
 	store_sp_group_data();
 }
 
-void
-sh_css_sp_uninit_pipeline(unsigned int pipe_num)
+void sh_css_sp_uninit_pipeline(unsigned int pipe_num)
 {
 	unsigned int thread_id;
 
@@ -1399,8 +1341,8 @@ bool sh_css_write_host2sp_command(enum host2sp_commands host2sp_command)
 	return (last_cmd == host2sp_cmd_ready);
 }
 
-enum host2sp_commands
-sh_css_read_host2sp_command(void) {
+enum host2sp_commands sh_css_read_host2sp_command(void)
+{
 	unsigned int HIVE_ADDR_host_sp_com = sh_css_sp_fw.info.sp.host_sp_com;
 	unsigned int offset = (unsigned int)offsetof(struct host_sp_communication, host2sp_command)
 	/ sizeof(int);
@@ -1412,15 +1354,14 @@ sh_css_read_host2sp_command(void) {
  * Frame data is no longer part of the sp_stage structure but part of a
  * separate structure. The aim is to make the sp_data struct static
  * (it defines a pipeline) and that the dynamic (per frame) data is stored
- * separetly.
+ * separately.
  *
  * This function must be called first every where were you start constructing
  * a new pipeline by defining one or more stages with use of variable
  * sh_css_sp_stage. Even the special cases like accelerator and copy_frame
  * These have a pipeline of just 1 stage.
  */
-void
-sh_css_init_host2sp_frame_data(void)
+void sh_css_init_host2sp_frame_data(void)
 {
 	/* Clean table */
 	unsigned int HIVE_ADDR_host_sp_com = sh_css_sp_fw.info.sp.host_sp_com;
@@ -1438,11 +1379,9 @@ sh_css_init_host2sp_frame_data(void)
  * @brief Update the offline frame information in host_sp_communication.
  * Refer to "sh_css_sp.h" for more details.
  */
-void
-sh_css_update_host2sp_offline_frame(
-    unsigned int frame_num,
-    struct ia_css_frame *frame,
-    struct ia_css_metadata *metadata)
+void sh_css_update_host2sp_offline_frame(unsigned int frame_num,
+					 struct ia_css_frame *frame,
+					 struct ia_css_metadata *metadata)
 {
 	unsigned int HIVE_ADDR_host_sp_com;
 	unsigned int offset;
@@ -1469,10 +1408,8 @@ sh_css_update_host2sp_offline_frame(
  * @brief Update the mipi frame information in host_sp_communication.
  * Refer to "sh_css_sp.h" for more details.
  */
-void
-sh_css_update_host2sp_mipi_frame(
-    unsigned int frame_num,
-    struct ia_css_frame *frame)
+void sh_css_update_host2sp_mipi_frame(unsigned int frame_num,
+				      struct ia_css_frame *frame)
 {
 	unsigned int HIVE_ADDR_host_sp_com;
 	unsigned int offset;
@@ -1495,10 +1432,8 @@ sh_css_update_host2sp_mipi_frame(
  * @brief Update the mipi metadata information in host_sp_communication.
  * Refer to "sh_css_sp.h" for more details.
  */
-void
-sh_css_update_host2sp_mipi_metadata(
-    unsigned int frame_num,
-    struct ia_css_metadata *metadata)
+void sh_css_update_host2sp_mipi_metadata(unsigned int frame_num,
+					 struct ia_css_metadata *metadata)
 {
 	unsigned int HIVE_ADDR_host_sp_com;
 	unsigned int o;
@@ -1515,8 +1450,7 @@ sh_css_update_host2sp_mipi_metadata(
 			    metadata ? metadata->address : 0);
 }
 
-void
-sh_css_update_host2sp_num_mipi_frames(unsigned int num_frames)
+void sh_css_update_host2sp_num_mipi_frames(unsigned int num_frames)
 {
 	unsigned int HIVE_ADDR_host_sp_com;
 	unsigned int offset;
@@ -1552,16 +1486,15 @@ sh_css_update_host2sp_cont_num_raw_frames(unsigned int num_frames,
 						      host2sp_cont_extra_num_raw_frames)
 			       / sizeof(int);
 		store_sp_array_uint(host_sp_com, offset_extra, extra_num_frames);
-	} else
+	} else {
 		offset = (unsigned int)offsetof(struct host_sp_communication,
 						host2sp_cont_target_num_raw_frames)
 			 / sizeof(int);
-
+	}
 	store_sp_array_uint(host_sp_com, offset, num_frames);
 }
 
-void
-sh_css_event_init_irq_mask(void)
+void sh_css_event_init_irq_mask(void)
 {
 	int i;
 	unsigned int HIVE_ADDR_host_sp_com = sh_css_sp_fw.info.sp.host_sp_com;
@@ -1586,7 +1519,8 @@ sh_css_event_init_irq_mask(void)
 int
 ia_css_pipe_set_irq_mask(struct ia_css_pipe *pipe,
 			 unsigned int or_mask,
-			 unsigned int and_mask) {
+			 unsigned int and_mask)
+{
 	unsigned int HIVE_ADDR_host_sp_com = sh_css_sp_fw.info.sp.host_sp_com;
 	unsigned int offset;
 	struct sh_css_event_irq_mask event_irq_mask;
@@ -1625,7 +1559,8 @@ ia_css_pipe_set_irq_mask(struct ia_css_pipe *pipe,
 int
 ia_css_event_get_irq_mask(const struct ia_css_pipe *pipe,
 			  unsigned int *or_mask,
-			  unsigned int *and_mask) {
+			  unsigned int *and_mask)
+{
 	unsigned int HIVE_ADDR_host_sp_com = sh_css_sp_fw.info.sp.host_sp_com;
 	unsigned int offset;
 	struct sh_css_event_irq_mask event_irq_mask;
-- 
2.30.2



_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


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

* [PATCH RESEND 5/5] staging: media: atomisp: code formatting changes sh_css_version.c
  2021-05-01  6:48 ` [PATCH 5/5] staging: media: atomisp: code formatting changes sh_css_version.c Deepak R Varma
@ 2021-05-20 19:06   ` Deepak R Varma
  0 siblings, 0 replies; 15+ messages in thread
From: Deepak R Varma @ 2021-05-20 19:06 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Sakari Ailus, Greg Kroah-Hartman
  Cc: devel, drv, linux-kernel, linux-media

Trivial code reformatting changes done according to the coding
style guidelines. These code changes overall improve code readability
and also address chackpatch complaints.

Signed-off-by: Deepak R Varma <drv@mailo.com>
---
 drivers/staging/media/atomisp/pci/sh_css_version.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/sh_css_version.c b/drivers/staging/media/atomisp/pci/sh_css_version.c
index fa6de61e4995..f038c61a8499 100644
--- a/drivers/staging/media/atomisp/pci/sh_css_version.c
+++ b/drivers/staging/media/atomisp/pci/sh_css_version.c
@@ -20,8 +20,8 @@
 #include "ia_css_err.h"
 #include "sh_css_firmware.h"
 
-int
-ia_css_get_version(char *version, int max_size) {
+int ia_css_get_version(char *version, int max_size)
+{
 	char *css_version;
 
 	if (!IS_ISP2401)
-- 
2.30.2



_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [PATCH 3/5] staging: media: atomisp: code formatting changes sh_css_params.c
  2021-05-01  6:46 ` [PATCH 3/5] staging: media: atomisp: code formatting changes sh_css_params.c Deepak R Varma
  2021-05-20 19:04   ` [PATCH RESEND " Deepak R Varma
@ 2021-05-21 10:52   ` Dan Carpenter
  2021-05-22 10:24     ` Deepak R Varma
  1 sibling, 1 reply; 15+ messages in thread
From: Dan Carpenter @ 2021-05-21 10:52 UTC (permalink / raw)
  To: Deepak R Varma
  Cc: devel, Greg Kroah-Hartman, linux-kernel, Sakari Ailus,
	Mauro Carvalho Chehab, linux-media

On Sat, May 01, 2021 at 12:16:07PM +0530, Deepak R Varma wrote:
> @@ -1562,8 +1544,10 @@ ia_css_isp_3a_statistics_map_allocate(
>  	base_ptr = me->data_ptr;
>  
>  	me->size = isp_stats->size;
> -	/* GCC complains when we assign a char * to a void *, so these
> -	 * casts are necessary unfortunately. */
> +	/*
> +	 * GCC complains when we assign a char * to a void *, so these
> +	 * casts are necessary unfortunately.
> +	 */

Not related to your patch, but assigning a char pointer to a void
pointer is fine and GCC will not complain.  The problem is that
me->dmem_stats is not a void pointer.  Someone should delete that
nonsense comment.

>  	me->dmem_stats    = (void *)base_ptr;
>  	me->vmem_stats_hi = (void *)(base_ptr + isp_stats->dmem_size);
>  	me->vmem_stats_lo = (void *)(base_ptr + isp_stats->dmem_size +

regards,
dan carpenter
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [PATCH 3/5] staging: media: atomisp: code formatting changes sh_css_params.c
  2021-05-21 10:52   ` [PATCH " Dan Carpenter
@ 2021-05-22 10:24     ` Deepak R Varma
  0 siblings, 0 replies; 15+ messages in thread
From: Deepak R Varma @ 2021-05-22 10:24 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: devel, Greg Kroah-Hartman, linux-kernel, Sakari Ailus,
	Mauro Carvalho Chehab, linux-media

On Fri, May 21, 2021 at 01:52:22PM +0300, Dan Carpenter wrote:
> On Sat, May 01, 2021 at 12:16:07PM +0530, Deepak R Varma wrote:
> > @@ -1562,8 +1544,10 @@ ia_css_isp_3a_statistics_map_allocate(
> >  	base_ptr = me->data_ptr;
> >  
> >  	me->size = isp_stats->size;
> > -	/* GCC complains when we assign a char * to a void *, so these
> > -	 * casts are necessary unfortunately. */
> > +	/*
> > +	 * GCC complains when we assign a char * to a void *, so these
> > +	 * casts are necessary unfortunately.
> > +	 */
> 
> Not related to your patch, but assigning a char pointer to a void
> pointer is fine and GCC will not complain.  The problem is that
> me->dmem_stats is not a void pointer.  Someone should delete that
> nonsense comment.

I agree. Well caught. I will remove these comments and send v2. Waiting for feedback
on other patches of this series.

deepak.

> 
> >  	me->dmem_stats    = (void *)base_ptr;
> >  	me->vmem_stats_hi = (void *)(base_ptr + isp_stats->dmem_size);
> >  	me->vmem_stats_lo = (void *)(base_ptr + isp_stats->dmem_size +
> 
> regards,
> dan carpenter


_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [PATCH RESEND 0/5] staging: media: atomisp: code formatting changes
  2021-05-01  6:43 [PATCH 0/5] staging: media: atomisp: code formatting changes Deepak R Varma
                   ` (5 preceding siblings ...)
  2021-05-20 19:00 ` [PATCH RESEND 0/5] staging: media: atomisp: code formatting changes Deepak R Varma
@ 2021-06-12 16:43 ` Deepak R Varma
  6 siblings, 0 replies; 15+ messages in thread
From: Deepak R Varma @ 2021-06-12 16:43 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Sakari Ailus, Greg Kroah-Hartman
  Cc: devel, linux-kernel, linux-media

On Fri, May 21, 2021 at 12:30:41AM +0530, Deepak R Varma wrote:
> This patch set overall improves the code organisation and readability of
> the files of atomisp drivers. There are several complaints reported by
> checkpatch including ERROR and WARNING types on the files under atomisp/pci
> directory.
> 
> The changes are proposed on a per file basis since there are many
> issues to be addressed in each individual file. The patches are built
> on the media_tree/for-v5.14-out1 tree/branch.

Hi All,
I have only received one comment on one of the patch of this patch set. I
have not seen any comment or ack on the other patches.

Will you review and share feedback on the patches please.

Thank you,
deepak.

> 
> 
> Deepak R Varma (5):
>   staging: media: atomisp: code formatting changes atomisp_csi2.c
>   staging: media: atomisp: code formatting changes sh_css_mipi.c
>   staging: media: atomisp: code formatting changes sh_css_params.c
>   staging: media: atomisp: code formatting changes sh_css_sp.c
>   staging: media: atomisp: code formatting changes sh_css_version.c
> 
>  .../staging/media/atomisp/pci/atomisp_csi2.c  |  72 +-
>  .../staging/media/atomisp/pci/sh_css_mipi.c   | 170 ++--
>  .../staging/media/atomisp/pci/sh_css_params.c | 929 +++++++++---------
>  drivers/staging/media/atomisp/pci/sh_css_sp.c | 471 ++++-----
>  .../media/atomisp/pci/sh_css_version.c        |   4 +-
>  5 files changed, 754 insertions(+), 892 deletions(-)
> 
> -- 
> 2.30.2
> 


_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

end of thread, other threads:[~2021-06-12 17:04 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-01  6:43 [PATCH 0/5] staging: media: atomisp: code formatting changes Deepak R Varma
2021-05-01  6:44 ` [PATCH 1/5] staging: media: atomisp: code formatting changes atomisp_csi2.c Deepak R Varma
2021-05-20 19:02   ` [PATCH RESEND " Deepak R Varma
2021-05-01  6:45 ` [PATCH 2/5] staging: media: atomisp: code formatting changes sh_css_mipi.c Deepak R Varma
2021-05-20 19:03   ` [PATCH RESEND " Deepak R Varma
2021-05-01  6:46 ` [PATCH 3/5] staging: media: atomisp: code formatting changes sh_css_params.c Deepak R Varma
2021-05-20 19:04   ` [PATCH RESEND " Deepak R Varma
2021-05-21 10:52   ` [PATCH " Dan Carpenter
2021-05-22 10:24     ` Deepak R Varma
2021-05-01  6:47 ` [PATCH 4/5] staging: media: atomisp: code formatting changes sh_css_sp.c Deepak R Varma
2021-05-20 19:05   ` [PATCH RESEND " Deepak R Varma
2021-05-01  6:48 ` [PATCH 5/5] staging: media: atomisp: code formatting changes sh_css_version.c Deepak R Varma
2021-05-20 19:06   ` [PATCH RESEND " Deepak R Varma
2021-05-20 19:00 ` [PATCH RESEND 0/5] staging: media: atomisp: code formatting changes Deepak R Varma
2021-06-12 16:43 ` Deepak R Varma

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).