From patchwork Sat Jan 10 23:56:22 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1481 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768089465; bh=Jy8jhWuJybkKe3baG4ld/myy1/2n6xrJWIunpV7uLaI=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=tNCZiOzHmG1VHsmj80gh8VNF/H5jG2s7mfo2Az7M50fuTkqfCLn6UJiBj1ng1qKNx CzuDRzxbcyKQaW6Xa0zbl+KAx7w6GTQMlYtrYqHqF+jNFdmUEKZD00hwdfRXspySS8 l/bjOz07SujAGfE6Ps3OOr8tdMIP6GaXnzzeMybs7tD9OUft3SwWw1rDJaHqHC/YVQ jhhVy0OVovAzhHbpDcDUANIIxcj+4VEAzkYQC8wnDwzC5At/TsvL3Ro3jEAmgngHu4 4ZebRTPfQFC4V930+r3jJ4LbLhhVjzOlbHMFlsvmagl2Jsvf3O3Exhug8rypTMCQsy TULt9eNihGAGA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E07CB692B9 for ; Sat, 10 Jan 2026 16:57:45 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id AZryqVI6s30z for ; Sat, 10 Jan 2026 16:57:45 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768089465; bh=Jy8jhWuJybkKe3baG4ld/myy1/2n6xrJWIunpV7uLaI=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=tNCZiOzHmG1VHsmj80gh8VNF/H5jG2s7mfo2Az7M50fuTkqfCLn6UJiBj1ng1qKNx CzuDRzxbcyKQaW6Xa0zbl+KAx7w6GTQMlYtrYqHqF+jNFdmUEKZD00hwdfRXspySS8 l/bjOz07SujAGfE6Ps3OOr8tdMIP6GaXnzzeMybs7tD9OUft3SwWw1rDJaHqHC/YVQ jhhVy0OVovAzhHbpDcDUANIIxcj+4VEAzkYQC8wnDwzC5At/TsvL3Ro3jEAmgngHu4 4ZebRTPfQFC4V930+r3jJ4LbLhhVjzOlbHMFlsvmagl2Jsvf3O3Exhug8rypTMCQsy TULt9eNihGAGA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id CFF70692B0 for ; Sat, 10 Jan 2026 16:57:45 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768089463; bh=T6IdfEiXeF5KBGXHlu362WWGEa2qDhfyVcSWr6ISJ8U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q5FZ/IWm4zcyWx3tcZegtgHa+LmaX1PYIJ/JW22asFi2pC9nhq/Nd90NfdHqBPM5p I5F1+FHD15XkYG/ADNTPgSbA4q36TuN7snj1u3xGu8kLl4ucza8Rgn/jdaDryou17P 3c/+cM7IvPUSUonjh3UAsJcObDZTB6Y48y4nWmnz4khQO+xP4X4ZzYiZIMLfvJiN7L poqLMFPdfK6cOP/0SOHK+2WQ5w84a4cOsTRO92T2SXO9/tL9bUNu2TOE4Yoy2ZLwWZ xp+R/Q5FZvqtDkhKeKBATzPsZhHbIiPTd48yhLAfXbY+eCWMr1RsJbF5kqI7GrHO5K F4bfg+h1UONug== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id CD6B5692B0; Sat, 10 Jan 2026 16:57:43 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id rNi_QKqTPRGq; Sat, 10 Jan 2026 16:57:43 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768089458; bh=YGYCV0XNabJwb/v0uroFVNbKpMLA6E1DEh6wEpO6Izk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p1nBB8oJly9YihNFYpQo85b+Ry8qrgHx86stajx2DvZvhw2yKwbaRavO4KgKrIax9 EkDh5ZrJG/B4p73kyJVFVA5KRu4w+uXH8y011q3XkjMjLQvwdzqXyHxa1kF3Jimzgo 4Ty8MYt04NQeuBUSd9R/bmORxaUKDt+0Im0C6pInZ82UqpGDcSQPxogf32GNgyncPK qfMQHhjF9ZbKlNB6+AHYcdGq7rr+t6NSN7qNDoTxAEf4VV8yZ5jLK6g4rTzEwioPEd GpnymMCSBQAndjvV5Fk9uD7E3HABYb3APbi0DTL7+P4B6BrSM/59+3jlSrBhHEqp/4 A1CosoR5D9iRg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id A029E69186; Sat, 10 Jan 2026 16:57:38 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sat, 10 Jan 2026 16:56:22 -0700 Message-ID: <20260110235633.1064859-10-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260110235633.1064859-1-sjg@u-boot.org> References: <20260110235633.1064859-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: BSUCS4L5J3PYVRMISDFJPJTNFZQAALDD X-Message-ID-Hash: BSUCS4L5J3PYVRMISDFJPJTNFZQAALDD X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 09/14] buildman: Fix unused variable warnings in func_test List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Fix pylint W0612 (unused-variable) and W0613 (unused-argument) warnings. For unused function parameters that must remain for API compatibility, prefix them with underscore. For variables that are assigned but never used, either remove them or prefix with underscore to indicate intentional non-use. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- tools/buildman/func_test.py | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/tools/buildman/func_test.py b/tools/buildman/func_test.py index 1817bf95485..e0f9d7af67d 100644 --- a/tools/buildman/func_test.py +++ b/tools/buildman/func_test.py @@ -290,7 +290,6 @@ class TestFunctional(unittest.TestCase): """Test that -h shows help text""" command.TEST_RESULT = None result = self._run_buildman('-h') - help_file = os.path.join(self._buildman_dir, 'README.rst') self.assertTrue(len(result.stdout) > 1000) self.assertEqual(0, len(result.stderr)) self.assertEqual(0, result.return_code) @@ -374,7 +373,7 @@ class TestFunctional(unittest.TestCase): print('git', git_args, sub_cmd, args) sys.exit(1) - def _handle_command_nm(self, args): + def _handle_command_nm(self, _args): # Return nm --size-sort output with function sizes that vary between # calls to simulate changes between commits self._nm_calls = getattr(self, '_nm_calls', 0) + 1 @@ -386,7 +385,7 @@ class TestFunctional(unittest.TestCase): ''' return command.CommandResult(return_code=0, stdout=stdout) - def _handle_command_objdump(self, args): + def _handle_command_objdump(self, _args): # Return objdump -h output with .rodata section stdout = ''' u-boot: file format elf32-littlearm @@ -399,7 +398,7 @@ Idx Name Size VMA LMA File off Algn ''' return command.CommandResult(return_code=0, stdout=stdout) - def _handle_command_objcopy(self, args): + def _handle_command_objcopy(self, _args): return command.CommandResult(return_code=0) def _handle_command_size(self, args): @@ -478,7 +477,7 @@ Idx Name Size VMA LMA File off Algn result.stdout = len(result.stdout.splitlines()) return result - def _handle_make(self, commit, brd, stage, cwd, *args, **kwargs): + def _handle_make(self, commit, brd, stage, cwd, *args, **_kwargs): """Handle execution of 'make' Args: @@ -935,7 +934,7 @@ Some images are invalid''' def test_thread_exceptions(self): """Test that exceptions in threads are reported""" - with terminal.capture() as (stdout, stderr): + with terminal.capture() as (stdout, _stderr): self.assertEqual(102, self._run_control('-o', self._output_dir, test_thread_exceptions=True)) self.assertIn( @@ -948,7 +947,6 @@ Some images are invalid''' board0_dir = os.path.join(self._output_dir, 'current', 'board0') errfile = os.path.join(board0_dir, 'err') - logfile = os.path.join(board0_dir, 'log') # We expect failure when there are missing blobs result = self._run_control('board0', '-o', self._output_dir) @@ -1067,13 +1065,13 @@ Some images are invalid''' """Test passing of configuration fragments to the make command""" # Single fragment passed as argument extra_args = ['board0', '--fragments', 'f1.config'] - lines, cfg_data = self.check_command(*extra_args) + lines, _cfg_data = self.check_command(*extra_args) self.assertRegex(lines[0].decode('utf-8'), r'make O=/.*board0_defconfig\s+f1\.config', 'Test single fragment') # Multiple fragments passed as comma-separated list extra_args = ['board0', '--fragments', 'f1.config,f2.config'] - lines, cfg_data = self.check_command(*extra_args) + lines, _cfg_data = self.check_command(*extra_args) self.assertRegex(lines[0].decode('utf-8'), r'make O=/.*board0_defconfig\s+f1\.config\s+f2\.config', 'Test multiple fragments') @@ -1088,7 +1086,7 @@ Some images are invalid''' # CONFIG_LOCALVERSION_AUTO is not set ''', cfg_data) - with terminal.capture() as (stdout, stderr): + with terminal.capture() as (stdout, _stderr): lines, cfg_data = self.check_command('-r', '-a', 'LOCALVERSION') self.assertIn(b'SOURCE_DATE_EPOCH=0', lines[0]) @@ -1312,15 +1310,14 @@ endif outfile = os.path.join(self._output_dir, 'test-boards.cfg') if os.path.exists(outfile): os.remove(outfile) - with terminal.capture() as (stdout, stderr): - result = self._run_control('-R', outfile, brds=None, - get_builder=False) + with terminal.capture() as (_stdout, _stderr): + self._run_control('-R', outfile, brds=None, get_builder=False) self.assertTrue(os.path.exists(outfile)) def test_print_prefix(self): """Test that we can print the toolchain prefix""" with terminal.capture() as (stdout, stderr): - result = self._run_control('-A', 'board0') + self._run_control('-A', 'board0') self.assertEqual('arm-\n', stdout.getvalue()) self.assertEqual('', stderr.getvalue()) @@ -1364,7 +1361,7 @@ endif def test_print_arch(self): """Test that we can print the board architecture""" with terminal.capture() as (stdout, stderr): - result = self._run_control('--print-arch', 'board0') + self._run_control('--print-arch', 'board0') self.assertEqual('arm\n', stdout.getvalue()) self.assertEqual('', stderr.getvalue())