mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-21 06:31:31 +00:00
dm: core: Drop use of strlcpy()
We can use printf() to limit the string width. Adjust the code to do this instead of using strlcpy() which is a bit clumbsy. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
This commit is contained in:
parent
226b50bbd8
commit
a0f9acb08b
1 changed files with 2 additions and 4 deletions
|
@ -14,11 +14,9 @@ static void show_devices(struct udevice *dev, int depth, int last_flag)
|
||||||
{
|
{
|
||||||
int i, is_last;
|
int i, is_last;
|
||||||
struct udevice *child;
|
struct udevice *child;
|
||||||
char class_name[12];
|
|
||||||
|
|
||||||
/* print the first 11 characters to not break the tree-format. */
|
/* print the first 11 characters to not break the tree-format. */
|
||||||
strlcpy(class_name, dev->uclass->uc_drv->name, sizeof(class_name));
|
printf(" %-10.10s [ %c ] ", dev->uclass->uc_drv->name,
|
||||||
printf(" %-11s [ %c ] ", class_name,
|
|
||||||
dev->flags & DM_FLAG_ACTIVATED ? '+' : ' ');
|
dev->flags & DM_FLAG_ACTIVATED ? '+' : ' ');
|
||||||
|
|
||||||
for (i = depth; i >= 0; i--) {
|
for (i = depth; i >= 0; i--) {
|
||||||
|
@ -50,7 +48,7 @@ void dm_dump_all(void)
|
||||||
|
|
||||||
root = dm_root();
|
root = dm_root();
|
||||||
if (root) {
|
if (root) {
|
||||||
printf(" Class Probed Name\n");
|
printf(" Class Probed Name\n");
|
||||||
printf("----------------------------------------\n");
|
printf("----------------------------------------\n");
|
||||||
show_devices(root, -1, 0);
|
show_devices(root, -1, 0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue