public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/panfrost: Prevent division by 0
Date: Wed, 27 May 2026 15:22:50 +1000	[thread overview]
Message-ID: <review-patch3-20260526-claude-fixes-v1-3-16e92eaa4949@collabora.com> (raw)
In-Reply-To: <20260526-claude-fixes-v1-3-16e92eaa4949@collabora.com>

Patch Review

**Status: Correct but very minor scope.**

The fix:
```c
-		status->busy_time / (status->total_time / 100),
+		status->total_time >= 100 ?
+			status->busy_time / (status->total_time / 100) : 0,
```

This is in a `dev_dbg()` call, so it only fires with dynamic debug enabled. The division by zero can occur when `total_time` is an `unsigned long` and `total_time / 100` truncates to 0 for values < 100. The check is correct.

**Nit**: The commit message says "clamp it to 0" when it's really "clamp the percentage display to 0" -- the total_time itself isn't clamped. Also, the 100 ns threshold mentioned in the commit message may confuse readers since `total_time` units aren't necessarily nanoseconds (they depend on ktime conversion).

---

---
Generated by Claude Code Patch Reviewer

  reply	other threads:[~2026-05-27  5:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-25 23:03 [PATCH 0/4] RPM, percnt and other minor fixes for Panfrost Adrián Larumbe
2026-05-25 23:03 ` [PATCH 1/4] drm/panfrost: Check another bo field for cache option query Adrián Larumbe
2026-05-27  5:22   ` Claude review: " Claude Code Review Bot
2026-05-25 23:03 ` [PATCH 2/4] drm/panfrost: Make reset sequence deal with an active HWPerf session Adrián Larumbe
2026-05-27  5:22   ` Claude review: " Claude Code Review Bot
2026-05-25 23:03 ` [PATCH 3/4] drm/panfrost: Prevent division by 0 Adrián Larumbe
2026-05-27  5:22   ` Claude Code Review Bot [this message]
2026-05-25 23:03 ` [PATCH 4/4] drm/panfrost: Fix RPM so device suspends when no jobs are in flight Adrián Larumbe
2026-05-27  5:22   ` Claude review: " Claude Code Review Bot
2026-05-27  5:22 ` Claude review: RPM, percnt and other minor fixes for Panfrost Claude Code Review Bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=review-patch3-20260526-claude-fixes-v1-3-16e92eaa4949@collabora.com \
    --to=claude-review@example.com \
    --cc=dri-devel-reviews@example.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox