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:59:37 +1000 [thread overview]
Message-ID: <review-patch1-20260412164953.1470-1-mzndmzn@gmail.com> (raw)
In-Reply-To: <20260412164953.1470-1-mzndmzn@gmail.com>
Patch Review
**Result: NAK — introduces a build break**
The macro `define_fbtft_write_reg` is defined at `fbtft-bus.c:14` with **4 parameters**:
```c
#define define_fbtft_write_reg(func, buffer_type, data_type, modifier)
```
The `modifier` parameter is used throughout the macro body as a function-like call, e.g. at line 42:
```c
*buf = modifier((data_type)va_arg(args, unsigned int));
```
When the 4th argument is left **empty** (as in the original code):
```c
define_fbtft_write_reg(fbtft_write_reg8_bus8, u8, u8, )
```
the preprocessor expands `modifier((data_type)va_arg(args, unsigned int))` to simply `((u8)va_arg(args, unsigned int))` — an identity operation wrapped in parentheses. This is a deliberate and well-known C preprocessor idiom for a "no-op modifier." Compare with line 66 where `cpu_to_be16` is passed as the modifier to perform byte-swapping:
```c
define_fbtft_write_reg(fbtft_write_reg16_bus8, __be16, u16, cpu_to_be16)
```
The patch changes the invocations to only pass 3 arguments:
```c
-define_fbtft_write_reg(fbtft_write_reg8_bus8, u8, u8, )
+define_fbtft_write_reg(fbtft_write_reg8_bus8, u8, u8)
```
This will produce a compilation error like:
> `error: macro "define_fbtft_write_reg" requires 4 arguments, but only 3 given`
The trailing comma before `)` is **not** a coding style issue — it is syntactically required to pass an empty 4th macro argument. checkpatch.pl's warning is a false positive in this context.
**If the author wishes to make this cleaner**, the correct approach would be to refactor the macro itself, for example by introducing a separate 3-parameter version without `modifier`, or by using variadic macros (`__VA_ARGS__`), or by defining a no-op modifier macro like `#define IDENTITY(x) (x)` and passing that instead of an empty argument. Simply dropping the argument is not valid.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-04-13 8:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-04-12 17:21 [PATCH] staging: fbtft: replace empty macro args with identity converter Baker
2026-04-12 17:21 ` [PATCH] staging: fbtft: fix coding style issue in fbtft-bus.c Baker
2026-04-13 8:56 ` Claude review: " 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-patch1-20260412164953.1470-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