[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250822060417.52935-1-alex.t.tran@gmail.com>
Date: Thu, 21 Aug 2025 23:04:17 -0700
From: Alex Tran <alex.t.tran@...il.com>
To: robh@...nel.org,
saravanak@...gle.com
Cc: devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org,
Alex Tran <alex.t.tran@...il.com>
Subject: [PATCH] scripts/dtc/flattree.c: stringtable_insert optimization
Increment string by string instead of character by character.
Signed-off-by: Alex Tran <alex.t.tran@...il.com>
---
scripts/dtc/flattree.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/scripts/dtc/flattree.c b/scripts/dtc/flattree.c
index 1bcd8089c5b9..156ca5da89b2 100644
--- a/scripts/dtc/flattree.c
+++ b/scripts/dtc/flattree.c
@@ -222,9 +222,7 @@ static int stringtable_insert(struct data *d, const char *str)
{
unsigned int i;
- /* FIXME: do this more efficiently? */
-
- for (i = 0; i < d->len; i++) {
+ for (i = 0; i < d->len; i += strlen(d->val + i) + 1) {
if (streq(str, d->val + i))
return i;
}
--
2.50.1
Powered by blists - more mailing lists