Skip to contentSkip to conversation

staging: media: zoran: Eliminate camelcase

PATCH In review Zhansaya Bagdauletkyzy 3 participants 10 messages Apr 3, 2021 – Apr 7, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover staging: media: zoran: Eliminate camelcase

This patchset fixes 'avoid camelcase' warning by converting local variables to lowercase and separating words using '_'. Renaming of each variable is implemented in separate patches.

Zhansaya Bagdauletkyzy (7):
Rename 'HEnd' to 'h_end'
Rename 'VEnd' to 'v_end'
Rename 'DispMode' to 'disp_mode'
Rename 'VidWinWid' to 'vid_win_wid'
Rename 'VidWinHt' to 'vid_win_ht'
Rename 'We' to 'we'
Rename 'He' to 'he'

 drivers/staging/media/zoran/zoran_device.c | 48 +++++++++++-----------
 1 file changed, 24 insertions(+), 24 deletions(-)
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/7 staging: media: zoran: Rename 'HEnd' to 'h_end'

Rename variable 'HEnd' to 'h_end' to eliminate camelcase Reported by checkpatch.pl.

---
 drivers/staging/media/zoran/zoran_device.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/media/zoran/zoran_device.c +4 -4
index e569a1341d01..415b3cf4826e 100644
@@ -291,7 +291,7 @@ static void zr36057_set_vfe(struct zoran *zr, int video_width, int video_height,
 			    const struct zoran_format *format)
 {
 	const struct tvnorm *tvn;
-	unsigned int h_start, HEnd, v_start, VEnd;
+	unsigned int h_start, h_end, v_start, VEnd;
 	unsigned int DispMode;
 	unsigned int VidWinWid, VidWinHt;
 	unsigned int hcrop1, hcrop2, vcrop1, vcrop2;
@@ -331,11 +331,11 @@ static void zr36057_set_vfe(struct zoran *zr, int video_width, int video_height,
 	 * However, the DC10 has '0' as h_start, but does need |1, so we
 	 * use a dirty check...
 	 */
-	HEnd = h_start + tvn->wa - 1;
+	h_end = h_start + tvn->wa - 1;
 	h_start += hcrop1;
-	HEnd -= hcrop2;
+	h_end -= hcrop2;
 	reg = ((h_start & ZR36057_VFEHCR_HMASK) << ZR36057_VFEHCR_H_START)
-	    | ((HEnd & ZR36057_VFEHCR_HMASK) << ZR36057_VFEHCR_H_END);
+	    | ((h_end & ZR36057_VFEHCR_HMASK) << ZR36057_VFEHCR_H_END);
 	if (zr->card.vfe_pol.hsync_pol)
 		reg |= ZR36057_VFEHCR_HS_POL;
 	btwrite(reg, ZR36057_VFEHCR);
Signature · 1 line
2.25.1
#2 lore raw

PATCH 2/7 staging: media: zoran: Rename 'VEnd' to 'v_end'

In reply to Zhansaya Bagdauletkyzy

Rename variable 'VEnd' to 'v_end' to eliminate camelcase. Reported by checkpatch.pl.

---
 drivers/staging/media/zoran/zoran_device.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/media/zoran/zoran_device.c +4 -4
index 415b3cf4826e..6764b51fc595 100644
@@ -291,7 +291,7 @@ static void zr36057_set_vfe(struct zoran *zr, int video_width, int video_height,
 			    const struct zoran_format *format)
 {
 	const struct tvnorm *tvn;
-	unsigned int h_start, h_end, v_start, VEnd;
+	unsigned int h_start, h_end, v_start, v_end;
 	unsigned int DispMode;
 	unsigned int VidWinWid, VidWinHt;
 	unsigned int hcrop1, hcrop2, vcrop1, vcrop2;
@@ -349,11 +349,11 @@ static void zr36057_set_vfe(struct zoran *zr, int video_width, int video_height,
 	vcrop1 = (tvn->ha / 2 - He) / 2;
 	vcrop2 = tvn->ha / 2 - He - vcrop1;
 	v_start = tvn->v_start;
-	VEnd = v_start + tvn->ha / 2;	// - 1; FIXME SnapShot times out with -1 in 768*576 on the DC10 - LP
+	v_end = v_start + tvn->ha / 2;	// - 1; FIXME SnapShot times out with -1 in 768*576 on the DC10 - LP
 	v_start += vcrop1;
-	VEnd -= vcrop2;
+	v_end -= vcrop2;
 	reg = ((v_start & ZR36057_VFEVCR_VMASK) << ZR36057_VFEVCR_V_START)
-	    | ((VEnd & ZR36057_VFEVCR_VMASK) << ZR36057_VFEVCR_V_END);
+	    | ((v_end & ZR36057_VFEVCR_VMASK) << ZR36057_VFEVCR_V_END);
 	if (zr->card.vfe_pol.vsync_pol)
 		reg |= ZR36057_VFEVCR_VS_POL;
 	btwrite(reg, ZR36057_VFEVCR);
Signature · 1 line
2.25.1
#3 lore raw

PATCH 3/7 staging: media: zoran: Rename 'DispMode' to 'disp_mode'

In reply to Zhansaya Bagdauletkyzy

Rename variable 'DispMode' to 'disp_mode' to eliminate camelcase. Reported by checkpatch.pl.

---
 drivers/staging/media/zoran/zoran_device.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/media/zoran/zoran_device.c +4 -4
index 6764b51fc595..8891f11f6276 100644
@@ -292,7 +292,7 @@ static void zr36057_set_vfe(struct zoran *zr, int video_width, int video_height,
 {
 	const struct tvnorm *tvn;
 	unsigned int h_start, h_end, v_start, v_end;
-	unsigned int DispMode;
+	unsigned int disp_mode;
 	unsigned int VidWinWid, VidWinHt;
 	unsigned int hcrop1, hcrop2, vcrop1, vcrop2;
 	unsigned int wa, We, ha, He;
@@ -341,8 +341,8 @@ static void zr36057_set_vfe(struct zoran *zr, int video_width, int video_height,
 	btwrite(reg, ZR36057_VFEHCR);
 
 	/* Vertical */
-	DispMode = !(video_height > BUZ_MAX_HEIGHT / 2);
-	VidWinHt = DispMode ? video_height : video_height / 2;
+	disp_mode = !(video_height > BUZ_MAX_HEIGHT / 2);
+	VidWinHt = disp_mode ? video_height : video_height / 2;
 	Y = DIV_ROUND_UP(VidWinHt * 64 * 2, tvn->ha);
 	He = (VidWinHt * 64) / Y;
 	ver_dcm = 64 - Y;
@@ -362,7 +362,7 @@ static void zr36057_set_vfe(struct zoran *zr, int video_width, int video_height,
 	reg = 0;
 	reg |= (hor_dcm << ZR36057_VFESPFR_HOR_DCM);
 	reg |= (ver_dcm << ZR36057_VFESPFR_VER_DCM);
-	reg |= (DispMode << ZR36057_VFESPFR_DISP_MODE);
+	reg |= (disp_mode << ZR36057_VFESPFR_DISP_MODE);
 	/* RJ: I don't know, why the following has to be the opposite
 	 * of the corresponding ZR36060 setting, but only this way
 	 * we get the correct colors when uncompressing to the screen  */
Signature · 1 line
2.25.1
#4 lore raw

PATCH 4/7 staging: media: zoran: Rename 'VidWinWid' to 'vid_win_wid'

In reply to Zhansaya Bagdauletkyzy

Rename variable 'VidWinWid' to 'vid_win_wid' to eliminate camelcase. Reported by checkpatch.pl.

---
 drivers/staging/media/zoran/zoran_device.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/staging/media/zoran/zoran_device.c +5 -5
index 8891f11f6276..f0344f4a4727 100644
@@ -293,7 +293,7 @@ static void zr36057_set_vfe(struct zoran *zr, int video_width, int video_height,
 	const struct tvnorm *tvn;
 	unsigned int h_start, h_end, v_start, v_end;
 	unsigned int disp_mode;
-	unsigned int VidWinWid, VidWinHt;
+	unsigned int vid_win_wid, VidWinHt;
 	unsigned int hcrop1, hcrop2, vcrop1, vcrop2;
 	unsigned int wa, We, ha, He;
 	unsigned int X, Y, hor_dcm, ver_dcm;
@@ -316,9 +316,9 @@ static void zr36057_set_vfe(struct zoran *zr, int video_width, int video_height,
 	/**** zr36057 ****/
 
 	/* horizontal */
-	VidWinWid = video_width;
-	X = DIV_ROUND_UP(VidWinWid * 64, tvn->wa);
-	We = (VidWinWid * 64) / X;
+	vid_win_wid = video_width;
+	X = DIV_ROUND_UP(vid_win_wid * 64, tvn->wa);
+	We = (vid_win_wid * 64) / X;
 	hor_dcm = 64 - X;
 	hcrop1 = 2 * ((tvn->wa - We) / 4);
 	hcrop2 = tvn->wa - We - hcrop1;
@@ -384,7 +384,7 @@ static void zr36057_set_vfe(struct zoran *zr, int video_width, int video_height,
 	/* display configuration */
 	reg = (16 << ZR36057_VDCR_MIN_PIX)
 	    | (VidWinHt << ZR36057_VDCR_VID_WIN_HT)
-	    | (VidWinWid << ZR36057_VDCR_VID_WIN_WID);
+	    | (vid_win_wid << ZR36057_VDCR_VID_WIN_WID);
 	if (pci_pci_problems & PCIPCI_TRITON)
 		// || zr->revision < 1) // Revision 1 has also Triton support
 		reg &= ~ZR36057_VDCR_TRITON;
Signature · 1 line
2.25.1
#5 lore raw

PATCH 5/7 staging: media: zoran: Rename 'VidWinHt' to 'vid_win_ht'

In reply to Zhansaya Bagdauletkyzy

Rename 'VidWinHt' to 'vid_win_ht' to eliminate camelcase. Reported by checkpatch.pl.

---
 drivers/staging/media/zoran/zoran_device.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/staging/media/zoran/zoran_device.c +5 -5
index f0344f4a4727..49e0efcc0062 100644
@@ -293,7 +293,7 @@ static void zr36057_set_vfe(struct zoran *zr, int video_width, int video_height,
 	const struct tvnorm *tvn;
 	unsigned int h_start, h_end, v_start, v_end;
 	unsigned int disp_mode;
-	unsigned int vid_win_wid, VidWinHt;
+	unsigned int vid_win_wid, vid_win_ht;
 	unsigned int hcrop1, hcrop2, vcrop1, vcrop2;
 	unsigned int wa, We, ha, He;
 	unsigned int X, Y, hor_dcm, ver_dcm;
@@ -342,9 +342,9 @@ static void zr36057_set_vfe(struct zoran *zr, int video_width, int video_height,
 
 	/* Vertical */
 	disp_mode = !(video_height > BUZ_MAX_HEIGHT / 2);
-	VidWinHt = disp_mode ? video_height : video_height / 2;
-	Y = DIV_ROUND_UP(VidWinHt * 64 * 2, tvn->ha);
-	He = (VidWinHt * 64) / Y;
+	vid_win_ht = disp_mode ? video_height : video_height / 2;
+	Y = DIV_ROUND_UP(vid_win_ht * 64 * 2, tvn->ha);
+	He = (vid_win_ht * 64) / Y;
 	ver_dcm = 64 - Y;
 	vcrop1 = (tvn->ha / 2 - He) / 2;
 	vcrop2 = tvn->ha / 2 - He - vcrop1;
@@ -383,7 +383,7 @@ static void zr36057_set_vfe(struct zoran *zr, int video_width, int video_height,
 
 	/* display configuration */
 	reg = (16 << ZR36057_VDCR_MIN_PIX)
-	    | (VidWinHt << ZR36057_VDCR_VID_WIN_HT)
+	    | (vid_win_ht << ZR36057_VDCR_VID_WIN_HT)
 	    | (vid_win_wid << ZR36057_VDCR_VID_WIN_WID);
 	if (pci_pci_problems & PCIPCI_TRITON)
 		// || zr->revision < 1) // Revision 1 has also Triton support
Signature · 1 line
2.25.1
#6 lore raw

PATCH 6/7 staging: media: zoran: Rename 'We' to 'we'

In reply to Zhansaya Bagdauletkyzy

Rename variable 'We' to 'we' to eliminate camelcase. Reported by checkpatch.pl.

---
 drivers/staging/media/zoran/zoran_device.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/media/zoran/zoran_device.c +4 -4
index 49e0efcc0062..007d8855178e 100644
@@ -295,7 +295,7 @@ static void zr36057_set_vfe(struct zoran *zr, int video_width, int video_height,
 	unsigned int disp_mode;
 	unsigned int vid_win_wid, vid_win_ht;
 	unsigned int hcrop1, hcrop2, vcrop1, vcrop2;
-	unsigned int wa, We, ha, He;
+	unsigned int wa, we, ha, He;
 	unsigned int X, Y, hor_dcm, ver_dcm;
 	u32 reg;
 
@@ -318,10 +318,10 @@ static void zr36057_set_vfe(struct zoran *zr, int video_width, int video_height,
 	/* horizontal */
 	vid_win_wid = video_width;
 	X = DIV_ROUND_UP(vid_win_wid * 64, tvn->wa);
-	We = (vid_win_wid * 64) / X;
+	we = (vid_win_wid * 64) / X;
 	hor_dcm = 64 - X;
-	hcrop1 = 2 * ((tvn->wa - We) / 4);
-	hcrop2 = tvn->wa - We - hcrop1;
+	hcrop1 = 2 * ((tvn->wa - we) / 4);
+	hcrop2 = tvn->wa - we - hcrop1;
 	h_start = tvn->h_start ? tvn->h_start : 1;
 	/* (Ronald) Original comment:
 	 * "| 1 Doesn't have any effect, tested on both a DC10 and a DC10+"
Signature · 1 line
2.25.1
#7 lore raw

PATCH 7/7 staging: media: zoran: Rename 'He' to 'he'

In reply to Zhansaya Bagdauletkyzy

Rename variable 'He' to 'he' to eliminate camelcase. Reported by checkpatch.pl.

---
 drivers/staging/media/zoran/zoran_device.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/media/zoran/zoran_device.c +4 -4
index 007d8855178e..cf788d9cd1df 100644
@@ -295,7 +295,7 @@ static void zr36057_set_vfe(struct zoran *zr, int video_width, int video_height,
 	unsigned int disp_mode;
 	unsigned int vid_win_wid, vid_win_ht;
 	unsigned int hcrop1, hcrop2, vcrop1, vcrop2;
-	unsigned int wa, we, ha, He;
+	unsigned int wa, we, ha, he;
 	unsigned int X, Y, hor_dcm, ver_dcm;
 	u32 reg;
 
@@ -344,10 +344,10 @@ static void zr36057_set_vfe(struct zoran *zr, int video_width, int video_height,
 	disp_mode = !(video_height > BUZ_MAX_HEIGHT / 2);
 	vid_win_ht = disp_mode ? video_height : video_height / 2;
 	Y = DIV_ROUND_UP(vid_win_ht * 64 * 2, tvn->ha);
-	He = (vid_win_ht * 64) / Y;
+	he = (vid_win_ht * 64) / Y;
 	ver_dcm = 64 - Y;
-	vcrop1 = (tvn->ha / 2 - He) / 2;
-	vcrop2 = tvn->ha / 2 - He - vcrop1;
+	vcrop1 = (tvn->ha / 2 - he) / 2;
+	vcrop2 = tvn->ha / 2 - he - vcrop1;
 	v_start = tvn->v_start;
 	v_end = v_start + tvn->ha / 2;	// - 1; FIXME SnapShot times out with -1 in 768*576 on the DC10 - LP
 	v_start += vcrop1;
Signature · 1 line
2.25.1
maintainer
#8 lore raw
In reply to Zhansaya Bagdauletkyzy
Quoted 12 lines · Zhansaya Bagdauletkyzy

This patchset fixes 'avoid camelcase' warning by converting local variables to lowercase and separating words using '_'. Renaming of each variable is implemented in separate patches.

Zhansaya Bagdauletkyzy (7):
Rename 'HEnd' to 'h_end'
Rename 'VEnd' to 'v_end'
Rename 'DispMode' to 'disp_mode'
Rename 'VidWinWid' to 'vid_win_wid'
Rename 'VidWinHt' to 'vid_win_ht'
Rename 'We' to 'we'
Rename 'He' to 'he'

Quoted 2 lines
 drivers/staging/media/zoran/zoran_device.c | 48 +++++++++++-----------
 1 file changed, 24 insertions(+), 24 deletions(-)

You did not read the instructions for the outreachy work, sorry, but I can not take these.

good luck!

greg k-h

#9 lore raw
In reply to Zhansaya Bagdauletkyzy

Hi Zhansaya,

Quoted 12 lines · Zhansaya Bagdauletkyzy

This patchset fixes 'avoid camelcase' warning by converting local variables to lowercase and separating words using '_'. Renaming of each variable is implemented in separate patches.

Zhansaya Bagdauletkyzy (7):
Rename 'HEnd' to 'h_end'
Rename 'VEnd' to 'v_end'
Rename 'DispMode' to 'disp_mode'
Rename 'VidWinWid' to 'vid_win_wid'
Rename 'VidWinHt' to 'vid_win_ht'
Rename 'We' to 'we'
Rename 'He' to 'he'

Quoted 3 lines
 drivers/staging/media/zoran/zoran_device.c | 48 +++++++++++-----------
 1 file changed, 24 insertions(+), 24 deletions(-)

Looks good. I'll take these patches.

You can use this reference to record your contributions:

https://patchwork.linuxtv.org/project/linux-media/list/?series=5052

The patch states will change to Accepted once it is merged in our media tree
here: https://git.linuxtv.org/media_tree.git/log/

I hate CamelCase, so this is a nice cleanup :-)

Regards,

Hans