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: accel/ivpu: Apply minor code style cleanups to align with kernel style
Date: Wed, 11 Mar 2026 13:17:57 +1000	[thread overview]
Message-ID: <review-patch1-20260310120736.3341679-1-karol.wachowski@linux.intel.com> (raw)
In-Reply-To: <20260310120736.3341679-1-karol.wachowski@linux.intel.com>

Patch Review

**Change 1: Remove `(bool)` cast from `drm_gem_is_imported()` (line 104→105)**

```c
-		 (bool)drm_gem_is_imported(&bo->base.base));
+		 drm_gem_is_imported(&bo->base.base));
```

Correct. `drm_gem_is_imported()` is defined in `include/drm/drm_gem.h:646` as returning `bool`, so the cast is redundant. Note that the remaining `(bool)` casts on `bo->base.pages` and `bo->base.sgt` (line 33) are intentionally kept — those convert pointers to boolean values for the `%d` format specifier, which is a different situation.

**Change 2: Use `drm_gem_is_imported()` in `ivpu_bo_bind()` (line 113→114)**

```c
-	if (bo->base.base.import_attach)
+	if (drm_gem_is_imported(&bo->base.base))
```

Correct. `drm_gem_is_imported()` does `return !!obj->import_attach;` which is semantically identical when used in a boolean/`if` context. Using the accessor is preferred over direct field access.

**Change 3: Use `kzalloc_obj()` in `ivpu_gem_create_object()` (line 122→123)**

```c
-	bo = kzalloc(sizeof(*bo), GFP_KERNEL);
+	bo = kzalloc_obj(*bo);
```

Correct. The `kzalloc_obj(P, ...)` macro expands to `__alloc_objs(kzalloc, default_gfp(__VA_ARGS__), typeof(P), 1)`, where `default_gfp()` with no extra args defaults to `GFP_KERNEL`. So `kzalloc_obj(*bo)` is equivalent to `kzalloc(sizeof(*bo), GFP_KERNEL)`.

**Copyright year update (line 95→96)**

```c
- * Copyright (C) 2020-2023 Intel Corporation
+ * Copyright (C) 2020-2026 Intel Corporation
```

Fine, though this jumps from 2023 to 2026 — presumably no changes were copyrightable in 2024-2025, so this is acceptable.

**Minor nit:** The commit message says "Replace direct import_attach test with `drm_gem_is_imported()` in `ivpu_bo_bind()`" but doesn't mention that the same function's return value also had a `(bool)` cast removed in `ivpu_dbg_bo()`. The third bullet does mention removing the cast, but doesn't clarify it's on the same helper function call. This is a very minor clarity issue in the commit message.

**Verdict:** Patch looks good. No functional or correctness concerns. All three changes align with current kernel coding conventions.

---
Generated by Claude Code Patch Reviewer

  reply	other threads:[~2026-03-11  3:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-10 12:07 [PATCH] accel/ivpu: Apply minor code style cleanups to align with kernel style Karol Wachowski
2026-03-11  3:17 ` Claude Code Review Bot [this message]
2026-03-11  3:17 ` Claude review: " 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-patch1-20260310120736.3341679-1-karol.wachowski@linux.intel.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