Patchwork [U-Boot] nand: fix nand read.option parsing

login
register
mail settings
Submitter Harvey Chapman
Date Feb. 7, 2013, 9:34 p.m.
Message ID <1BA68F92-E41B-4875-887D-3757E2708C6A@3gfp.com>
Download mbox | patch
Permalink /patch/219019/
State Accepted
Delegated to: Scott Wood
Headers show

Comments

Harvey Chapman - Feb. 7, 2013, 9:34 p.m.
"nand read.part addr off size" would be treated as "nand read.raw addr off 1"
It now fails as intended stating "Unknown nand command suffix '.part'"

Signed-off-by: Harvey Chapman <hchapman@3gfp.com>
---
 common/cmd_nand.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Scott Wood - Feb. 23, 2013, 12:52 a.m.
On Thu, Feb 07, 2013 at 11:34:44AM -0000, Harvey Chapman wrote:
> "nand read.part addr off size" would be treated as "nand read.raw addr off 1"
> It now fails as intended stating "Unknown nand command suffix '.part'"
> 
> Signed-off-by: Harvey Chapman <hchapman@3gfp.com>
> 
> ---
> common/cmd_nand.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/common/cmd_nand.c b/common/cmd_nand.c
> index 1568594..495610c 100644
> --- a/common/cmd_nand.c
> +++ b/common/cmd_nand.c
> @@ -608,7 +608,7 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
>                 size_t rwsize;
>                 ulong pagecount = 1;
>                 int read;
> -               int raw;
> +               int raw = 0;
>  
>                 if (argc < 4)
>                         goto usage;

This patch is whitespace mangled.  Applied manually to u-boot-nand-flash,
but next time please make sure your mailer does not alter the patch at
all (consider using git send-email).

-Scott

Patch

diff --git a/common/cmd_nand.c b/common/cmd_nand.c
index 1568594..495610c 100644
--- a/common/cmd_nand.c
+++ b/common/cmd_nand.c
@@ -608,7 +608,7 @@  static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                size_t rwsize;
                ulong pagecount = 1;
                int read;
-               int raw;
+               int raw = 0;
 
                if (argc < 4)
                        goto usage;