From caea4d85607bfdac8df7cf18825915f37232f104 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sat, 7 Dec 2024 10:23:57 -0700 Subject: bootstd: Avoid sprintf() in SPL when creating bootdevs The name of the bootdev device is not that important, particular in SPL. Save a little code space by using a simpler name. Signed-off-by: Simon Glass --- boot/bootdev-uclass.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'boot/bootdev-uclass.c') diff --git a/boot/bootdev-uclass.c b/boot/bootdev-uclass.c index 64ec4fde493..2e61c853142 100644 --- a/boot/bootdev-uclass.c +++ b/boot/bootdev-uclass.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -278,8 +279,13 @@ int bootdev_setup_for_sibling_blk(struct udevice *blk, const char *drv_name) int ret, len; len = bootdev_get_suffix_start(blk, ".blk"); - snprintf(dev_name, sizeof(dev_name), "%.*s.%s", len, blk->name, - "bootdev"); + if (xpl_phase() < PHASE_BOARD_R) { + strlcpy(dev_name, blk->name, sizeof(dev_name) - 5); + strcat(dev_name, ".sib"); + } else { + snprintf(dev_name, sizeof(dev_name), "%.*s.%s", len, blk->name, + "bootdev"); + } parent = dev_get_parent(blk); ret = device_find_child_by_name(parent, dev_name, &dev); -- cgit v1.2.3 From a33185173dce550d6ecb96b7fa625bb5e2183d66 Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Thu, 12 Dec 2024 21:07:26 -0600 Subject: Revert "Merge patch series "vbe: Series part E"" This reverts commit 1fdf53ace13f745fe8ad4d2d4e79eed98088d555, reversing changes made to e5aef1bbf11412eebd4c242b46adff5301353c30. I had missed that this caused too much size growth on rcar3_salvator-x. Signed-off-by: Tom Rini --- boot/bootdev-uclass.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'boot/bootdev-uclass.c') diff --git a/boot/bootdev-uclass.c b/boot/bootdev-uclass.c index 2e61c853142..64ec4fde493 100644 --- a/boot/bootdev-uclass.c +++ b/boot/bootdev-uclass.c @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include @@ -279,13 +278,8 @@ int bootdev_setup_for_sibling_blk(struct udevice *blk, const char *drv_name) int ret, len; len = bootdev_get_suffix_start(blk, ".blk"); - if (xpl_phase() < PHASE_BOARD_R) { - strlcpy(dev_name, blk->name, sizeof(dev_name) - 5); - strcat(dev_name, ".sib"); - } else { - snprintf(dev_name, sizeof(dev_name), "%.*s.%s", len, blk->name, - "bootdev"); - } + snprintf(dev_name, sizeof(dev_name), "%.*s.%s", len, blk->name, + "bootdev"); parent = dev_get_parent(blk); ret = device_find_child_by_name(parent, dev_name, &dev); -- cgit v1.2.3 From 19574e35f46ce2b24fd5f9cacb09260226d1b9f5 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 19 Dec 2024 11:28:52 -0700 Subject: bootstd: Avoid sprintf() in SPL when creating bootdevs The name of the bootdev device is not that important, particular in SPL. Save a little code space by using a simpler name. Signed-off-by: Simon Glass --- boot/bootdev-uclass.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'boot/bootdev-uclass.c') diff --git a/boot/bootdev-uclass.c b/boot/bootdev-uclass.c index 64ec4fde493..2e61c853142 100644 --- a/boot/bootdev-uclass.c +++ b/boot/bootdev-uclass.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -278,8 +279,13 @@ int bootdev_setup_for_sibling_blk(struct udevice *blk, const char *drv_name) int ret, len; len = bootdev_get_suffix_start(blk, ".blk"); - snprintf(dev_name, sizeof(dev_name), "%.*s.%s", len, blk->name, - "bootdev"); + if (xpl_phase() < PHASE_BOARD_R) { + strlcpy(dev_name, blk->name, sizeof(dev_name) - 5); + strcat(dev_name, ".sib"); + } else { + snprintf(dev_name, sizeof(dev_name), "%.*s.%s", len, blk->name, + "bootdev"); + } parent = dev_get_parent(blk); ret = device_find_child_by_name(parent, dev_name, &dev); -- cgit v1.2.3