Skip to contentSkip to conversation

staging: media: atomisp: Added spaces around arithmetic operators.

PATCH New Varsha Rao 1 participant 4 messages Mar 19, 2017 1 message not in the archive

Subsystems (4)
lore
Share & tools
lore

Varsha Rao

author
#1 lore raw

PATCH 1/4 staging: media: atomisp: Added spaces around arithmetic operators.

In reply to a message not in the archive

Add spaces around arithmetic operators (/, +, -), to fix the checkpatch issue.

---
 .../css2400/isp/kernels/ctc/ctc2/ia_css_ctc2.host.c        | 14 +++++++-------
 .../css2400/isp/kernels/xnr/xnr_3.0/ia_css_xnr3.host.c     |  6 +++---
 .../atomisp/platform/intel-mid/atomisp_gmin_platform.c     |  6 +++---
 3 files changed, 13 insertions(+), 13 deletions(-)
drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/ctc/ctc2/ia_css_ctc2.host.c +7 -7
index 1890d59..992b31e 100644
@@ -44,7 +44,7 @@ static int ctc2_slope(int y1, int y0, int x1, int x0)
 	const int max_slope = (1 << IA_CSS_CTC_COEF_SHIFT) - 1;
 	int dy = y1 - y0;
 	int dx = x1 - x0;
-	int rounding = (dx+1) >> 1;
+	int rounding = (dx + 1) >> 1;
 	int dy_shift = dy << shift_val;
 	int slope, dydx;
 
@@ -126,14 +126,14 @@ void ia_css_ctc2_vmem_encode(struct ia_css_isp_ctc2_vmem_params *to,
 		to->y_y[0][(i << shffl_blck) + 4] = from->y_y4;
 
 		to->e_y_slope[0][(i << shffl_blck)]    = dydx0;
-		to->e_y_slope[0][(i << shffl_blck) +1] = dydx1;
-		to->e_y_slope[0][(i << shffl_blck) +2] = dydx2;
-		to->e_y_slope[0][(i << shffl_blck) +3] = dydx3;
-		to->e_y_slope[0][(i << shffl_blck) +4] = dydx4;
+		to->e_y_slope[0][(i << shffl_blck) + 1] = dydx1;
+		to->e_y_slope[0][(i << shffl_blck) + 2] = dydx2;
+		to->e_y_slope[0][(i << shffl_blck) + 3] = dydx3;
+		to->e_y_slope[0][(i << shffl_blck) + 4] = dydx4;
 
 		for (j = 0; j < lenght_zeros; j++) {
-			to->y_x[0][(i << shffl_blck)+ 5 + j] = 0;
-			to->y_y[0][(i << shffl_blck)+ 5 + j] = 0;
+			to->y_x[0][(i << shffl_blck) + 5 + j] = 0;
+			to->y_y[0][(i << shffl_blck) + 5 + j] = 0;
 			to->e_y_slope[0][(i << shffl_blck)+ 5 + j] = 0;
 		}
 	}
drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/xnr/xnr_3.0/ia_css_xnr3.host.c +3 -3
index 1a8b852..fa97224 100644
@@ -22,7 +22,7 @@
 #include "ia_css_xnr3.host.h"
 
 /* Maximum value for alpha on ISP interface */
-#define XNR_MAX_ALPHA  ((1 << (ISP_VEC_ELEMBITS-1)) - 1)
+#define XNR_MAX_ALPHA  ((1 << (ISP_VEC_ELEMBITS - 1)) - 1)
 
 /* Minimum value for sigma on host interface. Lower values translate to
  * max_alpha. */
@@ -78,7 +78,7 @@ compute_alpha(int sigma)
 #if defined(XNR_ATE_ROUNDING_BUG)
 	int32_t alpha_unscaled;
 #else
-	int offset = sigma/2;
+	int offset = sigma / 2;
 #endif
 	if (sigma < XNR_MIN_SIGMA) {
 		alpha = XNR_MAX_ALPHA;
@@ -230,7 +230,7 @@ ia_css_xnr3_vmem_encode(
 
 	for (j = 1; j < XNR3_LOOK_UP_TABLE_POINTS; j++) {
 		assert(x[j] >= 0);
-		assert(x[j] > x[j-1]);
+		assert(x[j] > x[j - 1]);
 
 	}
 
drivers/staging/media/atomisp/platform/intel-mid/atomisp_gmin_platform.c +3 -3
index add0093..8165154 100644
@@ -56,7 +56,7 @@ static enum { PMIC_UNSET = 0, PMIC_REGULATOR, PMIC_AXP, PMIC_TI ,
 	PMIC_CRYSTALCOVE } pmic_id;
 
 /* The atomisp uses type==0 for the end-of-list marker, so leave space. */
-static struct intel_v4l2_subdev_table pdata_subdevs[MAX_SUBDEVS+1];
+static struct intel_v4l2_subdev_table pdata_subdevs[MAX_SUBDEVS + 1];
 
 static const struct atomisp_platform_data pdata = {
 	.subdevs = pdata_subdevs,
@@ -637,7 +637,7 @@ int gmin_get_config_var(struct device *dev, const char *var, char *out, size_t *
         else
                 ret = snprintf(var8, sizeof(var8), "gmin_%s", var);
 
-	if (ret < 0 || ret >= sizeof(var8)-1)
+	if (ret < 0 || ret >= sizeof(var8) - 1)
 		return -EINVAL;
 
 	/* First check a hard-coded list of board-specific variables.
@@ -654,7 +654,7 @@ int gmin_get_config_var(struct device *dev, const char *var, char *out, size_t *
 
 				if (strcmp(var8, gv->name))
 					continue;
-				if (vl > *out_len-1)
+				if (vl > *out_len - 1)
 					return -ENOSPC;
 
 				memcpy(out, gv->val, min(*out_len, vl+1));
Signature · 1 line
2.9.3
author
#2 lore raw

PATCH 2/4 staging: media: atomisp: Fix block comments warning.

In reply to a message not in the archive

Use kernel preferred block commenting style, to the fix checkpatch issue.

---
 .../css2400/isp/kernels/ctc/ctc2/ia_css_ctc2.host.c   | 19 +++++++++----------
 .../isp/kernels/xnr/xnr_3.0/ia_css_xnr3.host.c        |  9 ++++++---
 2 files changed, 15 insertions(+), 13 deletions(-)
drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/ctc/ctc2/ia_css_ctc2.host.c +9 -10
index 992b31e..c96340d 100644
@@ -21,8 +21,7 @@
 #define INEFFECTIVE_VAL 4096
 #define BASIC_VAL 819
 
-/*Default configuration of parameters for Ctc2
-*/
+/*Default configuration of parameters for Ctc2*/
 const struct ia_css_ctc2_config default_ctc2_config = {
 	INEFFECTIVE_VAL, INEFFECTIVE_VAL, INEFFECTIVE_VAL,
 	INEFFECTIVE_VAL, INEFFECTIVE_VAL, INEFFECTIVE_VAL,
@@ -104,14 +103,14 @@ void ia_css_ctc2_vmem_encode(struct ia_css_isp_ctc2_vmem_params *to,
 			    SH_CSS_BAYER_MAXVAL, from->y_x4);
 
 	/*Fill 3 arrays with:
-	* - Luma input gain values y_y0, y_y1, y_y2, y_3, y_y4
-	* - Luma kneepoints 0, y_x1, y_x2, y_x3, y_x4
-	* - Calculated slopes dydx0, dyxd1, dydx2, dydx3, dydx4
-	*
-	* - Each 64-element array is divided in blocks of 16 elements:
-	*   the 5 parameters + zeros in the remaining 11 positions
-	* - All blocks of the same array will contain the same data
-	*/
+	 * - Luma input gain values y_y0, y_y1, y_y2, y_3, y_y4
+	 * - Luma kneepoints 0, y_x1, y_x2, y_x3, y_x4
+	 * - Calculated slopes dydx0, dyxd1, dydx2, dydx3, dydx4
+	 *
+	 * - Each 64-element array is divided in blocks of 16 elements:
+	 *   the 5 parameters + zeros in the remaining 11 positions
+	 * - All blocks of the same array will contain the same data
+	 */
 	for (i = 0; i < shffl_blck; i++) {
 		to->y_x[0][(i << shffl_blck)]     = 0;
 		to->y_x[0][(i << shffl_blck) + 1] = from->y_x1;
drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/xnr/xnr_3.0/ia_css_xnr3.host.c +6 -3
index fa97224..9355b44 100644
@@ -25,7 +25,8 @@
 #define XNR_MAX_ALPHA  ((1 << (ISP_VEC_ELEMBITS - 1)) - 1)
 
 /* Minimum value for sigma on host interface. Lower values translate to
- * max_alpha. */
+ * max_alpha.
+ */
 #define XNR_MIN_SIGMA  (IA_CSS_XNR3_SIGMA_SCALE / 100)
 
 /*
@@ -118,7 +119,8 @@ compute_coring(int coring)
 	int32_t offset = host_scale / 2; /* fixed-point 0.5 */
 
 	/* Convert from public host-side scale factor to isp-side scale
-	 * factor. Clip to [0, isp_scale-1). */
+	 * factor. Clip to [0, isp_scale-1).
+	 */
 	isp_coring = ((coring * isp_scale) + offset) / host_scale;
 	return min(max(isp_coring, 0), isp_scale - 1);
 }
@@ -138,7 +140,8 @@ compute_blending(int strength)
 	/* Convert from public host-side scale factor to isp-side scale
 	 * factor. The blending factor is positive on the host side, but
 	 * negative on the ISP side because +1.0 cannot be represented
-	 * exactly as s0.11 fixed point, but -1.0 can. */
+	 * exactly as s0.11 fixed point, but -1.0 can.
+	 */
 	isp_strength = -(((strength * isp_scale) + offset) / host_scale);
 	return max(min(isp_strength, 0), -XNR_BLENDING_SCALE_FACTOR);
 }
Signature · 1 line
2.9.3
author
#3 lore raw

PATCH 3/4 staging: media: atomisp: Remove unnecessary blank lines.

In reply to a message not in the archive

Remove multiple blank lines, which are not required. This patch fixes the following check patch issues:

CHECK: Please don't use multiple blank lines

---
 .../pci/atomisp2/css2400/isp/kernels/ctc/ctc2/ia_css_ctc2.host.c     | 2 --
 .../pci/atomisp2/css2400/isp/kernels/xnr/xnr_3.0/ia_css_xnr3.host.c  | 5 -----
 drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_mipi.c     | 2 --
 .../staging/media/atomisp/platform/intel-mid/atomisp_gmin_platform.c | 2 --
 4 files changed, 11 deletions(-)
drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/ctc/ctc2/ia_css_ctc2.host.c +0 -2
index c96340d..5d58dc1 100644
@@ -29,8 +29,6 @@ const struct ia_css_ctc2_config default_ctc2_config = {
 	BASIC_VAL * 8, INEFFECTIVE_VAL, INEFFECTIVE_VAL,
 	BASIC_VAL >> 1, BASIC_VAL};
 
-
-
 /* (dydx) = ctc2_slope(y1, y0, x1, x0)
  * -----------------------------------------------
  * Calculation of the Slope of a Line = ((y1 - y0) >> 8)/(x1 - x0)
drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/xnr/xnr_3.0/ia_css_xnr3.host.c +0 -5
index 9355b44..f61bfab 100644
@@ -51,7 +51,6 @@ static const int16_t b[XNR3_LOOK_UP_TABLE_POINTS] = {
 static const int16_t c[XNR3_LOOK_UP_TABLE_POINTS] = {
 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
 
-
 /*
 #endif
  * Default kernel parameters. In general, default is bypass mode or as close
@@ -224,7 +223,6 @@ ia_css_xnr3_vmem_encode(
 		to->c[0][i] = 0;
 	}
 
-
 	/* Constraints on "x":
 	 * - values should be greater or equal to 0.
 	 * - values should be ascending.
@@ -237,7 +235,6 @@ ia_css_xnr3_vmem_encode(
 
 	}
 
-
 	/* The implementation of the calulating 1/x is based on the availability
 	 * of the OP_vec_shuffle16 operation.
 	 * A 64 element vector is split up in 4 blocks of 16 element. Each array is copied to
@@ -257,8 +254,6 @@ ia_css_xnr3_vmem_encode(
 	}
 }
 
-
-
 #endif
 /* Dummy Function added as the tool expects it*/
 void
drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_mipi.c +0 -2
index fdbb96a..8bc1ca0 100644
@@ -209,7 +209,6 @@ ia_css_mipi_frame_calculate_size(const unsigned int width,
 	*  payload lines.
 	*/
 
-
 	words_per_odd_line = (odd_line_bytes + 3) >> 2;
 		/* ceil(odd_line_bytes/4); word = 4 bytes */
 	words_per_even_line  = (even_line_bytes  + 3) >> 2;
@@ -251,7 +250,6 @@ ia_css_mipi_frame_enable_check_on_size(const enum ia_css_csi2_port port,
 	OP___assert(port < N_CSI_PORTS);
 	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 */
drivers/staging/media/atomisp/platform/intel-mid/atomisp_gmin_platform.c +0 -2
index 8165154..5b4506a 100644
@@ -29,7 +29,6 @@
 #define ELDO2_1P8V	0x16
 #define ELDO2_CTRL_SHIFT 0x01
 
-
 struct gmin_subdev {
 	struct v4l2_subdev *subdev;
 	int clock_num;
@@ -489,7 +488,6 @@ int gmin_v1p8_ctrl(struct v4l2_subdev *subdev, int on)
 			return regulator_disable(gs->v1p8_reg);
 	}
 
-
 	return -EINVAL;
 }
 
Signature · 1 line
2.9.3
author
#4 lore raw

PATCH 4/4 staging: media: atomisp: Remove unnecessary braces.

In reply to a message not in the archive

Remove braces which are not required to fix the check patch issue. The following coccinelle script is used to fix this issue.

@@
expression e,e1;
@@
if(e)
-{
e1;
-}

---
 .../pci/atomisp2/css2400/isp/kernels/ctc/ctc2/ia_css_ctc2.host.c       | 3 +--
 .../pci/atomisp2/css2400/isp/kernels/xnr/xnr_3.0/ia_css_xnr3.host.c    | 3 +--
 drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_mipi.c       | 3 +--
 3 files changed, 3 insertions(+), 6 deletions(-)
drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/ctc/ctc2/ia_css_ctc2.host.c +1 -2
index 5d58dc1..07bd24e 100644
@@ -52,9 +52,8 @@ static int ctc2_slope(int y1, int y0, int x1, int x0)
 	assert(x1 > 0 && x1 <= max_slope);
 	assert(dx > 0);
 
-	if (dy < 0) {
+	if (dy < 0)
 		rounding = -rounding;
-	}
 	slope = (int) (dy_shift + rounding) / dx;
 
 	/*the slope must lie within the range
drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/xnr/xnr_3.0/ia_css_xnr3.host.c +1 -2
index f61bfab..955b6c8 100644
@@ -97,9 +97,8 @@ compute_alpha(int sigma)
 		alpha = ((IA_CSS_XNR3_SIGMA_SCALE * XNR_ALPHA_SCALE_FACTOR) + offset)/ sigma;
 #endif
 
-		if (alpha > XNR_MAX_ALPHA) {
+		if (alpha > XNR_MAX_ALPHA)
 			alpha = XNR_MAX_ALPHA;
-		}
 	}
 
 	return alpha;
drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_mipi.c +1 -2
index 8bc1ca0..7e3893c 100644
@@ -79,9 +79,8 @@ static bool ia_css_mipi_is_source_port_valid(struct ia_css_pipe *pipe,
 	if (ret) {
 		assert(port < max_ports);
 
-		if (port >= max_ports) {
+		if (port >= max_ports)
 			ret = false;
-		}
 	}
 
 	*pport = port;
Signature · 1 line
2.9.3