summaryrefslogtreecommitdiff
path: root/rust/kernel/interop/git@git.tavy.me:linux-stable.git
diff options
context:
space:
mode:
authorWander Lairson Costa <wander@redhat.com>2026-02-23 13:17:53 -0300
committerGabriele Monaco <gmonaco@redhat.com>2026-04-01 10:16:18 +0200
commitd474fedcc53aebd584dfc1a42ccb78329ca68aa0 (patch)
tree91f3ae1808d8df85bc859077ff2687337ff6fef7 /rust/kernel/interop/git@git.tavy.me:linux-stable.git
parent5d5a7d88185bc7c99328a29498efb3154e2d23d7 (diff)
rv/rvgen: use class constant for init marker
Replace hardcoded string literal and magic number with a class constant for the initial state marker in DOT file parsing. The previous implementation used the magic string "__init_" directly in the code along with a hardcoded length of 7 for substring extraction, which made the code less maintainable and harder to understand. This change introduces a class constant init_marker to serve as a single source of truth for the initial state prefix. The code now uses startswith() for clearer intent and calculates the substring position dynamically using len(), eliminating the magic number. If the marker value needs to change in the future, only the constant definition requires updating rather than multiple locations in the code. The refactoring improves code readability and maintainability while preserving the exact same runtime behavior. Signed-off-by: Wander Lairson Costa <wander@redhat.com> Reviewed-by: Gabriele Monaco <gmonaco@redhat.com> Reviewed-by: Nam Cao <namcao@linutronix.de> Link: https://lore.kernel.org/r/20260223162407.147003-11-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