Dne Ne 13. prosince 2009 06:36:47 David Brownell napsal(a):
> On Saturday 12 December 2009, Marek Vasut wrote:
> > > Also, can you restructure it so that you don't just add a bit
> > > "if (there's a custom erase_page) { ... }"? That's the sort
> > > of thing which is easier to just require.
> >
> > Require? Why? No other driver probably needs it/will find it useful.
>
> To streamline and simplify the primary code paths. It's better to
>
> ptr->op(...)
>
> than to
>
> if (ptr->op)
> ptr->op(...);
> else
> inlined default version ptr->op();
>
> Admittedly this is one of the ways the current source is less
> clean than it should be. But that's not a reason to perpetuate
> such practices.
>
> - Dave
>
> > > Either provide the
> > > current logic in a separate routine that gets patched into the
> > > ops vector of any driver that doesn't have it, or ...
>
We can do so in one go in a separate patch if you want to do this kind of
cleanup. That'd be cleaner solution.
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development