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/gem/shmem: Introduce __drm_gem_shmem_free_sgt_locked() Date: Wed, 27 May 2026 14:05:18 +1000 Message-ID: In-Reply-To: <20260526212857.1158294-5-lyude@redhat.com> References: <20260526212857.1158294-1-lyude@redhat.com> <20260526212857.1158294-5-lyude@redhat.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 **Status: Issue found** The extracted helper is correct in logic =E2=80=94 it moves the unmap/free/= kfree sequence into a standalone function that asserts the resv lock is hel= d: ```c +void __drm_gem_shmem_free_sgt_locked(struct drm_gem_shmem_object *shmem) +{ + dma_resv_assert_held(shmem->base.resv); + + dma_unmap_sgtable(shmem->base.dev->dev, shmem->sgt, DMA_BIDIRECTIONAL, 0); + sg_free_table(shmem->sgt); + kfree(shmem->sgt); + shmem->sgt =3D NULL; +} ``` **Issue: Kerneldoc name mismatch.** The doc comment says `__drm_gem_shmem_r= elease_sgt_locked` but the function is named `__drm_gem_shmem_free_sgt_lock= ed`: ```c + * __drm_gem_shmem_release_sgt_locked - Unpin and DMA unmap pages... ``` This will produce a kernel-doc warning. The V10 changelog mentions "Fix inc= orrect function name in documentation" but the mismatch persists =E2=80=94 = it seems the fix was applied in the wrong direction (or partially). The refactoring of `drm_gem_shmem_release` to call the new helper is correc= t =E2=80=94 the `if (shmem->sgt)` guard is preserved in the caller. --- Generated by Claude Code Patch Reviewer