All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/nouveau/mmu: fix odd_ptr_err.cocci warnings
@ 2017-11-30 19:53 ` Christoph Böhmwalder
  0 siblings, 0 replies; 3+ messages in thread
From: Christoph Böhmwalder @ 2017-11-30 19:53 UTC (permalink / raw)
  To: bskeggs, airlied
  Cc: dri-devel, nouveau, linux-kernel, Christoph Böhmwalder

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 <christoph@boehmwalder.at>
---
 drm/nouveau/nvkm/subdev/mmu/uvmm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drm/nouveau/nvkm/subdev/mmu/uvmm.c b/drm/nouveau/nvkm/subdev/mmu/uvmm.c
index fa81d0c1..37b201b9 100644
--- a/drm/nouveau/nvkm/subdev/mmu/uvmm.c
+++ b/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);
 	}
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] drm/nouveau/mmu: fix odd_ptr_err.cocci warnings
@ 2017-11-30 19:53 ` Christoph Böhmwalder
  0 siblings, 0 replies; 3+ messages in thread
From: Christoph Böhmwalder @ 2017-11-30 19:53 UTC (permalink / raw)
  To: bskeggs-H+wXaHxf7aLQT0dZR+AlfA, airlied-cv59FeDIM0c
  Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

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 <christoph@boehmwalder.at>
---
 drm/nouveau/nvkm/subdev/mmu/uvmm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drm/nouveau/nvkm/subdev/mmu/uvmm.c b/drm/nouveau/nvkm/subdev/mmu/uvmm.c
index fa81d0c1..37b201b9 100644
--- a/drm/nouveau/nvkm/subdev/mmu/uvmm.c
+++ b/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);
 	}
-- 
2.13.6

_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Nouveau] [PATCH] drm/nouveau/mmu: fix odd_ptr_err.cocci warnings
  2017-11-30 19:53 ` Christoph Böhmwalder
  (?)
@ 2017-12-06 10:02 ` Karol Herbst
  -1 siblings, 0 replies; 3+ messages in thread
From: Karol Herbst @ 2017-12-06 10:02 UTC (permalink / raw)
  To: Christoph Böhmwalder
  Cc: Ben Skeggs, David Airlie, nouveau, linux-kernel, dri-devel

Reviewed-by: Karol Herbst <kherbst@redhat.com>

On Thu, Nov 30, 2017 at 8:53 PM, Christoph Böhmwalder
<christoph@boehmwalder.at> wrote:
> 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 <christoph@boehmwalder.at>
> ---
>  drm/nouveau/nvkm/subdev/mmu/uvmm.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drm/nouveau/nvkm/subdev/mmu/uvmm.c b/drm/nouveau/nvkm/subdev/mmu/uvmm.c
> index fa81d0c1..37b201b9 100644
> --- a/drm/nouveau/nvkm/subdev/mmu/uvmm.c
> +++ b/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);
>         }
> --
> 2.13.6
>
> _______________________________________________
> Nouveau mailing list
> Nouveau@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/nouveau

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-12-06 10:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-30 19:53 [PATCH] drm/nouveau/mmu: fix odd_ptr_err.cocci warnings Christoph Böhmwalder
2017-11-30 19:53 ` Christoph Böhmwalder
2017-12-06 10:02 ` [Nouveau] " Karol Herbst

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.