Skip to contentSkip to conversation

media: zoran: clean up style issues

PATCH In review Mitali Borkar 3 participants 16 messages Apr 8, 2021 – Apr 9, 2021

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

cover media: zoran: clean up style issues

These patches make changes to clean up style issues as identified by checkpatch

Mitali Borkar (2):
media: zoran: add spaces around '<<'
media: zoran: replace bit shifts by BIT() macro

 drivers/staging/media/zoran/zr36057.h | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
Signature · 1 line
2.30.2
#1 lore raw

PATCH 1/2 media: zoran: add spaces around '<<'

Added spaces around '<<' operator to improve readability and meet linux kernel coding style.
Reported by checkpatch

---
 drivers/staging/media/zoran/zr36057.h | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/staging/media/zoran/zr36057.h +7 -7
index 71b651add35a..a2a75fd9f535 100644
@@ -30,13 +30,13 @@
 #define ZR36057_VFESPFR_HOR_DCM          14
 #define ZR36057_VFESPFR_VER_DCM          8
 #define ZR36057_VFESPFR_DISP_MODE        6
-#define ZR36057_VFESPFR_YUV422          (0<<3)
-#define ZR36057_VFESPFR_RGB888          (1<<3)
-#define ZR36057_VFESPFR_RGB565          (2<<3)
-#define ZR36057_VFESPFR_RGB555          (3<<3)
-#define ZR36057_VFESPFR_ERR_DIF          (1<<2)
-#define ZR36057_VFESPFR_PACK24          (1<<1)
-#define ZR36057_VFESPFR_LITTLE_ENDIAN    (1<<0)
+#define ZR36057_VFESPFR_YUV422          (0 << 3)
+#define ZR36057_VFESPFR_RGB888          (1 << 3)
+#define ZR36057_VFESPFR_RGB565          (2 << 3)
+#define ZR36057_VFESPFR_RGB555          (3 << 3)
+#define ZR36057_VFESPFR_ERR_DIF          (1 << 2)
+#define ZR36057_VFESPFR_PACK24          (1 << 1)
+#define ZR36057_VFESPFR_LITTLE_ENDIAN    (1 << 0)
 
 #define ZR36057_VDTR            0x00c	/* Video Display "Top" Register */
 
Signature · 1 line
2.30.2
#2 lore raw

Re: [Outreachy kernel] [PATCH 1/2] media: zoran: add spaces around '<<'

Quoted 21 lines · Mitali Borkar

Added spaces around '<<' operator to improve readability and meet linux kernel coding style.
Reported by checkpatch

---
 drivers/staging/media/zoran/zr36057.h | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/staging/media/zoran/zr36057.h +0 -4
index 71b651add35a..a2a75fd9f535 100644
@@ -30,13 +30,13 @@
 #define ZR36057_VFESPFR_HOR_DCM          14
 #define ZR36057_VFESPFR_VER_DCM          8
 #define ZR36057_VFESPFR_DISP_MODE        6
-#define ZR36057_VFESPFR_YUV422          (0<<3)
-#define ZR36057_VFESPFR_RGB888          (1<<3)
-#define ZR36057_VFESPFR_RGB565          (2<<3)
-#define ZR36057_VFESPFR_RGB555          (3<<3)

drivers/staging/media/zoran/zr36057.h line 39

Quoted 10 lines
drivers/staging/media/zoran/zr36057.h +7 -3
-#define ZR36057_VFESPFR_ERR_DIF          (1<<2)
-#define ZR36057_VFESPFR_PACK24          (1<<1)
-#define ZR36057_VFESPFR_LITTLE_ENDIAN    (1<<0)
+#define ZR36057_VFESPFR_YUV422          (0 << 3)
+#define ZR36057_VFESPFR_RGB888          (1 << 3)
+#define ZR36057_VFESPFR_RGB565          (2 << 3)
+#define ZR36057_VFESPFR_RGB555          (3 << 3)
+#define ZR36057_VFESPFR_ERR_DIF          (1 << 2)
+#define ZR36057_VFESPFR_PACK24          (1 << 1)
+#define ZR36057_VFESPFR_LITTLE_ENDIAN    (1 << 0)

Are these all aligned in the actual file?

julia

Quoted 10 lines
drivers/staging/media/zoran/zr36057.h +0 -1
 #define ZR36057_VDTR            0x00c	/* Video Display "Top" Register */
 
--

2.30.2

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/8e8ac690d97478f7cbb9b91d46ef7a95e4444e5f.1617912177.git.mitaliborkar810%40gmail.com.

#3 lore raw

Re: [Outreachy kernel] [PATCH 1/2] media: zoran: add spaces around '<<'

Quoted 29 lines · Julia Lawall
Quoted 25 lines · Mitali Borkar

Added spaces around '<<' operator to improve readability and meet linux kernel coding style.
Reported by checkpatch

---
 drivers/staging/media/zoran/zr36057.h | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/staging/media/zoran/zr36057.h +1 -7
index 71b651add35a..a2a75fd9f535 100644
@@ -30,13 +30,13 @@
 #define ZR36057_VFESPFR_HOR_DCM          14
 #define ZR36057_VFESPFR_VER_DCM          8
 #define ZR36057_VFESPFR_DISP_MODE        6
-#define ZR36057_VFESPFR_YUV422          (0<<3)
-#define ZR36057_VFESPFR_RGB888          (1<<3)
-#define ZR36057_VFESPFR_RGB565          (2<<3)
-#define ZR36057_VFESPFR_RGB555          (3<<3)
-#define ZR36057_VFESPFR_ERR_DIF          (1<<2)
-#define ZR36057_VFESPFR_PACK24          (1<<1)
-#define ZR36057_VFESPFR_LITTLE_ENDIAN    (1<<0)
+#define ZR36057_VFESPFR_YUV422          (0 << 3)
Quoted 9 lines

drivers/staging/media/zoran/zr36057.h line 39

Quoted 6 lines
drivers/staging/media/zoran/zr36057.h +6 -0
+#define ZR36057_VFESPFR_RGB888          (1 << 3)
+#define ZR36057_VFESPFR_RGB565          (2 << 3)
+#define ZR36057_VFESPFR_RGB555          (3 << 3)
+#define ZR36057_VFESPFR_ERR_DIF          (1 << 2)
+#define ZR36057_VFESPFR_PACK24          (1 << 1)
+#define ZR36057_VFESPFR_LITTLE_ENDIAN    (1 << 0)

Are these all aligned in the actual file?

No Ma'am, they were not aligned in the actual file.

Quoted 12 lines

julia

Quoted 10 lines
drivers/staging/media/zoran/zr36057.h +0 -1
 #define ZR36057_VDTR            0x00c	/* Video Display "Top" Register */
 
--

2.30.2

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/8e8ac690d97478f7cbb9b91d46ef7a95e4444e5f.1617912177.git.mitaliborkar810%40gmail.com.

#4 lore raw

Re: [PATCH 1/2] media: zoran: add spaces around '<<'

In reply to Mitali Borkar

Hi Mitali,

Quoted 25 lines · Mitali Borkar

Added spaces around '<<' operator to improve readability and meet linux kernel coding style.
Reported by checkpatch

---
 drivers/staging/media/zoran/zr36057.h | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/staging/media/zoran/zr36057.h +0 -7
index 71b651add35a..a2a75fd9f535 100644
@@ -30,13 +30,13 @@
 #define ZR36057_VFESPFR_HOR_DCM          14
 #define ZR36057_VFESPFR_VER_DCM          8
 #define ZR36057_VFESPFR_DISP_MODE        6
-#define ZR36057_VFESPFR_YUV422          (0<<3)
-#define ZR36057_VFESPFR_RGB888          (1<<3)
-#define ZR36057_VFESPFR_RGB565          (2<<3)
-#define ZR36057_VFESPFR_RGB555          (3<<3)
-#define ZR36057_VFESPFR_ERR_DIF          (1<<2)
-#define ZR36057_VFESPFR_PACK24          (1<<1)
-#define ZR36057_VFESPFR_LITTLE_ENDIAN    (1<<0)

drivers/staging/media/zoran/zr36057.h line 42

Quoted 10 lines
drivers/staging/media/zoran/zr36057.h +7 -0
+#define ZR36057_VFESPFR_YUV422          (0 << 3)
+#define ZR36057_VFESPFR_RGB888          (1 << 3)
+#define ZR36057_VFESPFR_RGB565          (2 << 3)
+#define ZR36057_VFESPFR_RGB555          (3 << 3)
+#define ZR36057_VFESPFR_ERR_DIF          (1 << 2)
+#define ZR36057_VFESPFR_PACK24          (1 << 1)
+#define ZR36057_VFESPFR_LITTLE_ENDIAN    (1 << 0)
 
 #define ZR36057_VDTR            0x00c	/* Video Display "Top" Register */
 

I looked at that header and it is very messy.

Can you make two new patches? The first aligns every nicely, e.g. this:

#define ZR36057_VFEHCR 0x000 /* Video Front End, Horizontal Configuration Register */
#define ZR36057_VFEHCR_HS_POL BIT(30)
#define ZR36057_VFEHCR_H_START 10
#define ZR36057_VFEHCR_H_END 0
#define ZR36057_VFEHCR_HMASK 0x3ff

should become:

/* Video Front End, Horizontal Configuration Register */
#define ZR36057_VFEHCR 0x000
#define ZR36057_VFEHCR_HS_POL BIT(30)
#define ZR36057_VFEHCR_H_START 10
#define ZR36057_VFEHCR_H_END 0
#define ZR36057_VFEHCR_HMASK 0x3ff

Same for all the other register blocks. Use tabs to do the alignment instead of spaces, as is currently the case.

The second patch can replace the (0<<3) etc. to BIT(0).

That would be a nice cleanup of this rather messy header.

Thanks!

Hans

#5 lore raw

Re: [PATCH 1/2] media: zoran: add spaces around '<<'

Quoted 58 lines · Hans Verkuil

Hi Mitali,

Quoted 25 lines · Mitali Borkar

Added spaces around '<<' operator to improve readability and meet linux kernel coding style.
Reported by checkpatch

---
 drivers/staging/media/zoran/zr36057.h | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/staging/media/zoran/zr36057.h +0 -7
index 71b651add35a..a2a75fd9f535 100644
@@ -30,13 +30,13 @@
 #define ZR36057_VFESPFR_HOR_DCM          14
 #define ZR36057_VFESPFR_VER_DCM          8
 #define ZR36057_VFESPFR_DISP_MODE        6
-#define ZR36057_VFESPFR_YUV422          (0<<3)
-#define ZR36057_VFESPFR_RGB888          (1<<3)
-#define ZR36057_VFESPFR_RGB565          (2<<3)
-#define ZR36057_VFESPFR_RGB555          (3<<3)
-#define ZR36057_VFESPFR_ERR_DIF          (1<<2)
-#define ZR36057_VFESPFR_PACK24          (1<<1)
-#define ZR36057_VFESPFR_LITTLE_ENDIAN    (1<<0)

drivers/staging/media/zoran/zr36057.h line 42

Quoted 10 lines
drivers/staging/media/zoran/zr36057.h +7 -0
+#define ZR36057_VFESPFR_YUV422          (0 << 3)
+#define ZR36057_VFESPFR_RGB888          (1 << 3)
+#define ZR36057_VFESPFR_RGB565          (2 << 3)
+#define ZR36057_VFESPFR_RGB555          (3 << 3)
+#define ZR36057_VFESPFR_ERR_DIF          (1 << 2)
+#define ZR36057_VFESPFR_PACK24          (1 << 1)
+#define ZR36057_VFESPFR_LITTLE_ENDIAN    (1 << 0)
 
 #define ZR36057_VDTR            0x00c	/* Video Display "Top" Register */
 

I looked at that header and it is very messy.

Can you make two new patches? The first aligns every nicely, e.g. this:

#define ZR36057_VFEHCR 0x000 /* Video Front End, Horizontal Configuration Register */
#define ZR36057_VFEHCR_HS_POL BIT(30)
#define ZR36057_VFEHCR_H_START 10
#define ZR36057_VFEHCR_H_END 0
#define ZR36057_VFEHCR_HMASK 0x3ff

should become:

/* Video Front End, Horizontal Configuration Register */
#define ZR36057_VFEHCR 0x000
#define ZR36057_VFEHCR_HS_POL BIT(30)
#define ZR36057_VFEHCR_H_START 10
#define ZR36057_VFEHCR_H_END 0
#define ZR36057_VFEHCR_HMASK 0x3ff

Quoted 3 lines

Same for all the other register blocks. Use tabs to do the alignment instead of spaces, as is currently the case.

Okay Sir, will do this.

Quoted 2 lines

The second patch can replace the (0<<3) etc. to BIT(0).

Sir may I know how to write (2<<3) in BIT() form? Like I am still learning and not sure how to convert this. Should it be BIT(2)? But this is only possible for (1<<nr), PLease help me out.

Thanks.

Quoted 5 lines

That would be a nice cleanup of this rather messy header.

Thanks!

Hans

#6 lore raw

Re: [Outreachy kernel] Re: [PATCH 1/2] media: zoran: add spaces around '<<'

Quoted 62 lines · Mitali Borkar
Quoted 58 lines · Hans Verkuil

Hi Mitali,

Quoted 25 lines · Mitali Borkar

Added spaces around '<<' operator to improve readability and meet linux kernel coding style.
Reported by checkpatch

---
 drivers/staging/media/zoran/zr36057.h | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/staging/media/zoran/zr36057.h +0 -7
index 71b651add35a..a2a75fd9f535 100644
@@ -30,13 +30,13 @@
 #define ZR36057_VFESPFR_HOR_DCM          14
 #define ZR36057_VFESPFR_VER_DCM          8
 #define ZR36057_VFESPFR_DISP_MODE        6
-#define ZR36057_VFESPFR_YUV422          (0<<3)
-#define ZR36057_VFESPFR_RGB888          (1<<3)
-#define ZR36057_VFESPFR_RGB565          (2<<3)
-#define ZR36057_VFESPFR_RGB555          (3<<3)
-#define ZR36057_VFESPFR_ERR_DIF          (1<<2)
-#define ZR36057_VFESPFR_PACK24          (1<<1)
-#define ZR36057_VFESPFR_LITTLE_ENDIAN    (1<<0)

drivers/staging/media/zoran/zr36057.h line 42

Quoted 10 lines
drivers/staging/media/zoran/zr36057.h +7 -0
+#define ZR36057_VFESPFR_YUV422          (0 << 3)
+#define ZR36057_VFESPFR_RGB888          (1 << 3)
+#define ZR36057_VFESPFR_RGB565          (2 << 3)
+#define ZR36057_VFESPFR_RGB555          (3 << 3)
+#define ZR36057_VFESPFR_ERR_DIF          (1 << 2)
+#define ZR36057_VFESPFR_PACK24          (1 << 1)
+#define ZR36057_VFESPFR_LITTLE_ENDIAN    (1 << 0)
 
 #define ZR36057_VDTR            0x00c	/* Video Display "Top" Register */
 

I looked at that header and it is very messy.

Can you make two new patches? The first aligns every nicely, e.g. this:

#define ZR36057_VFEHCR 0x000 /* Video Front End, Horizontal Configuration Register */
#define ZR36057_VFEHCR_HS_POL BIT(30)
#define ZR36057_VFEHCR_H_START 10
#define ZR36057_VFEHCR_H_END 0
#define ZR36057_VFEHCR_HMASK 0x3ff

should become:

/* Video Front End, Horizontal Configuration Register */
#define ZR36057_VFEHCR 0x000
#define ZR36057_VFEHCR_HS_POL BIT(30)
#define ZR36057_VFEHCR_H_START 10
#define ZR36057_VFEHCR_H_END 0
#define ZR36057_VFEHCR_HMASK 0x3ff

Quoted 3 lines

Same for all the other register blocks. Use tabs to do the alignment instead of spaces, as is currently the case.

Quoted 7 lines

Okay Sir, will do this.

Quoted 2 lines

The second patch can replace the (0<<3) etc. to BIT(0).

Sir may I know how to write (2<<3) in BIT() form? Like I am still learning and not sure how to convert this. Should it be BIT(2)? But this is only possible for (1<<nr), PLease help me out.

I think that you are correct. BIT is not usable her.

julia

Quoted 14 lines

Thanks.

Quoted 5 lines

That would be a nice cleanup of this rather messy header.

Thanks!

Hans

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/YHBukmdxSiRc%2BK6I%40kali.

#7 lore raw

Re: [PATCH 1/2] media: zoran: add spaces around '<<'

In reply to Mitali Borkar
Quoted 62 lines · Mitali Borkar
Quoted 58 lines · Hans Verkuil

Hi Mitali,

Quoted 25 lines · Mitali Borkar

Added spaces around '<<' operator to improve readability and meet linux kernel coding style.
Reported by checkpatch

---
 drivers/staging/media/zoran/zr36057.h | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/staging/media/zoran/zr36057.h +0 -7
index 71b651add35a..a2a75fd9f535 100644
@@ -30,13 +30,13 @@
 #define ZR36057_VFESPFR_HOR_DCM          14
 #define ZR36057_VFESPFR_VER_DCM          8
 #define ZR36057_VFESPFR_DISP_MODE        6
-#define ZR36057_VFESPFR_YUV422          (0<<3)
-#define ZR36057_VFESPFR_RGB888          (1<<3)
-#define ZR36057_VFESPFR_RGB565          (2<<3)
-#define ZR36057_VFESPFR_RGB555          (3<<3)
-#define ZR36057_VFESPFR_ERR_DIF          (1<<2)
-#define ZR36057_VFESPFR_PACK24          (1<<1)
-#define ZR36057_VFESPFR_LITTLE_ENDIAN    (1<<0)

drivers/staging/media/zoran/zr36057.h line 42

Quoted 10 lines
drivers/staging/media/zoran/zr36057.h +7 -0
+#define ZR36057_VFESPFR_YUV422          (0 << 3)
+#define ZR36057_VFESPFR_RGB888          (1 << 3)
+#define ZR36057_VFESPFR_RGB565          (2 << 3)
+#define ZR36057_VFESPFR_RGB555          (3 << 3)
+#define ZR36057_VFESPFR_ERR_DIF          (1 << 2)
+#define ZR36057_VFESPFR_PACK24          (1 << 1)
+#define ZR36057_VFESPFR_LITTLE_ENDIAN    (1 << 0)
 
 #define ZR36057_VDTR            0x00c	/* Video Display "Top" Register */
 

I looked at that header and it is very messy.

Can you make two new patches? The first aligns every nicely, e.g. this:

#define ZR36057_VFEHCR 0x000 /* Video Front End, Horizontal Configuration Register */
#define ZR36057_VFEHCR_HS_POL BIT(30)
#define ZR36057_VFEHCR_H_START 10
#define ZR36057_VFEHCR_H_END 0
#define ZR36057_VFEHCR_HMASK 0x3ff

should become:

/* Video Front End, Horizontal Configuration Register */
#define ZR36057_VFEHCR 0x000
#define ZR36057_VFEHCR_HS_POL BIT(30)
#define ZR36057_VFEHCR_H_START 10
#define ZR36057_VFEHCR_H_END 0
#define ZR36057_VFEHCR_HMASK 0x3ff

Quoted 3 lines

Same for all the other register blocks. Use tabs to do the alignment instead of spaces, as is currently the case.

Quoted 7 lines

Okay Sir, will do this.

Quoted 2 lines

The second patch can replace the (0<<3) etc. to BIT(0).

Sir may I know how to write (2<<3) in BIT() form? Like I am still learning and not sure how to convert this. Should it be BIT(2)? But this is only possible for (1<<nr), PLease help me out.

The << notation is kept for that. So this would be kept as-is:

#define ZR36057_VFESPFR_YUV422          (0 << 3)
#define ZR36057_VFESPFR_RGB888          (1 << 3)
#define ZR36057_VFESPFR_RGB565          (2 << 3)
#define ZR36057_VFESPFR_RGB555          (3 << 3)

BIT() is only used for single bits.

Regards,

Hans

Quoted 8 lines

Thanks.

Quoted 5 lines

That would be a nice cleanup of this rather messy header.

Thanks!

Hans

#8 lore raw

Re: [PATCH 1/2] media: zoran: add spaces around '<<'

In reply to Hans Verkuil
Quoted 58 lines · Hans Verkuil

Hi Mitali,

Quoted 25 lines · Mitali Borkar

Added spaces around '<<' operator to improve readability and meet linux kernel coding style.
Reported by checkpatch

---
 drivers/staging/media/zoran/zr36057.h | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/staging/media/zoran/zr36057.h +0 -7
index 71b651add35a..a2a75fd9f535 100644
@@ -30,13 +30,13 @@
 #define ZR36057_VFESPFR_HOR_DCM          14
 #define ZR36057_VFESPFR_VER_DCM          8
 #define ZR36057_VFESPFR_DISP_MODE        6
-#define ZR36057_VFESPFR_YUV422          (0<<3)
-#define ZR36057_VFESPFR_RGB888          (1<<3)
-#define ZR36057_VFESPFR_RGB565          (2<<3)
-#define ZR36057_VFESPFR_RGB555          (3<<3)
-#define ZR36057_VFESPFR_ERR_DIF          (1<<2)
-#define ZR36057_VFESPFR_PACK24          (1<<1)
-#define ZR36057_VFESPFR_LITTLE_ENDIAN    (1<<0)

drivers/staging/media/zoran/zr36057.h line 42

Quoted 10 lines
drivers/staging/media/zoran/zr36057.h +7 -0
+#define ZR36057_VFESPFR_YUV422          (0 << 3)
+#define ZR36057_VFESPFR_RGB888          (1 << 3)
+#define ZR36057_VFESPFR_RGB565          (2 << 3)
+#define ZR36057_VFESPFR_RGB555          (3 << 3)
+#define ZR36057_VFESPFR_ERR_DIF          (1 << 2)
+#define ZR36057_VFESPFR_PACK24          (1 << 1)
+#define ZR36057_VFESPFR_LITTLE_ENDIAN    (1 << 0)
 
 #define ZR36057_VDTR            0x00c	/* Video Display "Top" Register */
 

I looked at that header and it is very messy.

Can you make two new patches? The first aligns every nicely, e.g. this:

#define ZR36057_VFEHCR 0x000 /* Video Front End, Horizontal Configuration Register */
#define ZR36057_VFEHCR_HS_POL BIT(30)
#define ZR36057_VFEHCR_H_START 10
#define ZR36057_VFEHCR_H_END 0
#define ZR36057_VFEHCR_HMASK 0x3ff

should become:

/* Video Front End, Horizontal Configuration Register */
#define ZR36057_VFEHCR 0x000
#define ZR36057_VFEHCR_HS_POL BIT(30)
#define ZR36057_VFEHCR_H_START 10
#define ZR36057_VFEHCR_H_END 0
#define ZR36057_VFEHCR_HMASK 0x3ff

Quoted 5 lines

Same for all the other register blocks. Use tabs to do the alignment instead of spaces, as is currently the case.

The second patch can replace the (0<<3) etc. to BIT(0).

Then I guess only one new patch would be needed for proper alignment, am i right? I have to rename it as v2 or should send as a completely new patch?

Quoted 5 lines

That would be a nice cleanup of this rather messy header.

Thanks!

Hans

#9 lore raw

Re: [Outreachy kernel] Re: [PATCH 1/2] media: zoran: add spaces around '<<'

Quoted 59 lines · Mitali Borkar
Quoted 58 lines · Hans Verkuil

Hi Mitali,

Quoted 25 lines · Mitali Borkar

Added spaces around '<<' operator to improve readability and meet linux kernel coding style.
Reported by checkpatch

---
 drivers/staging/media/zoran/zr36057.h | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/staging/media/zoran/zr36057.h +0 -7
index 71b651add35a..a2a75fd9f535 100644
@@ -30,13 +30,13 @@
 #define ZR36057_VFESPFR_HOR_DCM          14
 #define ZR36057_VFESPFR_VER_DCM          8
 #define ZR36057_VFESPFR_DISP_MODE        6
-#define ZR36057_VFESPFR_YUV422          (0<<3)
-#define ZR36057_VFESPFR_RGB888          (1<<3)
-#define ZR36057_VFESPFR_RGB565          (2<<3)
-#define ZR36057_VFESPFR_RGB555          (3<<3)
-#define ZR36057_VFESPFR_ERR_DIF          (1<<2)
-#define ZR36057_VFESPFR_PACK24          (1<<1)
-#define ZR36057_VFESPFR_LITTLE_ENDIAN    (1<<0)

drivers/staging/media/zoran/zr36057.h line 42

Quoted 10 lines
drivers/staging/media/zoran/zr36057.h +7 -0
+#define ZR36057_VFESPFR_YUV422          (0 << 3)
+#define ZR36057_VFESPFR_RGB888          (1 << 3)
+#define ZR36057_VFESPFR_RGB565          (2 << 3)
+#define ZR36057_VFESPFR_RGB555          (3 << 3)
+#define ZR36057_VFESPFR_ERR_DIF          (1 << 2)
+#define ZR36057_VFESPFR_PACK24          (1 << 1)
+#define ZR36057_VFESPFR_LITTLE_ENDIAN    (1 << 0)
 
 #define ZR36057_VDTR            0x00c	/* Video Display "Top" Register */
 

I looked at that header and it is very messy.

Can you make two new patches? The first aligns every nicely, e.g. this:

#define ZR36057_VFEHCR 0x000 /* Video Front End, Horizontal Configuration Register */
#define ZR36057_VFEHCR_HS_POL BIT(30)
#define ZR36057_VFEHCR_H_START 10
#define ZR36057_VFEHCR_H_END 0
#define ZR36057_VFEHCR_HMASK 0x3ff

should become:

/* Video Front End, Horizontal Configuration Register */
#define ZR36057_VFEHCR 0x000
#define ZR36057_VFEHCR_HS_POL BIT(30)
#define ZR36057_VFEHCR_H_START 10
#define ZR36057_VFEHCR_H_END 0
#define ZR36057_VFEHCR_HMASK 0x3ff

Quoted 8 lines
Quoted 5 lines

Same for all the other register blocks. Use tabs to do the alignment instead of spaces, as is currently the case.

The second patch can replace the (0<<3) etc. to BIT(0).

Then I guess only one new patch would be needed for proper alignment, am i right? I have to rename it as v2 or should send as a completely new patch?

v2 might reduce confusion.

julia

Quoted 11 lines
Quoted 5 lines

That would be a nice cleanup of this rather messy header.

Thanks!

Hans

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/YHCFsNZVGfjjyHDi%40kali.

#10 lore raw

PATCH 2/2 media: zoran: replace bit shifts by BIT() macro

In reply to Mitali Borkar

Added #include <linux/bitops.h> and replaced bit shifts by BIT() macro. This BIT() macro from linux/bitops.h is used to define ZR36057_VFESPFR_* bitmasks. Use of macro is better and neater. It maintains consistency.
Reported by checkpatch.

---
 drivers/staging/media/zoran/zr36057.h | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/staging/media/zoran/zr36057.h +6 -4
index a2a75fd9f535..93075459f910 100644
@@ -8,6 +8,8 @@
 #ifndef _ZR36057_H_
 #define _ZR36057_H_
 
+#include <linux/bitops.h>
+
 /* Zoran ZR36057 registers */
 
 #define ZR36057_VFEHCR          0x000	/* Video Front End, Horizontal Configuration Register */
@@ -31,12 +33,12 @@
 #define ZR36057_VFESPFR_VER_DCM          8
 #define ZR36057_VFESPFR_DISP_MODE        6
 #define ZR36057_VFESPFR_YUV422          (0 << 3)
-#define ZR36057_VFESPFR_RGB888          (1 << 3)
+#define ZR36057_VFESPFR_RGB888          BIT(3)
 #define ZR36057_VFESPFR_RGB565          (2 << 3)
 #define ZR36057_VFESPFR_RGB555          (3 << 3)
-#define ZR36057_VFESPFR_ERR_DIF          (1 << 2)
-#define ZR36057_VFESPFR_PACK24          (1 << 1)
-#define ZR36057_VFESPFR_LITTLE_ENDIAN    (1 << 0)
+#define ZR36057_VFESPFR_ERR_DIF          BIT(2)
+#define ZR36057_VFESPFR_PACK24          BIT(1)
+#define ZR36057_VFESPFR_LITTLE_ENDIAN    BIT(0)
 
 #define ZR36057_VDTR            0x00c	/* Video Display "Top" Register */
 
Signature · 1 line
2.30.2
#11 lore raw

Re: [Outreachy kernel] [PATCH 2/2] media: zoran: replace bit shifts by BIT() macro

Quoted 24 lines · Mitali Borkar

Added #include <linux/bitops.h> and replaced bit shifts by BIT() macro. This BIT() macro from linux/bitops.h is used to define ZR36057_VFESPFR_* bitmasks. Use of macro is better and neater. It maintains consistency.
Reported by checkpatch.

---
 drivers/staging/media/zoran/zr36057.h | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/staging/media/zoran/zr36057.h +2 -0
index a2a75fd9f535..93075459f910 100644
@@ -8,6 +8,8 @@
 #ifndef _ZR36057_H_
 #define _ZR36057_H_
 
+#include <linux/bitops.h>
+
 /* Zoran ZR36057 registers */
 
 #define ZR36057_VFEHCR          0x000	/* Video Front End, Horizontal Configuration Register */

drivers/staging/media/zoran/zr36057.h line 36

Quoted 5 lines
drivers/staging/media/zoran/zr36057.h +1 -1
@@ -31,12 +33,12 @@
 #define ZR36057_VFESPFR_VER_DCM          8
 #define ZR36057_VFESPFR_DISP_MODE        6
 #define ZR36057_VFESPFR_YUV422          (0 << 3)
-#define ZR36057_VFESPFR_RGB888          (1 << 3)
+#define ZR36057_VFESPFR_RGB888          BIT(3)

Uniformity is generally considered to be more important than using BIT. Having only a few constants defined using BIT is a bit strange.

julia

Quoted 19 lines
drivers/staging/media/zoran/zr36057.h +3 -4
 #define ZR36057_VFESPFR_RGB565          (2 << 3)
 #define ZR36057_VFESPFR_RGB555          (3 << 3)
-#define ZR36057_VFESPFR_ERR_DIF          (1 << 2)
-#define ZR36057_VFESPFR_PACK24          (1 << 1)
-#define ZR36057_VFESPFR_LITTLE_ENDIAN    (1 << 0)
+#define ZR36057_VFESPFR_ERR_DIF          BIT(2)
+#define ZR36057_VFESPFR_PACK24          BIT(1)
+#define ZR36057_VFESPFR_LITTLE_ENDIAN    BIT(0)
 
 #define ZR36057_VDTR            0x00c	/* Video Display "Top" Register */
 
--

2.30.2

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/ac8ec2b70ac2cc7c541c05a1d9a8db1fe79df793.1617912177.git.mitaliborkar810%40gmail.com.

#12 lore raw

Re: [Outreachy kernel] [PATCH 2/2] media: zoran: replace bit shifts by BIT() macro

Quoted 26 lines · Julia Lawall
Quoted 22 lines · Mitali Borkar

Added #include <linux/bitops.h> and replaced bit shifts by BIT() macro. This BIT() macro from linux/bitops.h is used to define ZR36057_VFESPFR_* bitmasks. Use of macro is better and neater. It maintains consistency.
Reported by checkpatch.

---
 drivers/staging/media/zoran/zr36057.h | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/staging/media/zoran/zr36057.h +2 -0
index a2a75fd9f535..93075459f910 100644
@@ -8,6 +8,8 @@
 #ifndef _ZR36057_H_
 #define _ZR36057_H_
 
+#include <linux/bitops.h>
+
 /* Zoran ZR36057 registers */
 
Quoted 11 lines

drivers/staging/media/zoran/zr36057.h line 36

Quoted 7 lines
drivers/staging/media/zoran/zr36057.h +1 -1
 #define ZR36057_VFEHCR          0x000	/* Video Front End, Horizontal Configuration Register */
@@ -31,12 +33,12 @@
 #define ZR36057_VFESPFR_VER_DCM          8
 #define ZR36057_VFESPFR_DISP_MODE        6
 #define ZR36057_VFESPFR_YUV422          (0 << 3)
-#define ZR36057_VFESPFR_RGB888          (1 << 3)
+#define ZR36057_VFESPFR_RGB888          BIT(3)

Uniformity is generally considered to be more important than using BIT. Having only a few constants defined using BIT is a bit strange.

Okay Ma'am. Can you please tell me on how to proceed now? I am not sure how to proceed.

Quoted 21 lines

julia

Quoted 19 lines
drivers/staging/media/zoran/zr36057.h +3 -4
 #define ZR36057_VFESPFR_RGB565          (2 << 3)
 #define ZR36057_VFESPFR_RGB555          (3 << 3)
-#define ZR36057_VFESPFR_ERR_DIF          (1 << 2)
-#define ZR36057_VFESPFR_PACK24          (1 << 1)
-#define ZR36057_VFESPFR_LITTLE_ENDIAN    (1 << 0)
+#define ZR36057_VFESPFR_ERR_DIF          BIT(2)
+#define ZR36057_VFESPFR_PACK24          BIT(1)
+#define ZR36057_VFESPFR_LITTLE_ENDIAN    BIT(0)
 
 #define ZR36057_VDTR            0x00c	/* Video Display "Top" Register */
 
--

2.30.2

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/ac8ec2b70ac2cc7c541c05a1d9a8db1fe79df793.1617912177.git.mitaliborkar810%40gmail.com.

#13 lore raw

Re: [Outreachy kernel] [PATCH 2/2] media: zoran: replace bit shifts by BIT() macro

Quoted 38 lines · Mitali Borkar
Quoted 26 lines · Julia Lawall
Quoted 22 lines · Mitali Borkar

Added #include <linux/bitops.h> and replaced bit shifts by BIT() macro. This BIT() macro from linux/bitops.h is used to define ZR36057_VFESPFR_* bitmasks. Use of macro is better and neater. It maintains consistency.
Reported by checkpatch.

---
 drivers/staging/media/zoran/zr36057.h | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/staging/media/zoran/zr36057.h +2 -0
index a2a75fd9f535..93075459f910 100644
@@ -8,6 +8,8 @@
 #ifndef _ZR36057_H_
 #define _ZR36057_H_
 
+#include <linux/bitops.h>
+
 /* Zoran ZR36057 registers */
 
Quoted 11 lines

drivers/staging/media/zoran/zr36057.h line 36

Quoted 7 lines
drivers/staging/media/zoran/zr36057.h +1 -1
 #define ZR36057_VFEHCR          0x000	/* Video Front End, Horizontal Configuration Register */
@@ -31,12 +33,12 @@
 #define ZR36057_VFESPFR_VER_DCM          8
 #define ZR36057_VFESPFR_DISP_MODE        6
 #define ZR36057_VFESPFR_YUV422          (0 << 3)
-#define ZR36057_VFESPFR_RGB888          (1 << 3)
+#define ZR36057_VFESPFR_RGB888          BIT(3)

Uniformity is generally considered to be more important than using BIT. Having only a few constants defined using BIT is a bit strange.

Quoted 2 lines

Okay Ma'am. Can you please tell me on how to proceed now? I am not sure how to proceed.

I think that this code should just be left as is.

Checkpatch makes suggestions. Its suggestions are not always appropriate for the context.

julia

Quoted 23 lines
Quoted 22 lines

julia

Quoted 19 lines
drivers/staging/media/zoran/zr36057.h +3 -4
 #define ZR36057_VFESPFR_RGB565          (2 << 3)
 #define ZR36057_VFESPFR_RGB555          (3 << 3)
-#define ZR36057_VFESPFR_ERR_DIF          (1 << 2)
-#define ZR36057_VFESPFR_PACK24          (1 << 1)
-#define ZR36057_VFESPFR_LITTLE_ENDIAN    (1 << 0)
+#define ZR36057_VFESPFR_ERR_DIF          BIT(2)
+#define ZR36057_VFESPFR_PACK24          BIT(1)
+#define ZR36057_VFESPFR_LITTLE_ENDIAN    BIT(0)
 
 #define ZR36057_VDTR            0x00c	/* Video Display "Top" Register */
 
--

2.30.2

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/ac8ec2b70ac2cc7c541c05a1d9a8db1fe79df793.1617912177.git.mitaliborkar810%40gmail.com.

#14 lore raw

Re: [Outreachy kernel] [PATCH 2/2] media: zoran: replace bit shifts by BIT() macro

Quoted 42 lines · Julia Lawall
Quoted 38 lines · Mitali Borkar
Quoted 37 lines · Julia Lawall
Quoted 24 lines · Mitali Borkar

Added #include <linux/bitops.h> and replaced bit shifts by BIT() macro. This BIT() macro from linux/bitops.h is used to define ZR36057_VFESPFR_* bitmasks. Use of macro is better and neater. It maintains consistency.
Reported by checkpatch.

---
 drivers/staging/media/zoran/zr36057.h | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/staging/media/zoran/zr36057.h +2 -0
index a2a75fd9f535..93075459f910 100644
@@ -8,6 +8,8 @@
 #ifndef _ZR36057_H_
 #define _ZR36057_H_
 
+#include <linux/bitops.h>
+
 /* Zoran ZR36057 registers */
 
 #define ZR36057_VFEHCR          0x000	/* Video Front End, Horizontal Configuration Register */

drivers/staging/media/zoran/zr36057.h line 36

Quoted 5 lines
drivers/staging/media/zoran/zr36057.h +1 -1
@@ -31,12 +33,12 @@
 #define ZR36057_VFESPFR_VER_DCM          8
 #define ZR36057_VFESPFR_DISP_MODE        6
 #define ZR36057_VFESPFR_YUV422          (0 << 3)
-#define ZR36057_VFESPFR_RGB888          (1 << 3)
+#define ZR36057_VFESPFR_RGB888          BIT(3)

Uniformity is generally considered to be more important than using BIT. Having only a few constants defined using BIT is a bit strange.

Quoted 8 lines
Quoted 2 lines

Okay Ma'am. Can you please tell me on how to proceed now? I am not sure how to proceed.

I think that this code should just be left as is.

Checkpatch makes suggestions. Its suggestions are not always appropriate for the context.

Okay Ma'am. This means I should not do any changes now. Do I need to do something in this patch now? Or move onto next one?

Quoted 25 lines

julia

Quoted 23 lines
Quoted 22 lines

julia

Quoted 19 lines
drivers/staging/media/zoran/zr36057.h +3 -4
 #define ZR36057_VFESPFR_RGB565          (2 << 3)
 #define ZR36057_VFESPFR_RGB555          (3 << 3)
-#define ZR36057_VFESPFR_ERR_DIF          (1 << 2)
-#define ZR36057_VFESPFR_PACK24          (1 << 1)
-#define ZR36057_VFESPFR_LITTLE_ENDIAN    (1 << 0)
+#define ZR36057_VFESPFR_ERR_DIF          BIT(2)
+#define ZR36057_VFESPFR_PACK24          BIT(1)
+#define ZR36057_VFESPFR_LITTLE_ENDIAN    BIT(0)
 
 #define ZR36057_VDTR            0x00c	/* Video Display "Top" Register */
 
--

2.30.2

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/ac8ec2b70ac2cc7c541c05a1d9a8db1fe79df793.1617912177.git.mitaliborkar810%40gmail.com.

#15 lore raw

Re: [Outreachy kernel] [PATCH 2/2] media: zoran: replace bit shifts by BIT() macro

Quoted 46 lines · Mitali Borkar
Quoted 45 lines · Julia Lawall
Quoted 40 lines · Mitali Borkar
Quoted 26 lines · Julia Lawall
Quoted 22 lines · Mitali Borkar

Added #include <linux/bitops.h> and replaced bit shifts by BIT() macro. This BIT() macro from linux/bitops.h is used to define ZR36057_VFESPFR_* bitmasks. Use of macro is better and neater. It maintains consistency.
Reported by checkpatch.

---
 drivers/staging/media/zoran/zr36057.h | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/staging/media/zoran/zr36057.h +2 -0
index a2a75fd9f535..93075459f910 100644
@@ -8,6 +8,8 @@
 #ifndef _ZR36057_H_
 #define _ZR36057_H_
 
+#include <linux/bitops.h>
+
 /* Zoran ZR36057 registers */
 
Quoted 11 lines

drivers/staging/media/zoran/zr36057.h line 36

Quoted 7 lines
drivers/staging/media/zoran/zr36057.h +1 -1
 #define ZR36057_VFEHCR          0x000	/* Video Front End, Horizontal Configuration Register */
@@ -31,12 +33,12 @@
 #define ZR36057_VFESPFR_VER_DCM          8
 #define ZR36057_VFESPFR_DISP_MODE        6
 #define ZR36057_VFESPFR_YUV422          (0 << 3)
-#define ZR36057_VFESPFR_RGB888          (1 << 3)
+#define ZR36057_VFESPFR_RGB888          BIT(3)

Uniformity is generally considered to be more important than using BIT. Having only a few constants defined using BIT is a bit strange.

Okay Ma'am. Can you please tell me on how to proceed now? I am not sure how to proceed.

Quoted 7 lines
Quoted 5 lines

I think that this code should just be left as is.

Checkpatch makes suggestions. Its suggestions are not always appropriate for the context.

Okay Ma'am. This means I should not do any changes now. Do I need to do something in this patch now? Or move onto next one?

You can move on.

julia

Quoted 27 lines
Quoted 26 lines

julia

Quoted 23 lines
Quoted 22 lines

julia

Quoted 19 lines
drivers/staging/media/zoran/zr36057.h +3 -4
 #define ZR36057_VFESPFR_RGB565          (2 << 3)
 #define ZR36057_VFESPFR_RGB555          (3 << 3)
-#define ZR36057_VFESPFR_ERR_DIF          (1 << 2)
-#define ZR36057_VFESPFR_PACK24          (1 << 1)
-#define ZR36057_VFESPFR_LITTLE_ENDIAN    (1 << 0)
+#define ZR36057_VFESPFR_ERR_DIF          BIT(2)
+#define ZR36057_VFESPFR_PACK24          BIT(1)
+#define ZR36057_VFESPFR_LITTLE_ENDIAN    BIT(0)
 
 #define ZR36057_VDTR            0x00c	/* Video Display "Top" Register */
 
--

2.30.2

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/ac8ec2b70ac2cc7c541c05a1d9a8db1fe79df793.1617912177.git.mitaliborkar810%40gmail.com.