* [U-Boot] should print_mmc_devices() not add an extraneous blank between devices?
@ 2013-08-20 20:46 Robert P. J. Day
2013-08-21 6:34 ` Lubomir Popov
0 siblings, 1 reply; 2+ messages in thread
From: Robert P. J. Day @ 2013-08-20 20:46 UTC (permalink / raw)
To: u-boot
playing on my beaglebone black and:
U-Boot# mmc list
OMAP SD/MMC: 0
OMAP SD/MMC: 1 <-- ???
U-Boot#
puzzled as to why the second line is indented, and discovered, first
from cmd_mmc.c:
print_mmc_devices('\n');
which reasonably defines a newline as a separator, but then there's
this in drivers/mmc/mmc.c:
list_for_each(entry, &mmc_devices) {
m = list_entry(entry, struct mmc, link);
printf("%s: %d", m->name, m->block_dev.dev);
if (entry->next != &mmc_devices)
printf("%c ", separator);
}
where that loop inserts the separator *and* a blank. is that
deliberate? it just looks weird.
rday
--
========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca
Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
========================================================================
^ permalink raw reply [flat|nested] 2+ messages in thread
* [U-Boot] should print_mmc_devices() not add an extraneous blank between devices?
2013-08-20 20:46 [U-Boot] should print_mmc_devices() not add an extraneous blank between devices? Robert P. J. Day
@ 2013-08-21 6:34 ` Lubomir Popov
0 siblings, 0 replies; 2+ messages in thread
From: Lubomir Popov @ 2013-08-21 6:34 UTC (permalink / raw)
To: u-boot
Hi Robert,
On 20/08/13 23:46, Robert P. J. Day wrote:
>
> playing on my beaglebone black and:
>
> U-Boot# mmc list
> OMAP SD/MMC: 0
> OMAP SD/MMC: 1 <-- ???
> U-Boot#
>
> puzzled as to why the second line is indented, and discovered, first
> from cmd_mmc.c:
>
> print_mmc_devices('\n');
>
> which reasonably defines a newline as a separator, but then there's
> this in drivers/mmc/mmc.c:
>
> list_for_each(entry, &mmc_devices) {
> m = list_entry(entry, struct mmc, link);
>
> printf("%s: %d", m->name, m->block_dev.dev);
>
> if (entry->next != &mmc_devices)
> printf("%c ", separator);
> }
>
> where that loop inserts the separator *and* a blank. is that
> deliberate? it just looks weird.
>
I have used to fix this as follows on some older U-Boot versions:
if (entry->next != &mmc_devices) {
printf("%c", separator);
if (separator != '\n')
puts (" ");
}
But as this is just cosmetics, never bothered to submit a patch, nor
am fixing it anymore locally. If you are a style perfectionist, do
submit one... ;)
Best regards,
Lubomir
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-08-21 6:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-20 20:46 [U-Boot] should print_mmc_devices() not add an extraneous blank between devices? Robert P. J. Day
2013-08-21 6:34 ` Lubomir Popov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox