drm/nouveau/drm/nouveau/mmu: fix odd_ptr_err.cocci warnings
"Linux Kernel Mailing List" <[email protected]>
| Newsgroups | gmane.linux.kernel.commits.head |
|---|---|
| Message-ID | <[email protected]> |
Web: https://git.kernel.org/torvalds/c/94ee54dc808aa5a13630b082d6f892d0cf7bf527 Commit: 94ee54dc808aa5a13630b082d6f892d0cf7bf527 Parent: fe9748b7b41cee11f8db57fb8b20bc540a33102a Refname: refs/heads/master Author: Christoph Böhmwalder <[email protected]> AuthorDate: Thu Nov 30 20:53:54 2017 +0100 Committer: Ben Skeggs <[email protected]> CommitDate: Fri Feb 2 15:24:03 2018 +1000 drm/nouveau/drm/nouveau/mmu: fix odd_ptr_err.cocci warnings The kbuild test bot complained about a new coccinelle warning nearby, which sparked a discussion about the assignment to 'memory' inside of the conditional expression. See Link below for the original post. Fix the assignment to silence the coccinelle warning and also make the code look a little nicer. Link: https://lists.freedesktop.org/archives/nouveau/2017-November/029242.html Signed-off-by: Christoph Böhmwalder <[email protected]> Signed-off-by: Ben Skeggs <[email protected]> Reviewed-by: Karol Herbst <[email protected]> --- drivers/gpu/drm/nouveau/nvkm/subdev/mmu/uvmm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/uvmm.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/uvmm.c index fa81d0c1ba41..37b201b95f15 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/uvmm.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/uvmm.c @@ -106,7 +106,8 @@ nvkm_uvmm_mthd_map(struct nvkm_uvmm *uvmm, void *argv, u32 argc) } else return ret; - if (IS_ERR((memory = nvkm_umem_search(client, handle)))) { + memory = nvkm_umem_search(client, handle); + if (IS_ERR(memory)) { VMM_DEBUG(vmm, "memory %016llx %ld\n", handle, PTR_ERR(memory)); return PTR_ERR(memory); } -- To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html