From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot 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 Message-ID: In-Reply-To: <20260310120736.3341679-1-karol.wachowski@linux.intel.com> References: <20260310120736.3341679-1-karol.wachowski@linux.intel.com> <20260310120736.3341679-1-karol.wachowski@linux.intel.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Patch Review **Change 1: Remove `(bool)` cast from `drm_gem_is_imported()` (line 104=E2= =86=92105)** ```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 `(bo= ol)` casts on `bo->base.pages` and `bo->base.sgt` (line 33) are intentional= ly kept =E2=80=94 those convert pointers to boolean values for the `%d` for= mat specifier, which is a different situation. **Change 2: Use `drm_gem_is_imported()` in `ivpu_bo_bind()` (line 113=E2=86= =92114)** ```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 ac= cessor is preferred over direct field access. **Change 3: Use `kzalloc_obj()` in `ivpu_gem_create_object()` (line 122=E2= =86=92123)** ```c - bo =3D kzalloc(sizeof(*bo), GFP_KERNEL); + bo =3D 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 ext= ra args defaults to `GFP_KERNEL`. So `kzalloc_obj(*bo)` is equivalent to `k= zalloc(sizeof(*bo), GFP_KERNEL)`. **Copyright year update (line 95=E2=86=9296)** ```c - * Copyright (C) 2020-2023 Intel Corporation + * Copyright (C) 2020-2026 Intel Corporation ``` Fine, though this jumps from 2023 to 2026 =E2=80=94 presumably no changes w= ere copyrightable in 2024-2025, so this is acceptable. **Minor nit:** The commit message says "Replace direct import_attach test w= ith `drm_gem_is_imported()` in `ivpu_bo_bind()`" but doesn't mention that t= he same function's return value also had a `(bool)` cast removed in `ivpu_d= bg_bo()`. The third bullet does mention removing the cast, but doesn't clar= ify it's on the same helper function call. This is a very minor clarity iss= ue in the commit message. **Verdict:** Patch looks good. No functional or correctness concerns. All t= hree changes align with current kernel coding conventions. --- Generated by Claude Code Patch Reviewer