[U-Boot] [PATCH 4/7] dfu: MMC specific routines for DFU operation

Mike Frysinger
2012-07-20T04:25:47Z

On Tuesday 03 July 2012 20:13:37 Marek Vasut wrote:
> Dear Tom Rini,
> > On Wed, Jul 04, 2012 at 12:31:14AM +0200, Marek Vasut wrote:
> > > Dear Tom Rini,
> > > > > > > > + debug("%s: %s 0x%p\n", __func__, cmd_buf, cmd_buf);
> > > > > > > > + run_command(cmd_buf, 0);
> > > > > > >
> > > > > > > Holy Moly ... can we not make this into simple calls to those
> > > > > > > subsystems ? Instead invoking command is crazy ;-)
> > > > > >
> > > > > > Are they really simple? There's a few other places we do this,
> > > > > > and so long as it's documented that DFU depends on
> > > > > > CONFIG_FAT_WRITE for writing to fat and so forth.
> > > > >
> > > > > Well ain't it easier to call fat_write() or similar?
> > > >
> > > > Assuming that most of the logic in do_fat_fswrite is needed, no. And
> > > > I think a good portion of it is, at first glance at least.
> > >
> > > Abstracting it out into a function won't cut it?
> >
> > My inclination would be to say that seems a bit sillier than just using
> > run_command(...) to call the existing command.
>
> Whose's syntax will likely soon change, breaking all this :-(

and would be pretty much impossible to detect at compile time. extending the
API for code to call is the right answer ... abusing the shell at runtime from
other code should be an absolute last resort.
-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/20120720/d37ea667/attachment.pgp>