From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: Re: [PATCH v3] staging: fbtft: replace empty macro args with identity converter
Date: Mon, 13 Apr 2026 18:50:48 +1000 [thread overview]
Message-ID: <review-patch2-2026041338-guiding-concur-3831@gregkh> (raw)
In-Reply-To: <2026041338-guiding-concur-3831@gregkh>
Patch Review
**Verdict: The approach is correct but the commit message needs revision.**
The change itself is sound: introducing `#define fbtft_no_conv(x) (x)` as an identity macro and using it in place of the empty argument:
```c
+#define fbtft_no_conv(x) (x)
...
-define_fbtft_write_reg(fbtft_write_reg8_bus8, u8, u8, )
+define_fbtft_write_reg(fbtft_write_reg8_bus8, u8, u8, fbtft_no_conv)
...
-define_fbtft_write_reg(fbtft_write_reg16_bus16, u16, u16, )
+define_fbtft_write_reg(fbtft_write_reg16_bus16, u16, u16, fbtft_no_conv)
```
The expansion is functionally identical: `fbtft_no_conv((u8)va_arg(args, unsigned int))` expands to `((u8)va_arg(args, unsigned int))`, which is the same result as the empty-argument expansion.
**Issues:**
1. **Inaccurate commit message**: The commit message states *"Passing an empty token as modifier is undefined behavior in C for fixed-arity macros."* This is incorrect. C99 (§6.10.3) explicitly permits empty macro arguments — the argument count still matches (4 args to 4 params; the 4th is just an empty token sequence). The existing code is technically valid C99. The change is still worthwhile for **clarity and readability** — making the intent explicit with a named identity conversion is better than relying on the subtle empty-argument expansion trick — but the justification should be corrected. Claiming UB when there is none weakens the argument for the patch.
2. **Minor style nit**: The `fbtft_no_conv` macro is placed above the `define_fbtft_write_reg` macro definition (after the file header comment block), which is fine placement-wise. However, since `cpu_to_be16` is a kernel-provided macro/function, it might be worth adding a brief comment like `/* identity conversion for cases that need no byte-order change */` to explain why this exists, especially for a staging driver where cleanup patches are common and future readers may wonder what it's for.
3. **Process**: The `[PATCH v3]` label implies there were v1 and v2 before, but no changelog below the `---` line explains what changed between versions. For staging patches this is less critical, but it's good practice.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-04-13 8:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-12 17:33 [PATCH] staging: fbtft: fix coding style issue in fbtft-bus.c Baker
2026-04-12 17:33 ` [PATCH v3] staging: fbtft: replace empty macro args with identity converter Baker
2026-04-13 5:58 ` Andy Shevchenko
2026-04-13 6:03 ` Greg KH
2026-04-13 6:08 ` Andy Shevchenko
2026-04-13 8:50 ` Claude Code Review Bot [this message]
2026-04-13 8:50 ` Claude review: " Claude Code Review Bot
2026-04-13 8:50 ` 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-2026041338-guiding-concur-3831@gregkh \
--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