Furquan Shaikh has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/32289
Change subject: util/sconfig: Throw an error if override tree has no devices ......................................................................
util/sconfig: Throw an error if override tree has no devices
If override tree does not have any device, then the chip info structure in it cannot be associated with the correct device and ends up being added as a standalone chip info structure without any device actually using it. This change prevents this condition by throwing an error during compilation.
BUG=b:130342895
Change-Id: I7b8bb6b3228030a465976ca32ce8ef63f41365dd Signed-off-by: Furquan Shaikh furquan@google.com --- M util/sconfig/main.c 1 file changed, 5 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/89/32289/1
diff --git a/util/sconfig/main.c b/util/sconfig/main.c index 4ac935e..5382f47 100644 --- a/util/sconfig/main.c +++ b/util/sconfig/main.c @@ -1316,6 +1316,11 @@ override_devtree = argv[OVERRIDE_DEVICEFILE_ARG]; parse_devicetree(override_devtree, &override_root_bus);
+ if (!dev_has_children(&override_root_dev)) { + fprintf(stderr, "ERROR: Override tree needs at least one device!\n"); + exit(1); + } + override_devicetree(&base_root_bus, &override_root_bus); }
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32289 )
Change subject: util/sconfig: Throw an error if override tree has no devices ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/#/c/32289/1/util/sconfig/main.c File util/sconfig/main.c:
https://review.coreboot.org/#/c/32289/1/util/sconfig/main.c@1320 PS1, Line 1320: fprintf(stderr, "ERROR: Override tree needs at least one device!\n"); line over 80 characters
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32289 )
Change subject: util/sconfig: Throw an error if override tree has no devices ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/#/c/32289/2/util/sconfig/main.c File util/sconfig/main.c:
https://review.coreboot.org/#/c/32289/2/util/sconfig/main.c@1320 PS2, Line 1320: fprintf(stderr, "ERROR: Override tree needs at least one device!\n"); line over 80 characters
Aaron Durbin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32289 )
Change subject: util/sconfig: Throw an error if override tree has no devices ......................................................................
Patch Set 2: Code-Review+2
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32289 )
Change subject: util/sconfig: Throw an error if override tree has no devices ......................................................................
Patch Set 3:
(1 comment)
https://review.coreboot.org/#/c/32289/3/util/sconfig/main.c File util/sconfig/main.c:
https://review.coreboot.org/#/c/32289/3/util/sconfig/main.c@1320 PS3, Line 1320: fprintf(stderr, "ERROR: Override tree needs at least one device!\n"); line over 80 characters
Hello Aaron Durbin, Shelley Chen, build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/32289
to look at the new patch set (#4).
Change subject: util/sconfig: Throw an error if override tree has no devices ......................................................................
util/sconfig: Throw an error if override tree has no devices
If override tree does not have any device, then the chip info structure in it cannot be associated with the correct device and ends up being added as a standalone chip info structure without any device actually using it. This change prevents this condition by throwing an error during compilation.
BUG=b:130342895
Change-Id: I7b8bb6b3228030a465976ca32ce8ef63f41365dd Signed-off-by: Furquan Shaikh furquan@google.com --- M util/sconfig/main.c 1 file changed, 5 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/89/32289/4
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32289 )
Change subject: util/sconfig: Throw an error if override tree has no devices ......................................................................
Patch Set 4:
(1 comment)
https://review.coreboot.org/#/c/32289/4/util/sconfig/main.c File util/sconfig/main.c:
https://review.coreboot.org/#/c/32289/4/util/sconfig/main.c@1320 PS4, Line 1320: fprintf(stderr, "ERROR: Override tree needs at least one device!\n"); line over 80 characters
Duncan Laurie has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32289 )
Change subject: util/sconfig: Throw an error if override tree has no devices ......................................................................
Patch Set 4: Code-Review+2
Furquan Shaikh has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/32289 )
Change subject: util/sconfig: Throw an error if override tree has no devices ......................................................................
util/sconfig: Throw an error if override tree has no devices
If override tree does not have any device, then the chip info structure in it cannot be associated with the correct device and ends up being added as a standalone chip info structure without any device actually using it. This change prevents this condition by throwing an error during compilation.
BUG=b:130342895
Change-Id: I7b8bb6b3228030a465976ca32ce8ef63f41365dd Signed-off-by: Furquan Shaikh furquan@google.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/32289 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Duncan Laurie dlaurie@chromium.org Reviewed-by: Aaron Durbin adurbin@chromium.org --- M util/sconfig/main.c 1 file changed, 5 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Duncan Laurie: Looks good to me, approved Aaron Durbin: Looks good to me, approved
diff --git a/util/sconfig/main.c b/util/sconfig/main.c index 4ac935e..5382f47 100644 --- a/util/sconfig/main.c +++ b/util/sconfig/main.c @@ -1316,6 +1316,11 @@ override_devtree = argv[OVERRIDE_DEVICEFILE_ARG]; parse_devicetree(override_devtree, &override_root_bus);
+ if (!dev_has_children(&override_root_dev)) { + fprintf(stderr, "ERROR: Override tree needs at least one device!\n"); + exit(1); + } + override_devicetree(&base_root_bus, &override_root_bus); }