public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/panthor: Fix missing declaration for panthor_transparent_hugepage
@ 2026-05-03 14:42 gyeyoung
  2026-05-04 22:43 ` Claude review: " Claude Code Review Bot
  2026-05-04 22:43 ` Claude Code Review Bot
  0 siblings, 2 replies; 3+ messages in thread
From: gyeyoung @ 2026-05-03 14:42 UTC (permalink / raw)
  To: Boris Brezillon, Steven Price, Liviu Dudau
  Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, dri-devel, linux-kernel, gyeyoung

sparse reports:
	drivers/gpu/drm/panthor/panthor_drv.c:1805:6: warning: symbol 'panthor_transparent_hugepage' was not declared. Should it be static?

Make it clean.

Signed-off-by: gyeyoung <gye976@gmail.com>
---
 drivers/gpu/drm/panthor/panthor_drv.c | 1 +
 drivers/gpu/drm/panthor/panthor_drv.h | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/panthor/panthor_drv.c b/drivers/gpu/drm/panthor/panthor_drv.c
index 66996c9147c2..e8dc4096c1d2 100644
--- a/drivers/gpu/drm/panthor/panthor_drv.c
+++ b/drivers/gpu/drm/panthor/panthor_drv.c
@@ -31,6 +31,7 @@
 
 #include "panthor_devfreq.h"
 #include "panthor_device.h"
+#include "panthor_drv.h"
 #include "panthor_fw.h"
 #include "panthor_gem.h"
 #include "panthor_gpu.h"
diff --git a/drivers/gpu/drm/panthor/panthor_drv.h b/drivers/gpu/drm/panthor/panthor_drv.h
index 1bc7ddbad23e..b81f21ed5398 100644
--- a/drivers/gpu/drm/panthor/panthor_drv.h
+++ b/drivers/gpu/drm/panthor/panthor_drv.h
@@ -4,6 +4,8 @@
 #ifndef __PANTHOR_DRV_H__
 #define __PANTHOR_DRV_H__
 
+#include <linux/types.h>
+
 extern bool panthor_transparent_hugepage;
 
 #endif
-- 
2.43.0

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

* Claude review: drm/panthor: Fix missing declaration for panthor_transparent_hugepage
  2026-05-03 14:42 [PATCH] drm/panthor: Fix missing declaration for panthor_transparent_hugepage gyeyoung
  2026-05-04 22:43 ` Claude review: " Claude Code Review Bot
@ 2026-05-04 22:43 ` Claude Code Review Bot
  1 sibling, 0 replies; 3+ messages in thread
From: Claude Code Review Bot @ 2026-05-04 22:43 UTC (permalink / raw)
  To: dri-devel-reviews

Overall Series Review

Subject: drm/panthor: Fix missing declaration for panthor_transparent_hugepage
Author: gyeyoung <gye976@gmail.com>
Patches: 1
Reviewed: 2026-05-05T08:43:27.088349

---

This is a single-patch series that fixes a sparse warning about the `panthor_transparent_hugepage` module parameter lacking a prior declaration. The approach is correct and follows standard kernel conventions: the defining `.c` file should include its own header so that the compiler can verify the definition matches the `extern` declaration.

The patch is clean, minimal, and correct. The only minor note is about a missing `#include <linux/types.h>` addition in the header — which is also correct since the header uses `bool` and should be self-contained.

**Verdict: Looks good. Acceptable as-is.**

---
Generated by Claude Code Patch Reviewer

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

* Claude review: drm/panthor: Fix missing declaration for panthor_transparent_hugepage
  2026-05-03 14:42 [PATCH] drm/panthor: Fix missing declaration for panthor_transparent_hugepage gyeyoung
@ 2026-05-04 22:43 ` Claude Code Review Bot
  2026-05-04 22:43 ` Claude Code Review Bot
  1 sibling, 0 replies; 3+ messages in thread
From: Claude Code Review Bot @ 2026-05-04 22:43 UTC (permalink / raw)
  To: dri-devel-reviews

Patch Review

**Status: Good**

The sparse warning is:
```
drivers/gpu/drm/panthor/panthor_drv.c:1805:6: warning: symbol 'panthor_transparent_hugepage' was not declared. Should it be static?
```

The variable is defined at `panthor_drv.c:1830`:
```c
bool panthor_transparent_hugepage = true;
module_param_named(transparent_hugepage, panthor_transparent_hugepage, bool, 0400);
```

It is used externally in `panthor_gem.c:25-26`, which already includes `panthor_drv.h` and uses the `extern` declaration there. The fix has two parts:

1. **Adding `#include <linux/types.h>` to `panthor_drv.h`** — Correct. The header uses `bool` in `extern bool panthor_transparent_hugepage;` and must be self-contained. Without this include, the header would break if included in a translation unit that didn't already pull in a header defining `bool`.

2. **Adding `#include "panthor_drv.h"` to `panthor_drv.c`** — Correct. This is the standard kernel pattern: a `.c` file should include its own header so the compiler can verify the definition matches the `extern` declaration. The include is placed in alphabetical order among the other `panthor_*.h` includes, which is good.

**Minor observations (not blocking):**

- The commit message is terse ("Make it clean"). It would be slightly better to say something like "Include panthor_drv.h from panthor_drv.c so the compiler can verify the definition of panthor_transparent_hugepage matches its extern declaration." But for a trivial sparse fix, this is acceptable.

- The header's copyright says "Copyright 2025 Amazon.com" — this suggests the header was recently created (likely when the transparent hugepage support was added). The fact that `panthor_gem.c` already included it confirms the header pre-dates this patch, and only the self-include from the defining file was missing.

**No functional or correctness concerns.**

---
Generated by Claude Code Patch Reviewer

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

end of thread, other threads:[~2026-05-04 22:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-03 14:42 [PATCH] drm/panthor: Fix missing declaration for panthor_transparent_hugepage gyeyoung
2026-05-04 22:43 ` Claude review: " Claude Code Review Bot
2026-05-04 22:43 ` 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