From: Claude Code Review Bot <claude-review@example.com>
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 [thread overview]
Message-ID: <review-patch2-20260412172147.2817-1-mzndmzn@gmail.com> (raw)
In-Reply-To: <20260412172147.2817-1-mzndmzn@gmail.com>
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
next prev parent reply other threads:[~2026-04-13 8:56 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-12 17:21 [PATCH] staging: fbtft: fix coding style issue in fbtft-bus.c Baker
2026-04-12 17:21 ` [PATCH] staging: fbtft: replace empty macro args with identity converter Baker
2026-04-13 8:56 ` Claude review: " Claude Code Review Bot
2026-04-13 8:56 ` Claude Code Review Bot
2026-04-13 8:56 ` Claude Code Review Bot [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-04-12 16:49 [PATCH] staging: fbtft: fix coding style issue in fbtft-bus.c Baker
2026-04-13 8:59 ` Claude review: " Claude Code Review Bot
2026-04-13 8:59 ` Claude Code Review Bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=review-patch2-20260412172147.2817-1-mzndmzn@gmail.com \
--to=claude-review@example.com \
--cc=dri-devel-reviews@example.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox