public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] staging: fbtft: avoid empty macro argument in define_fbtft_write_reg
@ 2026-03-12 11:18 Zile Xiong
  2026-03-12 13:56 ` Dan Carpenter
  0 siblings, 1 reply; 4+ messages in thread
From: Zile Xiong @ 2026-03-12 11:18 UTC (permalink / raw)
  To: andy, gregkh
  Cc: deller, abdun.nihaal, dan.carpenter, chintanlike, niejianglei2021,
	dri-devel, linux-fbdev, linux-staging, linux-kernel, Zile Xiong

Replace the empty modifier argument with a simple identity macro.
This fixes the error reported by scripts/checkpatch.pl while keeping
the original semantics unchanged.

The generated code is equivalent and builds successfully.

Signed-off-by: Zile Xiong <xiongzile99@gmail.com>
---
 drivers/staging/fbtft/fbtft-bus.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/fbtft/fbtft-bus.c b/drivers/staging/fbtft/fbtft-bus.c
index 30e436ff19e4..380dd374a566 100644
--- a/drivers/staging/fbtft/fbtft-bus.c
+++ b/drivers/staging/fbtft/fbtft-bus.c
@@ -61,10 +61,10 @@ out:									      \
 	va_end(args);                                                         \
 }                                                                             \
 EXPORT_SYMBOL(func);
-
-define_fbtft_write_reg(fbtft_write_reg8_bus8, u8, u8, )
+#define fbtft_identity(x) (x)
+define_fbtft_write_reg(fbtft_write_reg8_bus8, u8, u8, fbtft_identity)
 define_fbtft_write_reg(fbtft_write_reg16_bus8, __be16, u16, cpu_to_be16)
-define_fbtft_write_reg(fbtft_write_reg16_bus16, u16, u16, )
+define_fbtft_write_reg(fbtft_write_reg16_bus16, u16, u16, fbtft_identity)
 
 void fbtft_write_reg8_bus9(struct fbtft_par *par, int len, ...)
 {
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] staging: fbtft: avoid empty macro argument in define_fbtft_write_reg
  2026-03-12 11:18 [PATCH] staging: fbtft: avoid empty macro argument in define_fbtft_write_reg Zile Xiong
@ 2026-03-12 13:56 ` Dan Carpenter
  2026-03-13  4:18   ` Claude review: " Claude Code Review Bot
  2026-03-13  4:18   ` Claude Code Review Bot
  0 siblings, 2 replies; 4+ messages in thread
From: Dan Carpenter @ 2026-03-12 13:56 UTC (permalink / raw)
  To: Zile Xiong
  Cc: andy, gregkh, deller, abdun.nihaal, chintanlike, niejianglei2021,
	dri-devel, linux-fbdev, linux-staging, linux-kernel

On Thu, Mar 12, 2026 at 07:18:07PM +0800, Zile Xiong wrote:
> Replace the empty modifier argument with a simple identity macro.
> This fixes the error reported by scripts/checkpatch.pl while keeping
> the original semantics unchanged.
> 
> The generated code is equivalent and builds successfully.
> 
> Signed-off-by: Zile Xiong <xiongzile99@gmail.com>
> ---
>  drivers/staging/fbtft/fbtft-bus.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/fbtft/fbtft-bus.c b/drivers/staging/fbtft/fbtft-bus.c
> index 30e436ff19e4..380dd374a566 100644
> --- a/drivers/staging/fbtft/fbtft-bus.c
> +++ b/drivers/staging/fbtft/fbtft-bus.c
> @@ -61,10 +61,10 @@ out:									      \
>  	va_end(args);                                                         \
>  }                                                                             \
>  EXPORT_SYMBOL(func);
> -
> -define_fbtft_write_reg(fbtft_write_reg8_bus8, u8, u8, )
> +#define fbtft_identity(x) (x)

Someone sent this exact same patch before.  Same name and everything.

https://lore.kernel.org/all/aYECoy7Apjwgzr9r@stanley.mountain/

A better sollution is to learn to just ignore checkpatch when it is
wrong.  My previous email was longer.

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Claude review: Re: [PATCH] staging: fbtft: avoid empty macro argument in define_fbtft_write_reg
  2026-03-12 13:56 ` Dan Carpenter
  2026-03-13  4:18   ` Claude review: " Claude Code Review Bot
@ 2026-03-13  4:18   ` Claude Code Review Bot
  1 sibling, 0 replies; 4+ messages in thread
From: Claude Code Review Bot @ 2026-03-13  4:18 UTC (permalink / raw)
  To: dri-devel-reviews

Overall Series Review

Subject: Re: [PATCH] staging: fbtft: avoid empty macro argument in define_fbtft_write_reg
Author: Dan Carpenter <dan.carpenter@linaro.org>
Patches: 2
Reviewed: 2026-03-13T14:18:06.692672

---

This is a single-patch series that replaces empty macro arguments in the `define_fbtft_write_reg` macro invocations with an identity macro `fbtft_identity(x)`. The stated motivation is fixing a checkpatch.pl warning about empty macro arguments. The approach is reasonable and the change is semantically correct — `fbtft_identity(x)` expands to `(x)`, which is functionally equivalent to the empty `modifier` that previously expanded to just the bare expression.

However, there are a few issues worth noting.

---
Generated by Claude Code Patch Reviewer

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Claude review: Re: [PATCH] staging: fbtft: avoid empty macro argument in define_fbtft_write_reg
  2026-03-12 13:56 ` Dan Carpenter
@ 2026-03-13  4:18   ` Claude Code Review Bot
  2026-03-13  4:18   ` Claude Code Review Bot
  1 sibling, 0 replies; 4+ messages in thread
From: Claude Code Review Bot @ 2026-03-13  4:18 UTC (permalink / raw)
  To: dri-devel-reviews

Patch Review

**Correctness**: The patch is functionally correct. Where `modifier` was empty, the macro expansion `modifier((data_type)va_arg(...))` would produce `((data_type)va_arg(...))` — just the expression in parentheses. With `fbtft_identity`, it produces `(((data_type)va_arg(...)))` — an extra layer of parentheses that has no semantic effect.

**Issue 1: Blank line removal**

The patch removes the blank line between the `EXPORT_SYMBOL(func);` end of the macro definition and the first invocation:

```c
-
-define_fbtft_write_reg(fbtft_write_reg8_bus8, u8, u8, )
+#define fbtft_identity(x) (x)
+define_fbtft_write_reg(fbtft_write_reg8_bus8, u8, u8, fbtft_identity)
```

The `#define` is jammed right up against the end of the preceding macro. It would be cleaner to keep a blank line separator before the new `#define`, improving readability:

```c
EXPORT_SYMBOL(func);

#define fbtft_identity(x) (x)
define_fbtft_write_reg(fbtft_write_reg8_bus8, u8, u8, fbtft_identity)
```

**Issue 2: Naming and scope**

`fbtft_identity` is defined in a `.c` file and used only locally, so the scope is fine. However, the name `fbtft_identity` is a bit unusual. A more conventional kernel approach might be to check if there's already a no-op/identity macro available, or to name it something more descriptive like `fbtft_noop_modifier`. This is minor and stylistic.

**Issue 3: Commit message**

The commit message says "This fixes the error reported by scripts/checkpatch.pl" but doesn't quote the actual checkpatch warning. It would be better practice to include the specific warning text so reviewers can evaluate whether this is the right fix. For staging code especially, checkpatch fixes are common and welcome, but stating the exact warning is standard practice.

**Overall**: The patch is a straightforward, correct cleanup. The suggestions above are minor. It could also be worth checking if a series-wide cleanup of this file is planned (since this is staging code), but as a standalone fix it's fine.

---
Generated by Claude Code Patch Reviewer

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-03-13  4:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-12 11:18 [PATCH] staging: fbtft: avoid empty macro argument in define_fbtft_write_reg Zile Xiong
2026-03-12 13:56 ` Dan Carpenter
2026-03-13  4:18   ` Claude review: " Claude Code Review Bot
2026-03-13  4:18   ` Claude Code Review Bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox