Skip to content

Commit 46883a5

Browse files
committed
gen_defines.py: remove inline comments
interacts badly with c++ macro expansion
1 parent 15d4cdb commit 46883a5

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

scripts/dts/gen_defines.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -308,23 +308,23 @@ def write_ranges(node: edtlib.Node) -> None:
308308
idx_macro = f"{path_id}_RANGES_IDX_{i}_VAL_CHILD_BUS_FLAGS"
309309
idx_value = range.child_bus_addr >> ((range.child_bus_cells - 1) * 32)
310310
idx_vals.append((idx_macro,
311-
f"{idx_value} /* {hex(idx_value)} */"))
311+
f"{idx_value}"))
312312
if range.child_bus_addr is not None:
313313
idx_macro = f"{path_id}_RANGES_IDX_{i}_VAL_CHILD_BUS_ADDRESS"
314314
if "pcie" in node.buses:
315315
idx_value = range.child_bus_addr & ((1 << (range.child_bus_cells - 1) * 32) - 1)
316316
else:
317317
idx_value = range.child_bus_addr
318318
idx_vals.append((idx_macro,
319-
f"{idx_value} /* {hex(idx_value)} */"))
319+
f"{idx_value}"))
320320
if range.parent_bus_addr is not None:
321321
idx_macro = f"{path_id}_RANGES_IDX_{i}_VAL_PARENT_BUS_ADDRESS"
322322
idx_vals.append((idx_macro,
323-
f"{range.parent_bus_addr} /* {hex(range.parent_bus_addr)} */"))
323+
f"{range.parent_bus_addr}"))
324324
if range.length is not None:
325325
idx_macro = f"{path_id}_RANGES_IDX_{i}_VAL_LENGTH"
326326
idx_vals.append((idx_macro,
327-
f"{range.length} /* {hex(range.length)} */"))
327+
f"{range.length}"))
328328

329329
for macro, val in idx_vals:
330330
out_dt_define(macro, val)
@@ -350,7 +350,7 @@ def write_regs(node: edtlib.Node) -> None:
350350
if reg.addr is not None:
351351
idx_macro = f"{path_id}_REG_IDX_{i}_VAL_ADDRESS"
352352
idx_vals.append((idx_macro,
353-
f"{reg.addr} /* {hex(reg.addr)} */"))
353+
f"{reg.addr}"))
354354
if reg.name:
355355
name_vals.append((f"{path_id}_REG_NAME_{reg.name}_EXISTS", 1))
356356
name_macro = f"{path_id}_REG_NAME_{reg.name}_VAL_ADDRESS"
@@ -359,7 +359,7 @@ def write_regs(node: edtlib.Node) -> None:
359359
if reg.size is not None:
360360
idx_macro = f"{path_id}_REG_IDX_{i}_VAL_SIZE"
361361
idx_vals.append((idx_macro,
362-
f"{reg.size} /* {hex(reg.size)} */"))
362+
f"{reg.size}"))
363363
if reg.name:
364364
name_macro = f"{path_id}_REG_NAME_{reg.name}_VAL_SIZE"
365365
name_vals.append((name_macro, f"DT_{idx_macro}"))
@@ -704,7 +704,7 @@ def fmt_dep_list(dep_list):
704704
# Sort the list by dependency ordinal for predictability.
705705
sorted_list = sorted(dep_list, key=lambda node: node.dep_ordinal)
706706
return "\\\n\t" + \
707-
" \\\n\t".join(f"{n.dep_ordinal}, /* {n.path} */"
707+
" \\\n\t".join(f"{n.dep_ordinal}, "
708708
for n in sorted_list)
709709
else:
710710
return "/* nothing */"
@@ -737,7 +737,7 @@ def prop2value(prop: edtlib.Property) -> edtlib.PropertyValType:
737737
return 1 if prop.val else 0
738738

739739
if prop.type in ["array", "uint8-array"]:
740-
return list2init(f"{val} /* {hex(val)} */" for val in prop.val)
740+
return list2init(f"{val}" for val in prop.val)
741741

742742
if prop.type == "string-array":
743743
return list2init(quote_str(val) for val in prop.val)

0 commit comments

Comments
 (0)