[Concept,03/12] buildman: Extract arch fixups from scan() into separate function

Message ID 20260103203243.3727493-4-sjg@u-boot.org
State New
Headers
Series buildman: Fix pylint warnings in board.py and boards.py |

Commit Message

Simon Glass Jan. 3, 2026, 8:32 p.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

Move the architecture fixup logic (aarch64 and riscv adjustments) into
a new _fixup_arch() method to reduce complexity of scan().

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

 tools/buildman/boards.py | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
  

Patch

diff --git a/tools/buildman/boards.py b/tools/buildman/boards.py
index f503d8ef208..9dc5f9158d0 100644
--- a/tools/buildman/boards.py
+++ b/tools/buildman/boards.py
@@ -301,6 +301,19 @@  class KconfigScanner:
 
         params['target'] = expect_target
 
+        self._fixup_arch(params)
+
+        return params, warnings
+
+    def _fixup_arch(self, params):
+        """Fix up architecture names
+
+        Handle cases where the architecture name needs adjustment based on
+        CPU type or other configuration.
+
+        Args:
+            params (dict): Board parameters to update in place
+        """
         # fix-up for aarch64
         if params['arch'] == 'arm' and params['cpu'] == 'armv8':
             params['arch'] = 'aarch64'
@@ -316,8 +329,6 @@  class KconfigScanner:
             else:
                 params['arch'] = 'riscv64'
 
-        return params, warnings
-
 
 class MaintainersDatabase: