* [PATCH v2] drm/amdgpu_vm: fix boolean expressions
@ 2019-01-03 20:01 Gustavo A. R. Silva
2019-01-04 16:40 ` Ezequiel Garcia
2019-01-04 16:52 ` Alex Deucher
0 siblings, 2 replies; 4+ messages in thread
From: Gustavo A. R. Silva @ 2019-01-03 20:01 UTC (permalink / raw)
To: Felix Kuehling, Harish Kasiviswanathan, Alex Deucher,
Christian König, David (ChunMing) Zhou, David Airlie,
Daniel Vetter
Cc: amd-gfx, dri-devel, linux-kernel, Gustavo A. R. Silva
Fix boolean expressions by using logical AND operator '&&'
instead of bitwise operator '&'.
This issue was detected with the help of Coccinelle.
Fixes: 9a4b7d4c769e ("drm/amdgpu: Add vm context module param")
Cc: stable@vger.kernel.org
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
Changes in v2:
- Update Fixes tag.
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index e73d152659a2..4cc0d1079935 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -3006,7 +3006,7 @@ int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm,
}
DRM_DEBUG_DRIVER("VM update mode is %s\n",
vm->use_cpu_for_update ? "CPU" : "SDMA");
- WARN_ONCE((vm->use_cpu_for_update & !amdgpu_gmc_vram_full_visible(&adev->gmc)),
+ WARN_ONCE((vm->use_cpu_for_update && !amdgpu_gmc_vram_full_visible(&adev->gmc)),
"CPU update of VM recommended only for large BAR system\n");
vm->last_update = NULL;
@@ -3136,7 +3136,7 @@ int amdgpu_vm_make_compute(struct amdgpu_device *adev, struct amdgpu_vm *vm, uns
vm->pte_support_ats = pte_support_ats;
DRM_DEBUG_DRIVER("VM update mode is %s\n",
vm->use_cpu_for_update ? "CPU" : "SDMA");
- WARN_ONCE((vm->use_cpu_for_update & !amdgpu_gmc_vram_full_visible(&adev->gmc)),
+ WARN_ONCE((vm->use_cpu_for_update && !amdgpu_gmc_vram_full_visible(&adev->gmc)),
"CPU update of VM recommended only for large BAR system\n");
if (vm->pasid) {
--
2.20.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] drm/amdgpu_vm: fix boolean expressions
2019-01-03 20:01 [PATCH v2] drm/amdgpu_vm: fix boolean expressions Gustavo A. R. Silva
@ 2019-01-04 16:40 ` Ezequiel Garcia
2019-01-04 16:58 ` Gustavo A. R. Silva
2019-01-04 16:52 ` Alex Deucher
1 sibling, 1 reply; 4+ messages in thread
From: Ezequiel Garcia @ 2019-01-04 16:40 UTC (permalink / raw)
To: Gustavo A. R. Silva
Cc: Felix Kuehling, Harish Kasiviswanathan, Alex Deucher,
Christian König, David (ChunMing) Zhou, David Airlie,
Daniel Vetter, amd-gfx, dri-devel, Linux Kernel Mailing List
Hey Gustavo,
On Thu, 3 Jan 2019 at 17:25, Gustavo A. R. Silva <gustavo@embeddedor.com> wrote:
>
> Fix boolean expressions by using logical AND operator '&&'
> instead of bitwise operator '&'.
>
> This issue was detected with the help of Coccinelle.
>
> Fixes: 9a4b7d4c769e ("drm/amdgpu: Add vm context module param")
> Cc: stable@vger.kernel.org
> Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> ---
> Changes in v2:
> - Update Fixes tag.
>
This just fixes a user warning that would be wrongly reported, but
doesn't fix any other issue.
Why stable?
Thanks,
Eze
> drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> index e73d152659a2..4cc0d1079935 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -3006,7 +3006,7 @@ int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm,
> }
> DRM_DEBUG_DRIVER("VM update mode is %s\n",
> vm->use_cpu_for_update ? "CPU" : "SDMA");
> - WARN_ONCE((vm->use_cpu_for_update & !amdgpu_gmc_vram_full_visible(&adev->gmc)),
> + WARN_ONCE((vm->use_cpu_for_update && !amdgpu_gmc_vram_full_visible(&adev->gmc)),
> "CPU update of VM recommended only for large BAR system\n");
> vm->last_update = NULL;
>
> @@ -3136,7 +3136,7 @@ int amdgpu_vm_make_compute(struct amdgpu_device *adev, struct amdgpu_vm *vm, uns
> vm->pte_support_ats = pte_support_ats;
> DRM_DEBUG_DRIVER("VM update mode is %s\n",
> vm->use_cpu_for_update ? "CPU" : "SDMA");
> - WARN_ONCE((vm->use_cpu_for_update & !amdgpu_gmc_vram_full_visible(&adev->gmc)),
> + WARN_ONCE((vm->use_cpu_for_update && !amdgpu_gmc_vram_full_visible(&adev->gmc)),
> "CPU update of VM recommended only for large BAR system\n");
>
> if (vm->pasid) {
> --
> 2.20.1
>
--
Ezequiel García, VanguardiaSur
www.vanguardiasur.com.ar
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] drm/amdgpu_vm: fix boolean expressions
2019-01-03 20:01 [PATCH v2] drm/amdgpu_vm: fix boolean expressions Gustavo A. R. Silva
2019-01-04 16:40 ` Ezequiel Garcia
@ 2019-01-04 16:52 ` Alex Deucher
1 sibling, 0 replies; 4+ messages in thread
From: Alex Deucher @ 2019-01-04 16:52 UTC (permalink / raw)
To: Gustavo A. R. Silva
Cc: Felix Kuehling, Harish Kasiviswanathan, Alex Deucher,
Christian König, David (ChunMing) Zhou, David Airlie,
Daniel Vetter, Maling list - DRI developers, amd-gfx list, LKML
On Thu, Jan 3, 2019 at 3:21 PM Gustavo A. R. Silva
<gustavo@embeddedor.com> wrote:
>
> Fix boolean expressions by using logical AND operator '&&'
> instead of bitwise operator '&'.
>
> This issue was detected with the help of Coccinelle.
>
> Fixes: 9a4b7d4c769e ("drm/amdgpu: Add vm context module param")
> Cc: stable@vger.kernel.org
> Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Applied. thanks!
Alex
> ---
> Changes in v2:
> - Update Fixes tag.
>
> drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> index e73d152659a2..4cc0d1079935 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -3006,7 +3006,7 @@ int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm,
> }
> DRM_DEBUG_DRIVER("VM update mode is %s\n",
> vm->use_cpu_for_update ? "CPU" : "SDMA");
> - WARN_ONCE((vm->use_cpu_for_update & !amdgpu_gmc_vram_full_visible(&adev->gmc)),
> + WARN_ONCE((vm->use_cpu_for_update && !amdgpu_gmc_vram_full_visible(&adev->gmc)),
> "CPU update of VM recommended only for large BAR system\n");
> vm->last_update = NULL;
>
> @@ -3136,7 +3136,7 @@ int amdgpu_vm_make_compute(struct amdgpu_device *adev, struct amdgpu_vm *vm, uns
> vm->pte_support_ats = pte_support_ats;
> DRM_DEBUG_DRIVER("VM update mode is %s\n",
> vm->use_cpu_for_update ? "CPU" : "SDMA");
> - WARN_ONCE((vm->use_cpu_for_update & !amdgpu_gmc_vram_full_visible(&adev->gmc)),
> + WARN_ONCE((vm->use_cpu_for_update && !amdgpu_gmc_vram_full_visible(&adev->gmc)),
> "CPU update of VM recommended only for large BAR system\n");
>
> if (vm->pasid) {
> --
> 2.20.1
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] drm/amdgpu_vm: fix boolean expressions
2019-01-04 16:40 ` Ezequiel Garcia
@ 2019-01-04 16:58 ` Gustavo A. R. Silva
0 siblings, 0 replies; 4+ messages in thread
From: Gustavo A. R. Silva @ 2019-01-04 16:58 UTC (permalink / raw)
To: Ezequiel Garcia
Cc: Felix Kuehling, Harish Kasiviswanathan, Alex Deucher,
Christian König, David (ChunMing) Zhou, David Airlie,
Daniel Vetter, amd-gfx, dri-devel, Linux Kernel Mailing List
Hi Ezequiel,
On 1/4/19 10:40 AM, Ezequiel Garcia wrote:
> Hey Gustavo,
>
> On Thu, 3 Jan 2019 at 17:25, Gustavo A. R. Silva <gustavo@embeddedor.com> wrote:
>>
>> Fix boolean expressions by using logical AND operator '&&'
>> instead of bitwise operator '&'.
>>
>> This issue was detected with the help of Coccinelle.
>>
>> Fixes: 9a4b7d4c769e ("drm/amdgpu: Add vm context module param")
>> Cc: stable@vger.kernel.org
>> Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
>> ---
>> Changes in v2:
>> - Update Fixes tag.
>>
>
> This just fixes a user warning that would be wrongly reported, but
> doesn't fix any other issue.
>
> Why stable?
>
Yeah. In this case the tag can be removed.
Happy new year.
Thanks
--
Gustavo
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-01-04 16:58 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-03 20:01 [PATCH v2] drm/amdgpu_vm: fix boolean expressions Gustavo A. R. Silva
2019-01-04 16:40 ` Ezequiel Garcia
2019-01-04 16:58 ` Gustavo A. R. Silva
2019-01-04 16:52 ` Alex Deucher
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).