From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: staging: fbtft: fix coding style issue in fbtft-bus.c Date: Mon, 13 Apr 2026 18:56:21 +1000 Message-ID: In-Reply-To: <20260412172147.2817-1-mzndmzn@gmail.com> References: <20260412172147.2817-2-mzndmzn@gmail.com> <20260412172147.2817-1-mzndmzn@gmail.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Patch Review **Commit message:** > The define_fbtft_write_reg macro calls 'modifier' as a function. Passing an empty token as modifier is undefined behavior in C for fixed-arity macros. Introduce fbtft_no_conv() as an identity function to replace the empty args in the no-conversion cases. This patch appears to be a v2/improvement over Patch 1, attempting to address the underlying concern properly by introducing an identity macro: ```c +#define fbtft_no_conv(x) (x) ``` **However, the patch has two bugs:** 1. **Same compilation failure as Patch 1.** The invocations are still changed to 3 arguments: ```c -define_fbtft_write_reg(fbtft_write_reg8_bus8, u8, u8, ) +define_fbtft_write_reg(fbtft_write_reg8_bus8, u8, u8) ``` The `fbtft_no_conv` macro is defined but never actually passed as the 4th argument. The correct change should have been: ```c +define_fbtft_write_reg(fbtft_write_reg8_bus8, u8, u8, fbtft_no_conv) +define_fbtft_write_reg(fbtft_write_reg16_bus16, u16, u16, fbtft_no_conv) ``` 2. **Incorrect premise.** The commit message claims "Passing an empty token as modifier is undefined behavior in C for fixed-arity macros." This is not true under C99+. Empty macro arguments are explicitly permitted by the C99 standard and later, and the Linux kernel builds with GNU C11. The existing code is well-defined. **If the author wants to improve clarity** (replacing the empty argument with a named identity macro is arguably more readable, even if the empty arg is valid), the corrected version of this patch would be: ```c #define fbtft_no_conv(x) (x) ... define_fbtft_write_reg(fbtft_write_reg8_bus8, u8, u8, fbtft_no_conv) define_fbtft_write_reg(fbtft_write_reg16_bus8, __be16, u16, cpu_to_be16) define_fbtft_write_reg(fbtft_write_reg16_bus16, u16, u16, fbtft_no_conv) ``` The commit message should also be updated to remove the UB claim and instead frame it as a readability/clarity improvement. **Verdict:** NAK. Introduces a build failure and adds dead code (`fbtft_no_conv` defined but unused). The approach has merit if implemented correctly, but as submitted this does not compile. --- Generated by Claude Code Patch Reviewer