summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2017-06-19 04:09:04 (GMT)
committerSimon Glass <sjg@chromium.org>2017-07-11 16:08:20 (GMT)
commit30107b08d7df87e4c92e413d92896a847f1c74dd (patch)
tree30ee6e85b2f5066d101ae90d3778d406a0bfa729 /tools
parentfa0ea5b09ead2b0fa17754c0bf99249533fd36a3 (diff)
downloadu-boot-fsl-qoriq-30107b08d7df87e4c92e413d92896a847f1c74dd.tar.xz
dtoc: Add a comment about string replace in conv_name_to_c()
This function uses several separate string replaces where a regular expression might seem more reasonable. Add a comment justifying the way it is currently done. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/dtoc/dtb_platdata.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/dtoc/dtb_platdata.py b/tools/dtoc/dtb_platdata.py
index 9923892..1f85343 100644
--- a/tools/dtoc/dtb_platdata.py
+++ b/tools/dtoc/dtb_platdata.py
@@ -46,6 +46,9 @@ VAL_PREFIX = 'dtv_'
def conv_name_to_c(name):
"""Convert a device-tree name to a C identifier
+ This uses multiple replace() calls instead of re.sub() since it is faster
+ (400ms for 1m calls versus 1000ms for the 're' version).
+
Args:
name: Name to convert
Return: