public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] amdgpu/display/dc/link: fix sparse warning on assigning int as nullptr
@ 2026-02-25 23:46 Joshua Peisach
  2026-02-27  2:41 ` Claude review: " Claude Code Review Bot
  2026-02-27  2:41 ` Claude Code Review Bot
  0 siblings, 2 replies; 3+ messages in thread
From: Joshua Peisach @ 2026-02-25 23:46 UTC (permalink / raw)
  To: Harry Wentland, Leo Li, Rodrigo Siqueira, Alex Deucher,
	Christian König, David Airlie, Simona Vetter, amd-gfx,
	dri-devel
  Cc: Joshua Peisach

Fixes a sparse message about link_stream being assigned an int
value of 0, instead of NULL.

Signed-off-by: Joshua Peisach <jpeisach@ubuntu.com>
---
 drivers/gpu/drm/amd/display/dc/link/accessories/link_dp_cts.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/link/accessories/link_dp_cts.c b/drivers/gpu/drm/amd/display/dc/link/accessories/link_dp_cts.c
index 693d852b1..918993a3c 100644
--- a/drivers/gpu/drm/amd/display/dc/link/accessories/link_dp_cts.c
+++ b/drivers/gpu/drm/amd/display/dc/link/accessories/link_dp_cts.c
@@ -957,7 +957,7 @@ void dp_set_preferred_link_settings(struct dc *dc,
 {
 	int i;
 	struct pipe_ctx *pipe;
-	struct dc_stream_state *link_stream = 0;
+	struct dc_stream_state *link_stream = NULL;
 	struct dc_link_settings store_settings = *link_setting;
 
 	link->preferred_link_setting = store_settings;
-- 
2.51.0


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

* Claude review: amdgpu/display/dc/link: fix sparse warning on assigning int as nullptr
  2026-02-25 23:46 [PATCH] amdgpu/display/dc/link: fix sparse warning on assigning int as nullptr Joshua Peisach
  2026-02-27  2:41 ` Claude review: " Claude Code Review Bot
@ 2026-02-27  2:41 ` Claude Code Review Bot
  1 sibling, 0 replies; 3+ messages in thread
From: Claude Code Review Bot @ 2026-02-27  2:41 UTC (permalink / raw)
  To: dri-devel-reviews

Overall Series Review

Subject: amdgpu/display/dc/link: fix sparse warning on assigning int as nullptr
Author: Joshua Peisach <jpeisach@ubuntu.com>
Patches: 1
Reviewed: 2026-02-27T12:41:48.613388

---

This is a single, trivial cleanup patch that fixes a sparse warning by replacing `0` with `NULL` for a pointer initialization. The change is correct, harmless, and follows standard kernel coding conventions.

**Verdict: Looks good.**

---
Generated by Claude Code Patch Reviewer

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

* Claude review: amdgpu/display/dc/link: fix sparse warning on assigning int as nullptr
  2026-02-25 23:46 [PATCH] amdgpu/display/dc/link: fix sparse warning on assigning int as nullptr Joshua Peisach
@ 2026-02-27  2:41 ` Claude Code Review Bot
  2026-02-27  2:41 ` Claude Code Review Bot
  1 sibling, 0 replies; 3+ messages in thread
From: Claude Code Review Bot @ 2026-02-27  2:41 UTC (permalink / raw)
  To: dri-devel-reviews

Patch Review

**Status: Correct and appropriate.**

The patch changes:
```c
-	struct dc_stream_state *link_stream = 0;
+	struct dc_stream_state *link_stream = NULL;
```

This is a straightforward fix. Assigning `0` to a pointer is valid C but triggers a sparse warning because sparse distinguishes between integer zero and the `NULL` pointer constant. Using `NULL` is the idiomatic and preferred style in the kernel.

**Minor nits on the commit message:**

1. The subject prefix uses `amdgpu/display/dc/link:` but the conventional prefix for this subsystem in the kernel log would be `drm/amd/display:` or `drm/amd/display/dc/link:`. Looking at recent commits for this file, the `drm/amd/` prefix is standard. This should ideally be `drm/amd/display: fix sparse warning ...`.

2. The commit message body says "nullptr" which is a C++ term — the kernel uses C, where it's simply `NULL`. The body could be slightly more precise, e.g., "Fix sparse warning about assigning plain 0 to pointer variable; use NULL instead."

3. The commit message body lacks a `Fixes:` tag identifying when the offending code was introduced. While not strictly required for a style/warning fix, it can be helpful.

None of these are blocking issues — the code change itself is clearly correct and trivially safe.

**Reviewed-by: Acceptable.**

---
Generated by Claude Code Patch Reviewer

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

end of thread, other threads:[~2026-02-27  2:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-25 23:46 [PATCH] amdgpu/display/dc/link: fix sparse warning on assigning int as nullptr Joshua Peisach
2026-02-27  2:41 ` Claude review: " Claude Code Review Bot
2026-02-27  2:41 ` 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