Nico Huber has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/30673
Change subject: util/ifdtool: Fix regions_collide() check ......................................................................
util/ifdtool: Fix regions_collide() check
The old version was unnecessarily complex and allowed one region to include the other.
Change-Id: Ibf7faf8103c8945b82c3962b5a7b82c3288b871f Signed-off-by: Nico Huber nico.h@gmx.de --- M util/ifdtool/ifdtool.c 1 file changed, 2 insertions(+), 5 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/73/30673/1
diff --git a/util/ifdtool/ifdtool.c b/util/ifdtool/ifdtool.c index ccd27d0..69cd2a9 100644 --- a/util/ifdtool/ifdtool.c +++ b/util/ifdtool/ifdtool.c @@ -1153,11 +1153,8 @@ if ((r1->size == 0) || (r2->size == 0)) return 0;
- if ( ((r1->base >= r2->base) && (r1->base <= r2->limit)) || - ((r1->limit >= r2->base) && (r1->limit <= r2->limit)) ) - return 1; - - return 0; + /* r1 should be either completely below or completely above r2 */ + return !(r1->limit < r2->base || r1->base > r2->limit); }
void new_layout(const char *filename, char *image, int size,