All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] NAND: Have nboot accept .e and .i as legacy no-ops.
@ 2009-03-17 17:10 Scott Wood
  2009-03-17 17:49 ` Mike Frysinger
  0 siblings, 1 reply; 4+ messages in thread
From: Scott Wood @ 2009-03-17 17:10 UTC (permalink / raw)
  To: u-boot

This was intended to happen before, but a trivial bug prevented it.

Signed-off-by: Scott Wood <scottwood@freescale.com>
---
Applied to u-boot-nand-flash.

 common/cmd_nand.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/common/cmd_nand.c b/common/cmd_nand.c
index f915fb6..e6623ca 100644
--- a/common/cmd_nand.c
+++ b/common/cmd_nand.c
@@ -502,7 +502,7 @@ static int nand_load_image(cmd_tbl_t *cmdtp, nand_info_t *nand,
 
 	s = strchr(cmd, '.');
 	if (s != NULL &&
-	    (strcmp(s, ".jffs2") && !strcmp(s, ".e") && !strcmp(s, ".i"))) {
+	    (strcmp(s, ".jffs2") && strcmp(s, ".e") && strcmp(s, ".i"))) {
 		printf("Unknown nand load suffix '%s'\n", s);
 		show_boot_progress(-53);
 		return 1;
-- 
1.5.3

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

* [U-Boot] [PATCH] NAND: Have nboot accept .e and .i as legacy no-ops.
  2009-03-17 17:10 [U-Boot] [PATCH] NAND: Have nboot accept .e and .i as legacy no-ops Scott Wood
@ 2009-03-17 17:49 ` Mike Frysinger
  2009-03-17 17:55   ` Scott Wood
  0 siblings, 1 reply; 4+ messages in thread
From: Mike Frysinger @ 2009-03-17 17:49 UTC (permalink / raw)
  To: u-boot

On Tuesday 17 March 2009 13:10:15 Scott Wood wrote:
> --- a/common/cmd_nand.c
> +++ b/common/cmd_nand.c
> @@ -502,7 +502,7 @@ static int nand_load_image(cmd_tbl_t *cmdtp,
> nand_info_t *nand,
>
>  	s = strchr(cmd, '.');
>  	if (s != NULL &&
> -	    (strcmp(s, ".jffs2") && !strcmp(s, ".e") && !strcmp(s, ".i"))) {
> +	    (strcmp(s, ".jffs2") && strcmp(s, ".e") && strcmp(s, ".i"))) {

unrelated to the bug in question, but perhaps better written like:
if (s++ != NULL &&
    (strcmp(s, "jffs2") && strcmp(s, "e") && strcmp(s, "i"))) {
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090317/ae08507d/attachment-0001.pgp 

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

* [U-Boot] [PATCH] NAND: Have nboot accept .e and .i as legacy no-ops.
  2009-03-17 17:49 ` Mike Frysinger
@ 2009-03-17 17:55   ` Scott Wood
  2009-03-17 18:09     ` Mike Frysinger
  0 siblings, 1 reply; 4+ messages in thread
From: Scott Wood @ 2009-03-17 17:55 UTC (permalink / raw)
  To: u-boot

On Tue, Mar 17, 2009 at 01:49:20PM -0400, Mike Frysinger wrote:
> On Tuesday 17 March 2009 13:10:15 Scott Wood wrote:
> > --- a/common/cmd_nand.c
> > +++ b/common/cmd_nand.c
> > @@ -502,7 +502,7 @@ static int nand_load_image(cmd_tbl_t *cmdtp,
> > nand_info_t *nand,
> >
> >  	s = strchr(cmd, '.');
> >  	if (s != NULL &&
> > -	    (strcmp(s, ".jffs2") && !strcmp(s, ".e") && !strcmp(s, ".i"))) {
> > +	    (strcmp(s, ".jffs2") && strcmp(s, ".e") && strcmp(s, ".i"))) {
> 
> unrelated to the bug in question, but perhaps better written like:
> if (s++ != NULL &&
>     (strcmp(s, "jffs2") && strcmp(s, "e") && strcmp(s, "i"))) {

That'd make s non-NULL and invalid, if it started out as NULL.  Even if s
is not referenced again, it's not a nice thing to leave lurking in the
code.

-Scott

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

* [U-Boot] [PATCH] NAND: Have nboot accept .e and .i as legacy no-ops.
  2009-03-17 17:55   ` Scott Wood
@ 2009-03-17 18:09     ` Mike Frysinger
  0 siblings, 0 replies; 4+ messages in thread
From: Mike Frysinger @ 2009-03-17 18:09 UTC (permalink / raw)
  To: u-boot

On Tuesday 17 March 2009 13:55:18 Scott Wood wrote:
> On Tue, Mar 17, 2009 at 01:49:20PM -0400, Mike Frysinger wrote:
> > On Tuesday 17 March 2009 13:10:15 Scott Wood wrote:
> > > --- a/common/cmd_nand.c
> > > +++ b/common/cmd_nand.c
> > > @@ -502,7 +502,7 @@ static int nand_load_image(cmd_tbl_t *cmdtp,
> > > nand_info_t *nand,
> > >
> > >  	s = strchr(cmd, '.');
> > >  	if (s != NULL &&
> > > -	    (strcmp(s, ".jffs2") && !strcmp(s, ".e") && !strcmp(s, ".i"))) {
> > > +	    (strcmp(s, ".jffs2") && strcmp(s, ".e") && strcmp(s, ".i"))) {
> >
> > unrelated to the bug in question, but perhaps better written like:
> > if (s++ != NULL &&
> >     (strcmp(s, "jffs2") && strcmp(s, "e") && strcmp(s, "i"))) {
>
> That'd make s non-NULL and invalid, if it started out as NULL.  Even if s
> is not referenced again, it's not a nice thing to leave lurking in the
> code.

i know it does, but since s isnt used again in the code in the NULL case, it 
doesnt matter.  but if you want to be pedantic, it's easy enough to split the 
operations.
if (s != NULL && ++s && ....
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090317/6f863368/attachment.pgp 

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

end of thread, other threads:[~2009-03-17 18:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-17 17:10 [U-Boot] [PATCH] NAND: Have nboot accept .e and .i as legacy no-ops Scott Wood
2009-03-17 17:49 ` Mike Frysinger
2009-03-17 17:55   ` Scott Wood
2009-03-17 18:09     ` Mike Frysinger

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.