Skip to contentSkip to conversation

dt-bindings: connector: Replace BIT macro with generic bit ops

PATCH In review Kyle Tso 4 participants 5 messages May 27, 2021 – Jun 2, 2021

Subsystems (2)
lore
Share & tools
lore

Kyle Tso

author
#0 lore raw

PATCH v2 1/1 dt-bindings: connector: Replace BIT macro with generic bit ops

BIT macro is not defined. Replace it with generic bit operations.

Fixes 630dce2810b9 ("dt-bindings: connector: Add SVDM VDO properties")

---
Changes since v1:
- re-word the commit message

 include/dt-bindings/usb/pd.h | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
include/dt-bindings/usb/pd.h +10 -10
index fef3ef65967f..cb70b4ceedde 100644
@@ -163,10 +163,10 @@
 #define UFP_VDO_VER1_2		2
 
 /* Device Capability */
-#define DEV_USB2_CAPABLE	BIT(0)
-#define DEV_USB2_BILLBOARD	BIT(1)
-#define DEV_USB3_CAPABLE	BIT(2)
-#define DEV_USB4_CAPABLE	BIT(3)
+#define DEV_USB2_CAPABLE	(1 << 0)
+#define DEV_USB2_BILLBOARD	(1 << 1)
+#define DEV_USB3_CAPABLE	(1 << 2)
+#define DEV_USB4_CAPABLE	(1 << 3)
 
 /* Connector Type */
 #define UFP_RECEPTACLE		2
@@ -191,9 +191,9 @@
 
 /* Alternate Modes */
 #define UFP_ALTMODE_NOT_SUPP	0
-#define UFP_ALTMODE_TBT3	BIT(0)
-#define UFP_ALTMODE_RECFG	BIT(1)
-#define UFP_ALTMODE_NO_RECFG	BIT(2)
+#define UFP_ALTMODE_TBT3	(1 << 0)
+#define UFP_ALTMODE_RECFG	(1 << 1)
+#define UFP_ALTMODE_NO_RECFG	(1 << 2)
 
 /* USB Highest Speed */
 #define UFP_USB2_ONLY		0
@@ -217,9 +217,9 @@
  * <4:0>   :: Port number
  */
 #define DFP_VDO_VER1_1		1
-#define HOST_USB2_CAPABLE	BIT(0)
-#define HOST_USB3_CAPABLE	BIT(1)
-#define HOST_USB4_CAPABLE	BIT(2)
+#define HOST_USB2_CAPABLE	(1 << 0)
+#define HOST_USB3_CAPABLE	(1 << 1)
+#define HOST_USB4_CAPABLE	(1 << 2)
 #define DFP_RECEPTACLE		2
 #define DFP_CAPTIVE		3
 
Signature · 1 line
2.31.1.818.g46aad6cb9e-goog
maintainer
#1 lore raw
Quoted 17 lines · Kyle Tso

BIT macro is not defined. Replace it with generic bit operations.

Fixes 630dce2810b9 ("dt-bindings: connector: Add SVDM VDO properties")

---
Changes since v1:
- re-word the commit message

 include/dt-bindings/usb/pd.h | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
include/dt-bindings/usb/pd.h +0 -0
index fef3ef65967f..cb70b4ceedde 100644
@@ -163,10 +163,10 @@
 #define UFP_VDO_VER1_2		2

include/dt-bindings/usb/pd.h line 169

Quoted 10 lines
include/dt-bindings/usb/pd.h +4 -4
 
 /* Device Capability */
-#define DEV_USB2_CAPABLE	BIT(0)
-#define DEV_USB2_BILLBOARD	BIT(1)
-#define DEV_USB3_CAPABLE	BIT(2)
-#define DEV_USB4_CAPABLE	BIT(3)
+#define DEV_USB2_CAPABLE	(1 << 0)
+#define DEV_USB2_BILLBOARD	(1 << 1)
+#define DEV_USB3_CAPABLE	(1 << 2)
+#define DEV_USB4_CAPABLE	(1 << 3)

Why not just include the proper .h file instead?

#2 lore raw
Quoted 20 lines · Greg KH
Quoted 18 lines · Kyle Tso

BIT macro is not defined. Replace it with generic bit operations.

Fixes 630dce2810b9 ("dt-bindings: connector: Add SVDM VDO properties")

---
Changes since v1:
- re-word the commit message

 include/dt-bindings/usb/pd.h | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
include/dt-bindings/usb/pd.h +0 -0
index fef3ef65967f..cb70b4ceedde 100644
@@ -163,10 +163,10 @@
 #define UFP_VDO_VER1_2               2
 
Quoted 11 lines

include/dt-bindings/usb/pd.h line 169

Quoted 9 lines
include/dt-bindings/usb/pd.h +4 -4
 /* Device Capability */
-#define DEV_USB2_CAPABLE     BIT(0)
-#define DEV_USB2_BILLBOARD   BIT(1)
-#define DEV_USB3_CAPABLE     BIT(2)
-#define DEV_USB4_CAPABLE     BIT(3)
+#define DEV_USB2_CAPABLE     (1 << 0)
+#define DEV_USB2_BILLBOARD   (1 << 1)
+#define DEV_USB3_CAPABLE     (1 << 2)
+#define DEV_USB4_CAPABLE     (1 << 3)

Why not just include the proper .h file instead?

Because the DT headers can't depend on kernel headers as they get used separately.

Rob

maintainer
#3 lore raw
Quoted 33 lines · Rob Herring
Quoted 20 lines · Greg KH
Quoted 18 lines · Kyle Tso

BIT macro is not defined. Replace it with generic bit operations.

Fixes 630dce2810b9 ("dt-bindings: connector: Add SVDM VDO properties")

---
Changes since v1:
- re-word the commit message

 include/dt-bindings/usb/pd.h | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
include/dt-bindings/usb/pd.h +0 -0
index fef3ef65967f..cb70b4ceedde 100644
@@ -163,10 +163,10 @@
 #define UFP_VDO_VER1_2               2
 
Quoted 11 lines

include/dt-bindings/usb/pd.h line 169

Quoted 9 lines
include/dt-bindings/usb/pd.h +4 -4
 /* Device Capability */
-#define DEV_USB2_CAPABLE     BIT(0)
-#define DEV_USB2_BILLBOARD   BIT(1)
-#define DEV_USB3_CAPABLE     BIT(2)
-#define DEV_USB4_CAPABLE     BIT(3)
+#define DEV_USB2_CAPABLE     (1 << 0)
+#define DEV_USB2_BILLBOARD   (1 << 1)
+#define DEV_USB3_CAPABLE     (1 << 2)
+#define DEV_USB4_CAPABLE     (1 << 3)

Why not just include the proper .h file instead?

Quoted 2 lines

Because the DT headers can't depend on kernel headers as they get used separately.

Lame. :)

maintainer Reviewed-by on v2 1/1
#4 lore raw
In reply to Kyle Tso
Quoted 11 lines · Kyle Tso

BIT macro is not defined. Replace it with generic bit operations.

Fixes 630dce2810b9 ("dt-bindings: connector: Add SVDM VDO properties")

---
Changes since v1:
- re-word the commit message

 include/dt-bindings/usb/pd.h | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)