All of lore.kernel.org
 help / color / mirror / Atom feed
From: techping.chan at gmail.com <techping.chan@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/6] cmd: led: rename command enum value
Date: Mon, 27 Mar 2017 22:38:40 +0800	[thread overview]
Message-ID: <1490625523-11594-3-git-send-email-techping.chan@gmail.com> (raw)
In-Reply-To: <1490625523-11594-1-git-send-email-techping.chan@gmail.com>

From: Ziping Chen <techping.chan@gmail.com>

The "LED_OFF" constant conflicts with the constant with the same name in
include/linux/compat.h.

Rename all command constants' name prefix from LED_ to LED_CMD_.

Signed-off-by: Ziping Chen <techping.chan@gmail.com>
---
 cmd/led.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/cmd/led.c b/cmd/led.c
index 951a5e2..ef0ab1a 100644
--- a/cmd/led.c
+++ b/cmd/led.c
@@ -62,18 +62,18 @@ static const led_tbl_t led_commands[] = {
 	{ NULL, 0, NULL, NULL, NULL }
 };
 
-enum led_cmd { LED_ON, LED_OFF, LED_TOGGLE, LED_BLINK };
+enum led_cmd { LED_CMD_ON, LED_CMD_OFF, LED_CMD_TOGGLE, LED_CMD_BLINK };
 
 enum led_cmd get_led_cmd(char *var)
 {
 	if (strcmp(var, "off") == 0)
-		return LED_OFF;
+		return LED_CMD_OFF;
 	if (strcmp(var, "on") == 0)
-		return LED_ON;
+		return LED_CMD_ON;
 	if (strcmp(var, "toggle") == 0)
-		return LED_TOGGLE;
+		return LED_CMD_TOGGLE;
 	if (strcmp(var, "blink") == 0)
-		return LED_BLINK;
+		return LED_CMD_BLINK;
 
 	return -1;
 }
@@ -106,27 +106,27 @@ int do_led (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 		    (strcmp(led_commands[i].string, argv[1]) == 0)) {
 			match = 1;
 			switch (cmd) {
-			case LED_ON:
+			case LED_CMD_ON:
 				if (led_commands[i].on)
 					led_commands[i].on();
 				else
 					__led_set(led_commands[i].mask,
 							  CONFIG_LED_STATUS_ON);
 				break;
-			case LED_OFF:
+			case LED_CMD_OFF:
 				if (led_commands[i].off)
 					led_commands[i].off();
 				else
 					__led_set(led_commands[i].mask,
 						  CONFIG_LED_STATUS_OFF);
 				break;
-			case LED_TOGGLE:
+			case LED_CMD_TOGGLE:
 				if (led_commands[i].toggle)
 					led_commands[i].toggle();
 				else
 					__led_toggle(led_commands[i].mask);
 				break;
-			case LED_BLINK:
+			case LED_CMD_BLINK:
 				if (argc != 4)
 					return CMD_RET_USAGE;
 
-- 
2.7.4

  parent reply	other threads:[~2017-03-27 14:38 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-27 14:38 [U-Boot] [PATCH 1/6] led: add get_status support for DM LED support techping.chan at gmail.com
2017-03-27 14:38 ` [U-Boot] [PATCH 2/6] led: gpio: add support for get_status function techping.chan at gmail.com
2017-04-01  4:23   ` Simon Glass
2017-03-27 14:38 ` techping.chan at gmail.com [this message]
2017-04-01  4:22   ` [U-Boot] [PATCH 3/6] cmd: led: rename command enum value Simon Glass
2017-03-27 14:38 ` [U-Boot] [PATCH 4/6] cmd: led: add enum led_cmd member to support error code return techping.chan at gmail.com
2017-04-01  4:22   ` Simon Glass
2017-03-27 14:38 ` [U-Boot] [PATCH 5/6] cmd: led: add DM-based implementation techping.chan at gmail.com
2017-04-01  4:22   ` Simon Glass
2017-04-05 13:24     ` Ziping Chen
2017-04-09 19:27       ` Simon Glass
2017-04-10 15:06         ` Ziping Chen
2017-04-10 17:35           ` Simon Glass
2017-03-27 14:38 ` [U-Boot] [PATCH 6/6] cmd: led: add command led list techping.chan at gmail.com
2017-04-01  4:23 ` [U-Boot] [PATCH 1/6] led: add get_status support for DM LED support Simon Glass
2017-04-05 13:20   ` Ziping Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1490625523-11594-3-git-send-email-techping.chan@gmail.com \
    --to=techping.chan@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.