linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] usb: charger: assign specific number for enum value
@ 2020-01-31  2:03 Peter Chen
  2020-01-31  8:55 ` Sergei Shtylyov
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Chen @ 2020-01-31  2:03 UTC (permalink / raw)
  To: balbi; +Cc: linux-usb, linux-imx, gregkh, Peter Chen

For 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>
---
 include/uapi/linux/usb/charger.h | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/include/uapi/linux/usb/charger.h b/include/uapi/linux/usb/charger.h
index 5f72af35b3ed..ad22079125bf 100644
--- a/include/uapi/linux/usb/charger.h
+++ b/include/uapi/linux/usb/charger.h
@@ -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 */
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] usb: charger: assign specific number for enum value
  2020-01-31  2:03 [PATCH 1/1] usb: charger: assign specific number for enum value Peter Chen
@ 2020-01-31  8:55 ` Sergei Shtylyov
  0 siblings, 0 replies; 2+ messages in thread
From: Sergei Shtylyov @ 2020-01-31  8:55 UTC (permalink / raw)
  To: Peter Chen, balbi; +Cc: linux-usb, linux-imx, gregkh

Hello!

On 31.01.2020 5:03, Peter Chen wrote:

> For work properly on every architectures and compilers, the enum value

    "For working properly"? Or maybe "to work properly"?

> needs to be specific numbers.
> 
> Suggested-by: Greg KH <gregkh@linuxfoundation.org>
> Signed-off-by: Peter Chen <peter.chen@nxp.com>
[...]

MBR, Sergei

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-01-31  8:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-31  2:03 [PATCH 1/1] usb: charger: assign specific number for enum value Peter Chen
2020-01-31  8:55 ` Sergei Shtylyov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).