public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/radeon: replace nested min calls with min3
@ 2026-04-07 18:14 Thorsten Blum
  2026-04-12  3:20 ` Claude review: " Claude Code Review Bot
  2026-04-12  3:20 ` Claude Code Review Bot
  0 siblings, 2 replies; 3+ messages in thread
From: Thorsten Blum @ 2026-04-07 18:14 UTC (permalink / raw)
  To: Alex Deucher, Christian König, David Airlie, Simona Vetter
  Cc: Thorsten Blum, amd-gfx, dri-devel, linux-kernel

In dce6_available_bandwidth() and dce8_available_bandwidth(), replace
nested min() calls with min3().

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 drivers/gpu/drm/radeon/cik.c | 2 +-
 drivers/gpu/drm/radeon/si.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c
index 51a3e0fc2f56..a13635443833 100644
--- a/drivers/gpu/drm/radeon/cik.c
+++ b/drivers/gpu/drm/radeon/cik.c
@@ -9063,7 +9063,7 @@ static u32 dce8_available_bandwidth(struct dce8_wm_params *wm)
 	u32 data_return_bandwidth = dce8_data_return_bandwidth(wm);
 	u32 dmif_req_bandwidth = dce8_dmif_request_bandwidth(wm);
 
-	return min(dram_bandwidth, min(data_return_bandwidth, dmif_req_bandwidth));
+	return min3(dram_bandwidth, data_return_bandwidth, dmif_req_bandwidth);
 }
 
 /**
diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c
index 26197aceb001..4681ff28630a 100644
--- a/drivers/gpu/drm/radeon/si.c
+++ b/drivers/gpu/drm/radeon/si.c
@@ -2150,7 +2150,7 @@ static u32 dce6_available_bandwidth(struct dce6_wm_params *wm)
 	u32 data_return_bandwidth = dce6_data_return_bandwidth(wm);
 	u32 dmif_req_bandwidth = dce6_dmif_request_bandwidth(wm);
 
-	return min(dram_bandwidth, min(data_return_bandwidth, dmif_req_bandwidth));
+	return min3(dram_bandwidth, data_return_bandwidth, dmif_req_bandwidth);
 }
 
 static u32 dce6_average_bandwidth(struct dce6_wm_params *wm)

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

* Claude review: drm/radeon: replace nested min calls with min3
  2026-04-07 18:14 [PATCH] drm/radeon: replace nested min calls with min3 Thorsten Blum
  2026-04-12  3:20 ` Claude review: " Claude Code Review Bot
@ 2026-04-12  3:20 ` Claude Code Review Bot
  1 sibling, 0 replies; 3+ messages in thread
From: Claude Code Review Bot @ 2026-04-12  3:20 UTC (permalink / raw)
  To: dri-devel-reviews

Overall Series Review

Subject: drm/radeon: replace nested min calls with min3
Author: Thorsten Blum <thorsten.blum@linux.dev>
Patches: 1
Reviewed: 2026-04-12T13:20:25.604923

---

This is a single, straightforward cleanup patch that replaces nested `min()` calls with `min3()` in two radeon driver files. The change is purely cosmetic/readability — it produces identical behavior since `min3(a, b, c)` is defined as `min(a, min(b, c))` in the kernel's `minmax.h`. The patch is correct and harmless.

**Verdict:** Looks good. Trivial cleanup, no functional change.

---
Generated by Claude Code Patch Reviewer

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

* Claude review: drm/radeon: replace nested min calls with min3
  2026-04-07 18:14 [PATCH] drm/radeon: replace nested min calls with min3 Thorsten Blum
@ 2026-04-12  3:20 ` Claude Code Review Bot
  2026-04-12  3:20 ` Claude Code Review Bot
  1 sibling, 0 replies; 3+ messages in thread
From: Claude Code Review Bot @ 2026-04-12  3:20 UTC (permalink / raw)
  To: dri-devel-reviews

Patch Review

**Status:** Reviewed-by worthy

The patch modifies two functions that are structurally identical across two files:

- `dce8_available_bandwidth()` in `drivers/gpu/drm/radeon/cik.c`
- `dce6_available_bandwidth()` in `drivers/gpu/drm/radeon/si.c`

In both cases, the change is:
```c
-	return min(dram_bandwidth, min(data_return_bandwidth, dmif_req_bandwidth));
+	return min3(dram_bandwidth, data_return_bandwidth, dmif_req_bandwidth);
```

**Correctness:** The kernel's `min3()` macro (from `linux/minmax.h`) is equivalent to `min(a, min(b, c))`, so this is a no-op in terms of behavior. All three variables are `u32`, so there are no type-promotion concerns.

**Commit message:** Accurate and concise. Correctly names both affected functions.

**No issues found.** This is a clean readability improvement with no risk.

---
Generated by Claude Code Patch Reviewer

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

end of thread, other threads:[~2026-04-12  3:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-07 18:14 [PATCH] drm/radeon: replace nested min calls with min3 Thorsten Blum
2026-04-12  3:20 ` Claude review: " Claude Code Review Bot
2026-04-12  3:20 ` 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