Skip to contentSkip to conversation

staging: sm750fb: Parenthesize complex values in macros

PATCH In review Janani Ravichandran 2 participants 4 messages Feb 13, 2016 – Feb 14, 2016

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

PATCH 1/1 staging: sm750fb: Parenthesize complex values in macros

Parenthesize complex macro values to suppress checkpatch errors.

---
 drivers/staging/sm750fb/sm750_cursor.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)
drivers/staging/sm750fb/sm750_cursor.c +11 -11
index 0a41585..a8d3e96 100644
@@ -28,33 +28,33 @@ writel((data), cursor->mmio + (addr))
 
 /* cursor control for voyager and 718/750*/
 #define HWC_ADDRESS                         0x0
-#define HWC_ADDRESS_ENABLE                  31:31
+#define HWC_ADDRESS_ENABLE                  (31:31)
 #define HWC_ADDRESS_ENABLE_DISABLE          0
 #define HWC_ADDRESS_ENABLE_ENABLE           1
-#define HWC_ADDRESS_EXT                     27:27
+#define HWC_ADDRESS_EXT                     (27:27)
 #define HWC_ADDRESS_EXT_LOCAL               0
 #define HWC_ADDRESS_EXT_EXTERNAL            1
-#define HWC_ADDRESS_CS                      26:26
+#define HWC_ADDRESS_CS                      (26:26)
 #define HWC_ADDRESS_CS_0                    0
 #define HWC_ADDRESS_CS_1                    1
-#define HWC_ADDRESS_ADDRESS                 25:0
+#define HWC_ADDRESS_ADDRESS                 (25:0)
 
 #define HWC_LOCATION                        0x4
-#define HWC_LOCATION_TOP                    27:27
+#define HWC_LOCATION_TOP                    (27:27)
 #define HWC_LOCATION_TOP_INSIDE             0
 #define HWC_LOCATION_TOP_OUTSIDE            1
-#define HWC_LOCATION_Y                      26:16
-#define HWC_LOCATION_LEFT                   11:11
+#define HWC_LOCATION_Y                      (26:16)
+#define HWC_LOCATION_LEFT                   (11:11)
 #define HWC_LOCATION_LEFT_INSIDE            0
 #define HWC_LOCATION_LEFT_OUTSIDE           1
-#define HWC_LOCATION_X                      10:0
+#define HWC_LOCATION_X                      (10:0)
 
 #define HWC_COLOR_12                        0x8
-#define HWC_COLOR_12_2_RGB565               31:16
-#define HWC_COLOR_12_1_RGB565               15:0
+#define HWC_COLOR_12_2_RGB565               (31:16)
+#define HWC_COLOR_12_1_RGB565               (15:0)
 
 #define HWC_COLOR_3                         0xC
-#define HWC_COLOR_3_RGB565                  15:0
+#define HWC_COLOR_3_RGB565                  (15:0)
 
 
 /* hw_cursor_xxx works for voyager,718 and 750 */
Signature · 1 line
2.5.0
#1 lore raw
Quoted 43 lines · Janani Ravichandran

Parenthesize complex macro values to suppress checkpatch errors.

---
 drivers/staging/sm750fb/sm750_cursor.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)
drivers/staging/sm750fb/sm750_cursor.c +8 -8
index 0a41585..a8d3e96 100644
@@ -28,33 +28,33 @@ writel((data), cursor->mmio + (addr))
 
 /* cursor control for voyager and 718/750*/
 #define HWC_ADDRESS                         0x0
-#define HWC_ADDRESS_ENABLE                  31:31
+#define HWC_ADDRESS_ENABLE                  (31:31)
 #define HWC_ADDRESS_ENABLE_DISABLE          0
 #define HWC_ADDRESS_ENABLE_ENABLE           1
-#define HWC_ADDRESS_EXT                     27:27
+#define HWC_ADDRESS_EXT                     (27:27)
 #define HWC_ADDRESS_EXT_LOCAL               0
 #define HWC_ADDRESS_EXT_EXTERNAL            1
-#define HWC_ADDRESS_CS                      26:26
+#define HWC_ADDRESS_CS                      (26:26)
 #define HWC_ADDRESS_CS_0                    0
 #define HWC_ADDRESS_CS_1                    1
-#define HWC_ADDRESS_ADDRESS                 25:0
+#define HWC_ADDRESS_ADDRESS                 (25:0)
 
 #define HWC_LOCATION                        0x4
-#define HWC_LOCATION_TOP                    27:27
+#define HWC_LOCATION_TOP                    (27:27)
 #define HWC_LOCATION_TOP_INSIDE             0
 #define HWC_LOCATION_TOP_OUTSIDE            1
-#define HWC_LOCATION_Y                      26:16
-#define HWC_LOCATION_LEFT                   11:11
+#define HWC_LOCATION_Y                      (26:16)
+#define HWC_LOCATION_LEFT                   (11:11)
 #define HWC_LOCATION_LEFT_INSIDE            0
 #define HWC_LOCATION_LEFT_OUTSIDE           1
-#define HWC_LOCATION_X                      10:0
+#define HWC_LOCATION_X                      (10:0)

drivers/staging/sm750fb/sm750_cursor.c writel((data), cursor->mmio + (addr)) · line 57

Quoted 10 lines
drivers/staging/sm750fb/sm750_cursor.c +3 -3
 
 #define HWC_COLOR_12                        0x8
-#define HWC_COLOR_12_2_RGB565               31:16
-#define HWC_COLOR_12_1_RGB565               15:0
+#define HWC_COLOR_12_2_RGB565               (31:16)
+#define HWC_COLOR_12_1_RGB565               (15:0)
 
 #define HWC_COLOR_3                         0xC
-#define HWC_COLOR_3_RGB565                  15:0
+#define HWC_COLOR_3_RGB565                  (15:0)

Are these used anywhere? Grepping for a few of them didn't turn up anything. But maybe they provide useful information about the device that should be preserved. In summary, I'm missing to see what kind of C expression has the form e1:e2, and I wonder if this is intended to be part of something else that will break when you add the parentheses.

julia

Quoted 13 lines
drivers/staging/sm750fb/sm750_cursor.c +0 -0
 /* hw_cursor_xxx works for voyager,718 and 750 */
Signature · 8 lines
2.5.0

-- 
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 post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20160214034355.GA24997%40janani-Inspiron-3521.
For more options, visit https://groups.google.com/d/optout.
#2 lore raw
Quoted 2 lines

Are these used anywhere? Grepping for a few of them didn't turn up anything.

No, Julia, these don't seem to be used anywhere. They are just defined.

Quoted 2 lines

But maybe they provide useful information about the device that should be preserved.

True.

Quoted 1 line

In summary, I'm missing to see what kind of C

Quoted 3 lines

expression has the form e1:e2, and I wonder if this is intended to be part of something else that will break when you add the parentheses.

I added the parentheses as checkpatch recognized it as a complex expression and suggested the parentheses.
I might have made a mistake. In that case, please ignore this patch :)

Janani

Quoted 22 lines

julia

Quoted 8 lines

/* hw_cursor_xxx works for voyager,718 and 750 */
--
2.5.0

--
You received this message because you are subscribed to the Google

Groups "outreachy-kernel" group.

Quoted 1 line

To unsubscribe from this group and stop receiving emails from it, send

an email to [email protected].

Quoted 2 lines

To post to this group, send email to [email protected]. To view this discussion on the web visit

https://groups.google.com/d/msgid/outreachy-kernel/20160214034355.GA24997%40janani-Inspiron-3521
.

Quoted 2 lines

For more options, visit https://groups.google.com/d/optout.

#3 lore raw
Quoted 21 lines · Janani Ravichandran

Are these used anywhere?  Grepping for a few of them didn't turn up anything.

No, Julia, these don't seem to be used anywhere. They are just defined.
But maybe they provide useful information about the device that should be preserved.

True.

In summary, I'm missing to see what kind of C expression has the form e1:e2, and I wonder if this is intended to be part
of something else that will break when you add the parentheses.

Quoted 3 lines

I added the parentheses as checkpatch recognized it as a complex expression and suggested the parentheses.
I might have made a mistake. In that case, please ignore this patch :)

Checkpatch does not know all that much about the syntax of C.

julia