From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: drm/panfrost: Prevent division by 0 Date: Wed, 27 May 2026 15:22:50 +1000 Message-ID: In-Reply-To: <20260526-claude-fixes-v1-3-16e92eaa4949@collabora.com> References: <20260526-claude-fixes-v1-0-16e92eaa4949@collabora.com> <20260526-claude-fixes-v1-3-16e92eaa4949@collabora.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 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