[U-Boot] common/cmd_disk.c doesn't actually define any "commands"

Albert ARIBAUD albert.u.boot at aribaud.net
Mon Feb 4 16:18:01 CET 2013


Hi Robert,

On Mon, 04 Feb 2013 10:04:20 -0500, "Robert P. J. Day"
<rpjday at crashcourse.ca> wrote:

> Quoting Albert ARIBAUD <albert.u.boot at aribaud.net>:
> 
> > Hi Robert,
> >
> > On Mon, 04 Feb 2013 07:53:43 -0500, "Robert P. J. Day"
> > <rpjday at crashcourse.ca> wrote:
> >
> >>    another observation from my weekend perusal of all of the
> >> common/cmd_*.c files is that, despite its "cmd_" filename prefix, the
> >> source file cmd_disk.c doesn't define any actual u-boot commands.
> >> according to what i see as u-boot filename naming conventions, it
> >> shouldn't be named "cmd_*", should it?
> >
> > That's arguable: apparently it provides common_diskboot() which
> > implements commands for cmd_ide, cmd_scsi, cmd_usb which use it for
> > implementing their do_diskboot, du_scsiboot, do_usbboot commands
> > respectively. It's purely related to cmd_*.
> 
>    just to be clear, i have no strong opinion on this either way, but
> my understanding is that source files with the name of "common/cmd_*.c"
> typically define at least one u-boot "command" with the U_BOOT_CMD macro.
> as far as i can tell, cmd_disk.c is the only counterexample of that.
> 
>    it may be true that that file provides utility routines for other
> actual "commmand" files, but so do many others.  for example, cmd_fdt.c
> defines the behaviour of the actual "fdt" command, while fdt-related
> utility routines are in fdt_support.c or even in libfdt/.

That's understandable as libfdt provides support for much more than
commands; OTOH, cmd_disk provides support *only* to commands.

>    it's no big deal, i'm just pointing out that cmd_disk.c flies in the
> face of a fairly obvious pattern in u-boot filenaming convention.  and
> on that note, i will shut up about it. :-)
> 
> rday

Amicalement,
-- 
Albert.


More information about the U-Boot mailing list