From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: =?UTF-8?q?drm/tegra:=20hdmi:=20sor:=20F?= =?UTF-8?q?ix=20error:=20variable=20=E2=80=98j=E2=80=99=20set=20but=20not?= =?UTF-8?q?=20used?= Date: Wed, 11 Feb 2026 17:06:48 +1000 Message-ID: In-Reply-To: <20260209122714.1037915-10-sashal@kernel.org> References: <20260209122714.1037915-10-sashal@kernel.org> <20260209122714.1037915-10-sashal@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Mailer: Claude Code Patch Reviewer Patch Review **Commit Metadata:** - Author: Brahmajit Das - Upstream: 1beee8d0c263b3e239c8d6616e4f8bb700bed658 - Maintainer: Thierry Reding (NVIDIA) - Target: Stable backport to 6.18-5.10 **Commit Message Review:** The commit message is functional but has issues: ``` The variable j is set, however never used in or outside the loop, thus resulting in dead code. Building with GCC 16 results in a build error due to -Werror=unused-but-set-variable= enabled by default. This patch clean up the dead code and fixes the build error. ``` Issues: - Grammar: "This patch clean up" should be "This patch cleans up" - The message doesn't explain WHY `j` existed or whether this reveals a bug - Contains "LLM Generated explanations" section (lines 92-195) which is highly unusual for kernel patches and should not be in the commit **Code Review:** **File 1: drivers/gpu/drm/tegra/hdmi.c** Original code: ```c size_t i, j; ... for (i = 3, j = 0; i < size; i += 7, j += 8) { ``` Modified code: ```c size_t i; ... for (i = 3; i < size; i += 7) { ``` **Analysis:** - Loop processes data in 7-byte chunks (i += 7) - Variable `j` was incrementing by 8 (j += 8) - one byte more than the chunk size - The comment at hdmi.c:686-692 explains the data packing format but doesn't mention why chunks are 7 bytes **Concern:** The mismatch between incrementing by 7 (bytes) and incrementing by 8 (potentially bits * byte?) suggests `j` might have been intended for bit offset tracking but was never completed. This could indicate: 1. Dead code from refactoring 2. Incomplete implementation 3. Copy-paste error **File 2: drivers/gpu/drm/tegra/sor.c** Identical changes to hdmi.c: ```c size_t i, j; ... for (i = 3, j = 0; i < size; i += 7, j += 8) { ``` Changed to: ```c size_t i; ... for (i = 3; i < size; i += 7) { ``` **Same concern applies** - the code appears to be duplicated between hdmi.c and sor.c with the same potential issue. **Technical Issues:** 1. **Code Duplication:** The functions `tegra_hdmi_write_infopack()` and `tegra_sor_hdmi_write_infopack()` appear to have identical logic. This duplication should be refactored into a common helper function. 2. **Missing Investigation:** The patch doesn't explain: - When was `j` last used (if ever)? - Was this a regression or always dead code? - Does the infopack packing work correctly without this variable? 3. **Build vs Runtime:** While this fixes the build, we should verify: - Are HDMI infopacks being written correctly? - Should there be any validation that doesn't happen now? **Positive Aspects:** 1. **Obviously Safe:** Removing truly unused variables cannot introduce runtime bugs 2. **Fixes Real Problem:** GCC 16 build breakage is legitimate 3. **Proper Signoff Chain:** Has author SoB and maintainer SoB 4. **Targeted:** Changes only what's necessary **Questions for Maintainer:** 1. Can you verify HDMI infopack transmission works correctly on affected hardware? 2. Was `j` intended for debugging/validation that was never implemented? 3. Should these two functions be consolidated into shared code? 4. Why is there "LLM Generated explanations" in the commit message? **Verdict:** **Acked-by conditionally** - The code change is correct for fixing the build, but: - The commit message should be cleaned up (remove LLM section, fix grammar) - Investigation should be done into whether the original code was incomplete - Consider filing a follow-up to deduplicate the hdmi.c and sor.c functions **Risk Assessment:** Low risk for stable backport - this is purely removing dead code. **Testing Recommendation:** Verify HDMI output on Tegra platforms (ideally Jetson boards) to ensure infopack handling remains correct. --- Generated by Claude Code Patch Reviewer