Re: [U-Boot] [PATCH v3] cmd_nvedit.c: clean up with checkpatch

2011-04-30 Thread Wolfgang Denk
Dear Macpaul Lin,

In message <1303870605-31401-1-git-send-email-macp...@andestech.com> you wrote:
> Code clean up of cmd_nvedit.c by using checkpatch.pl.
> 
> Signed-off-by: Macpaul Lin 
> ---
> Changes for v2:
>   - Replace the ident characters for #ifdef from space to tab.
> Changes for v3:
>   - fix for commit 31e41398, "Fix typo in #error: IS_IN_NOWHERE vs. 
> IS_NOWHERE"
> 
>  common/cmd_nvedit.c |  148 
> +--
>  1 files changed, 73 insertions(+), 75 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
It took him several minutes to understand any new idea  put  to  him,
and  this is a very valuable trait in a leader, because anything any-
one is still trying to explain to you after two minutes  is  probably
important  and anything they give up after a mere minute or so is al-
most certainly something they shouldn't have been bothering you  with
in the first place.   - Terry Pratchett, _Reaper Man_
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3] cmd_nvedit.c: clean up with checkpatch

2011-04-27 Thread Macpaul Lin
Hi Detlve,

2011/4/27 Detlev Zundel :
> Hi,
>
> For the next time, we should follow the (newly added) clause in our
> wiki[1] and have a ommit text like "cosmetic: code cleanup of
> cmd_nvedit.c using checkpatch.pl".

Thanks for your note when we have sometimes didn't follow the new
discuccssed things because other reasons. :)

> As this is very new, I won't insists, so
>
> Acked-by: Detlev Zundel 
>

Thanks a lot. I'll remember the new rules. Have a nice week-end.

-- 
Best regards,
Macpaul Lin
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3] cmd_nvedit.c: clean up with checkpatch

2011-04-27 Thread Detlev Zundel
Hi,

> Code clean up of cmd_nvedit.c by using checkpatch.pl.
>
> Signed-off-by: Macpaul Lin 

Visual inspection shows only cosmetic changes, so the patch looks good.

For the next time, we should follow the (newly added) clause in our
wiki[1] and have a ommit text like "cosmetic: code cleanup of
cmd_nvedit.c using checkpatch.pl".

As this is very new, I won't insists, so

Acked-by: Detlev Zundel 

Thanks!
  Detlev

-- 
Q: Does that mean we also shouldn't be using IRQF_SAMPLE_RANDOM on
   interrupt [sources]?
A: Yes. The flag needs to be taken out and shot.
-- Matt Mackall <1239116251.14392.133.camel@calx>
--
DENX Software Engineering GmbH,  MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3] cmd_nvedit.c: clean up with checkpatch

2011-04-26 Thread Macpaul Lin
Code clean up of cmd_nvedit.c by using checkpatch.pl.

Signed-off-by: Macpaul Lin 
---
Changes for v2:
  - Replace the ident characters for #ifdef from space to tab.
Changes for v3:
  - fix for commit 31e41398, "Fix typo in #error: IS_IN_NOWHERE vs. IS_NOWHERE"

 common/cmd_nvedit.c |  148 +--
 1 files changed, 73 insertions(+), 75 deletions(-)

diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index df0e6db..c45af56 100644
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -54,16 +54,16 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#if !defined(CONFIG_ENV_IS_IN_EEPROM)  && \
-!defined(CONFIG_ENV_IS_IN_FLASH)   && \
-!defined(CONFIG_ENV_IS_IN_DATAFLASH)   && \
-!defined(CONFIG_ENV_IS_IN_MG_DISK) && \
-!defined(CONFIG_ENV_IS_IN_MMC)  && \
-!defined(CONFIG_ENV_IS_IN_NAND)&& \
-!defined(CONFIG_ENV_IS_IN_NVRAM)   && \
-!defined(CONFIG_ENV_IS_IN_ONENAND) && \
-!defined(CONFIG_ENV_IS_IN_SPI_FLASH)   && \
-!defined(CONFIG_ENV_IS_NOWHERE)
+#if!defined(CONFIG_ENV_IS_IN_EEPROM)   && \
+   !defined(CONFIG_ENV_IS_IN_FLASH)&& \
+   !defined(CONFIG_ENV_IS_IN_DATAFLASH)&& \
+   !defined(CONFIG_ENV_IS_IN_MG_DISK)  && \
+   !defined(CONFIG_ENV_IS_IN_MMC)  && \
+   !defined(CONFIG_ENV_IS_IN_NAND) && \
+   !defined(CONFIG_ENV_IS_IN_NVRAM)&& \
+   !defined(CONFIG_ENV_IS_IN_ONENAND)  && \
+   !defined(CONFIG_ENV_IS_IN_SPI_FLASH)&& \
+   !defined(CONFIG_ENV_IS_NOWHERE)
 # error Define one of CONFIG_ENV_IS_IN_{EEPROM|FLASH|DATAFLASH|ONENAND|\
 SPI_FLASH|MG_DISK|NVRAM|MMC} or CONFIG_ENV_IS_NOWHERE
 #endif
@@ -93,7 +93,7 @@ static const unsigned long baudrate_table[] = 
CONFIG_SYS_BAUDRATE_TABLE;
  */
 static int env_id = 1;
 
-int get_env_id (void)
+int get_env_id(void)
 {
return env_id;
 }
@@ -116,7 +116,7 @@ static int env_print(char *name)
hsearch_r(e, FIND, &ep, &env_htab);
if (ep == NULL)
return 0;
-   len = printf ("%s=%s\n", ep->key, ep->data);
+   len = printf("%s=%s\n", ep->key, ep->data);
return len;
}
 
@@ -176,7 +176,7 @@ int _do_env_set (int flag, int argc, char * const argv[])
name = argv[1];
 
if (strchr(name, '=')) {
-   printf ("## Error: illegal character '=' in variable name 
\"%s\"\n", name);
+   printf("## Error: illegal character '=' in variable name 
\"%s\"\n", name);
return 1;
}
 
@@ -189,13 +189,12 @@ int _do_env_set (int flag, int argc, char * const argv[])
hsearch_r(e, FIND, &ep, &env_htab);
 
/* Check for console redirection */
-   if (strcmp(name,"stdin") == 0) {
+   if (strcmp(name, "stdin") == 0)
console = stdin;
-   } else if (strcmp(name,"stdout") == 0) {
+   else if (strcmp(name, "stdout") == 0)
console = stdout;
-   } else if (strcmp(name,"stderr") == 0) {
+   else if (strcmp(name, "stderr") == 0)
console = stderr;
-   }
 
if (console != -1) {
if (argc < 3) { /* Cannot delete it! */
@@ -209,11 +208,11 @@ int _do_env_set (int flag, int argc, char * const argv[])
return i;
 #else
/* Try assigning specified device */
-   if (console_assign (console, argv[2]) < 0)
+   if (console_assign(console, argv[2]) < 0)
return 1;
 
 #ifdef CONFIG_SERIAL_MULTI
-   if (serial_assign (argv[2]) < 0)
+   if (serial_assign(argv[2]) < 0)
return 1;
 #endif
 #endif /* CONFIG_CONSOLE_MUX */
@@ -225,28 +224,28 @@ int _do_env_set (int flag, int argc, char * const argv[])
 */
if (ep) {   /* variable exists */
 #ifndef CONFIG_ENV_OVERWRITE
-   if ((strcmp (name, "serial#") == 0) ||
-   ((strcmp (name, "ethaddr") == 0)
+   if ((strcmp(name, "serial#") == 0) ||
+   ((strcmp(name, "ethaddr") == 0)
 #if defined(CONFIG_OVERWRITE_ETHADDR_ONCE) && defined(CONFIG_ETHADDR)
-&& (strcmp (ep->data,MK_STR(CONFIG_ETHADDR)) != 0)
+&& (strcmp(ep->data, MK_STR(CONFIG_ETHADDR)) != 0)
 #endif /* CONFIG_OVERWRITE_ETHADDR_ONCE && CONFIG_ETHADDR */
) ) {
-   printf ("Can't overwrite \"%s\"\n", name);
+   printf("Can't overwrite \"%s\"\n", name);
return 1;
}
 #endif
/*
 * Switch to new baudrate if new baudrate is supported
 */
-   if (strcmp(name,"baudrate") == 0) {
+   if (strcmp(name, "baudrate") == 0) {
int baudrate = simple_strtoul(argv[2], NULL, 10);
int i;
-   for (i=0; ibd-