public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] staging: fbtft: avoid empty macro argument
@ 2026-03-28 16:01 amanohina1
  2026-03-28 17:49 ` Andy Shevchenko
  0 siblings, 1 reply; 4+ messages in thread
From: amanohina1 @ 2026-03-28 16:01 UTC (permalink / raw)
  To: andy, gregkh
  Cc: dri-devel, linux-fbdev, linux-staging, linux-kernel, amanohina1

Signed-off-by: amanohina1 <caiyuhe80@gmail.com>
---
 drivers/staging/fbtft/fbtft-bus.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/fbtft/fbtft-bus.c b/drivers/staging/fbtft/fbtft-bus.c
index 30e436ff19e4..d1eb3fc03d7a 100644
--- a/drivers/staging/fbtft/fbtft-bus.c
+++ b/drivers/staging/fbtft/fbtft-bus.c
@@ -62,9 +62,11 @@ out:									      \
 }                                                                             \
 EXPORT_SYMBOL(func);
 
-define_fbtft_write_reg(fbtft_write_reg8_bus8, u8, u8, )
+#define fbtft_nop(x) (x)
+
+define_fbtft_write_reg(fbtft_write_reg8_bus8, u8, u8, fbtft_nop)
 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_nop)
 
 void fbtft_write_reg8_bus9(struct fbtft_par *par, int len, ...)
 {
-- 
2.34.1


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

* Re: [PATCH] staging: fbtft: avoid empty macro argument
  2026-03-28 16:01 [PATCH] staging: fbtft: avoid empty macro argument amanohina1
@ 2026-03-28 17:49 ` Andy Shevchenko
  2026-03-31  7:56   ` Claude review: " Claude Code Review Bot
  2026-03-31  7:56   ` Claude Code Review Bot
  0 siblings, 2 replies; 4+ messages in thread
From: Andy Shevchenko @ 2026-03-28 17:49 UTC (permalink / raw)
  To: amanohina1
  Cc: andy, gregkh, dri-devel, linux-fbdev, linux-staging, linux-kernel

On Sat, Mar 28, 2026 at 6:02 PM amanohina1 <caiyuhe80@gmail.com> wrote:

Read Submitting Patches documentation along with
https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git/tree/drivers/staging/fbtft/README?h=staging-next

Act accordingly.

-- 
With Best Regards,
Andy Shevchenko

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

* Claude review: Re: [PATCH] staging: fbtft: avoid empty macro argument
  2026-03-28 17:49 ` Andy Shevchenko
@ 2026-03-31  7:56   ` Claude Code Review Bot
  2026-03-31  7:56   ` Claude Code Review Bot
  1 sibling, 0 replies; 4+ messages in thread
From: Claude Code Review Bot @ 2026-03-31  7:56 UTC (permalink / raw)
  To: dri-devel-reviews

Overall Series Review

Subject: Re: [PATCH] staging: fbtft: avoid empty macro argument
Author: Andy Shevchenko <andy.shevchenko@gmail.com>
Patches: 2
Reviewed: 2026-03-31T17:56:51.241136

---

This is a single patch that replaces empty macro arguments in `define_fbtft_write_reg()` invocations with a no-op identity macro `fbtft_nop`. The change is functionally correct — the `modifier` parameter is used as `modifier(expr)` in the macro body, so passing an empty argument produces `((data_type)va_arg(...))` which works but relies on a GNU C extension (empty macro arguments are technically undefined behavior in ISO C, though widely tolerated). Replacing it with an explicit identity macro is cleaner.

However, the patch has issues that should be addressed before acceptance.

---
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
  2026-03-28 17:49 ` Andy Shevchenko
  2026-03-31  7:56   ` Claude review: " Claude Code Review Bot
@ 2026-03-31  7:56   ` Claude Code Review Bot
  1 sibling, 0 replies; 4+ messages in thread
From: Claude Code Review Bot @ 2026-03-31  7:56 UTC (permalink / raw)
  To: dri-devel-reviews

Patch Review

**Missing commit message body.** The patch has no description at all — just a Signed-off-by. It should explain *why* this change is being made (e.g., "Empty macro arguments are undefined behavior per ISO C99 §6.10.3 and trigger warnings with `-Wmissing-macro-arg`" or similar). A reviewer or future reader of `git log` needs to understand the motivation.

**The fix itself is correct.** The `modifier` parameter appears in three places in the macro body:

```c
buf[i] = modifier((data_type)va_arg(args, unsigned int));
*buf = modifier((data_type)va_arg(args, unsigned int));
*buf++ = modifier((data_type)va_arg(args, unsigned int));
```

Using `fbtft_nop(x)` defined as `(x)` correctly preserves the original semantics — it's an identity transformation, matching what the empty argument was implicitly doing.

**Naming/style nit:** The name `fbtft_nop` is slightly misleading — "nop" typically implies "no operation" (i.e., a statement with no effect), whereas this is an identity *function*. Something like `fbtft_identity` would be more descriptive, though this is minor and a matter of taste.

**Minor: `#define` placement is fine.** Placing the `#define` between the macro definition and its first use is reasonable. Since this is a file-scoped macro only used in this translation unit, it doesn't need to go in a header.

**Recommendation:** The patch needs a proper commit message. The code change itself is a reasonable cleanup. With a commit message added, this would be acceptable.

---
Generated by Claude Code Patch Reviewer

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

end of thread, other threads:[~2026-03-31  7:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-28 16:01 [PATCH] staging: fbtft: avoid empty macro argument amanohina1
2026-03-28 17:49 ` Andy Shevchenko
2026-03-31  7:56   ` Claude review: " Claude Code Review Bot
2026-03-31  7:56   ` 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