diff options
| author | Wander Lairson Costa <wander@redhat.com> | 2026-02-23 13:17:46 -0300 |
|---|---|---|
| committer | Gabriele Monaco <gmonaco@redhat.com> | 2026-03-31 16:47:51 +0200 |
| commit | 908f377f4a0fa4b0b86352af9cb858e6ffcc6e2d (patch) | |
| tree | df5eb87260a9fd7c3fec3d864d285262d2457b6b /rust/kernel/interop/git@git.tavy.me:linux-stable.git | |
| parent | 3f305f86373d5940e5105110415e97b4a4c3cf92 (diff) | |
rv/rvgen: replace % string formatting with f-strings
Replace all instances of percent-style string formatting with
f-strings across the rvgen codebase. This modernizes the string
formatting to use Python 3.6+ features, providing clearer and more
maintainable code while improving runtime performance.
The conversion handles all formatting cases including simple variable
substitution, multi-variable formatting, and complex format specifiers.
Dynamic width formatting is converted from "%*s" to "{var:>{width}}"
using proper alignment syntax. Template strings for generated C code
properly escape braces using double-brace syntax to produce literal
braces in the output.
F-strings provide approximately 2x performance improvement over percent
formatting and are the recommended approach in modern Python.
Signed-off-by: Wander Lairson Costa <wander@redhat.com>
Reviewed-by: Nam Cao <namcao@linutronix.de>
Reviewed-by: Gabriele Monaco <gmonaco@redhat.com>
Link: https://lore.kernel.org/r/20260223162407.147003-4-wander@redhat.com
Signed-off-by: Gabriele Monaco <gmonaco@redhat.com>
Diffstat (limited to 'rust/kernel/interop/git@git.tavy.me:linux-stable.git')
0 files changed, 0 insertions, 0 deletions
