Skip to contentSkip to conversation

usb: charger: assign specific number for enum value

PATCH New Peter Chen 1 participant 1 message Feb 1, 2020 USB

lore
Share & tools
lore

Peter Chen

author
#0 lore raw

PATCH v2 1/1 usb: charger: assign specific number for enum value

To work properly on every architectures and compilers, the enum value needs to be specific numbers.

---
Changes for v2:
- Fix typo

 include/uapi/linux/usb/charger.h | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
include/uapi/linux/usb/charger.h +8 -8
index 5f72af35b3ed..ad22079125bf 100644
@@ -14,18 +14,18 @@
  * ACA (Accessory Charger Adapters)
  */
 enum usb_charger_type {
-	UNKNOWN_TYPE,
-	SDP_TYPE,
-	DCP_TYPE,
-	CDP_TYPE,
-	ACA_TYPE,
+	UNKNOWN_TYPE = 0,
+	SDP_TYPE = 1,
+	DCP_TYPE = 2,
+	CDP_TYPE = 3,
+	ACA_TYPE = 4,
 };
 
 /* USB charger state */
 enum usb_charger_state {
-	USB_CHARGER_DEFAULT,
-	USB_CHARGER_PRESENT,
-	USB_CHARGER_ABSENT,
+	USB_CHARGER_DEFAULT = 0,
+	USB_CHARGER_PRESENT = 1,
+	USB_CHARGER_ABSENT = 2,
 };
 
 #endif /* _UAPI__LINUX_USB_CHARGER_H */
Signature · 1 line
2.17.1