Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: charger: assign specific number for enum value

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

Suggested-by: Greg KH <gregkh@linuxfoundation.org>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Link: https://lore.kernel.org/r/1580537624-10179-1-git-send-email-peter.chen@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Peter Chen and committed by
Greg Kroah-Hartman
ca4b43c1 3e99862c

+8 -8
+8 -8
include/uapi/linux/usb/charger.h
··· 14 14 * ACA (Accessory Charger Adapters) 15 15 */ 16 16 enum usb_charger_type { 17 - UNKNOWN_TYPE, 18 - SDP_TYPE, 19 - DCP_TYPE, 20 - CDP_TYPE, 21 - ACA_TYPE, 17 + UNKNOWN_TYPE = 0, 18 + SDP_TYPE = 1, 19 + DCP_TYPE = 2, 20 + CDP_TYPE = 3, 21 + ACA_TYPE = 4, 22 22 }; 23 23 24 24 /* USB charger state */ 25 25 enum usb_charger_state { 26 - USB_CHARGER_DEFAULT, 27 - USB_CHARGER_PRESENT, 28 - USB_CHARGER_ABSENT, 26 + USB_CHARGER_DEFAULT = 0, 27 + USB_CHARGER_PRESENT = 1, 28 + USB_CHARGER_ABSENT = 2, 29 29 }; 30 30 31 31 #endif /* _UAPI__LINUX_USB_CHARGER_H */