On Fri, Nov 27, 2009 at 2:12 AM, David Brownell <[email protected]> wrote:

> On Monday 23 November 2009, Dean Glazeski wrote:
> > point.  The new play area is http://repo.or.cz/w/openocd/dnglaze.git.
>  I've
>
> I merged a few of these.  The page command refactoring:
>
> +       if (oob && NAND_CMD_READ0 && nand->page_size <= 512) {
> +               cmd = NAND_CMD_READOOB;
> +       }
>
> looks buggy for "&& NAND_CMD_READ0 && " ... and I'd drop the
> needless brackets.


You make a good point and I did think of that when I originally wrote this.
To tell you the truth, I'm not entirely certain how to do this better.  I
suppose the logic could be pulled back to before the function call, but the
logic is redundant as it would be placed before every read command function
call.  Would it be better to create a read version of the page command
function that has this logic?  I'm not sure.


>
> Later in that file nand_read_page_raw() reads
>
> +       uint8_t command = NAND_CMD_READ0;
> +       int retval;
> +
> +       retval = nand_page_command(nand, page, command, !data);
>
> where "command" as a variable looks needless.
>

Yeah, that's a remnant of me trying to do the above logic outside of the
function.  It is needless.  I've been backed up recently with some VLSI
layout, so we'll see if I can beat you to cleaning up some of the other
non-applied patches :).

// Dean Glazeski
_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to