From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: driver core: platform: tests: add test cases for correct swnode removal Date: Sat, 16 May 2026 11:52:20 +1000 Message-ID: In-Reply-To: <20260513-swnode-remove-on-dev-unreg-v6-6-f9c58939df27@oss.qualcomm.com> References: <20260513-swnode-remove-on-dev-unreg-v6-0-f9c58939df27@oss.qualcomm.com> <20260513-swnode-remove-on-dev-unreg-v6-6-f9c58939df27@oss.qualcomm.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Patch Review **Good test coverage.** Three test cases cover the key scenarios: 1. **`platform_device_swnode_add_twice`**: Verifies a software node can be reused after device unregister (the original bug). Uses a bare `fwnode_init(&fwnode, NULL)` as the primary fwnode with the swnode as secondary. 2. **`platform_device_swnode_as_primary`**: Verifies a software node passed as primary fwnode survives device removal (testing the `fwnode_handle_get()` from patch 4). Checks with `software_node_fwnode()` that the node is still registered after unregister. 3. **`platform_device_two_swnodes`**: Verifies all three invalid dual-swnode combinations return `-EINVAL`. One observation: the tests use `KUNIT_ASSERT_*` throughout rather than `KUNIT_EXPECT_*`. This means early assertions abort the test, preventing potential resource leaks from partial test execution. This is reasonable given the test structure, though it does mean later checks in a function are never reached if an early one fails. **Verdict**: Good coverage for the changes being made. --- Generated by Claude Code Patch Reviewer