drm/amdgpu: fix a bogus warning

Submitted by Xie, AlexBin on Aug. 17, 2017, 9:03 p.m.

Details

Message ID DM5PR12MB1257A35DEC0C4086F7D9D16EF2830@DM5PR12MB1257.namprd12.prod.outlook.com
State New
Headers show
Series "drm/amdgpu: fix a bogus warning" ( rev: 2 ) in AMD X.Org drivers

Not browsing as part of any series.

Commit Message

Xie, AlexBin Aug. 17, 2017, 9:03 p.m.
Reviewed-by: Alex Xie <AlexBin.Xie@amd.com>

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 2554ddf..1a459ac 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -1077,8 +1077,9 @@  static void amdgpu_check_arguments(struct amdgpu_device *adev)
         }

         /* valid range is between 4 and 9 inclusive */
-       if (amdgpu_vm_fragment_size > 9 || amdgpu_vm_fragment_size < 4) {
-               dev_warn(adev->dev, "valid rang is between 4 and 9\n");
+       if (amdgpu_vm_fragment_size != -1 &&
+           (amdgpu_vm_fragment_size > 9 || amdgpu_vm_fragment_size < 4)) {
+               dev_warn(adev->dev, "valid range is between 4 and 9\n");
                 amdgpu_vm_fragment_size = -1;
         }


Comments

Reviewed-by: Christian König <christian.koenig@amd.com>

Am 17.08.2017 um 23:03 schrieb Xie, AlexBin:
>
> Reviewed-by: Alex Xie <AlexBin.Xie@amd.com>
>
>
>
> ------------------------------------------------------------------------
> *From:* amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of 
> Alex Deucher <alexdeucher@gmail.com>
> *Sent:* Thursday, August 17, 2017 4:44 PM
> *To:* amd-gfx@lists.freedesktop.org
> *Cc:* Deucher, Alexander
> *Subject:* [PATCH] drm/amdgpu: fix a bogus warning
> Don't validate the default value. Prevents a needless
> warning. Also fix a spelling typo in the warning message.
>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index 2554ddf..1a459ac 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -1077,8 +1077,9 @@ static void amdgpu_check_arguments(struct 
> amdgpu_device *adev)
>          }
>
>          /* valid range is between 4 and 9 inclusive */
> -       if (amdgpu_vm_fragment_size > 9 || amdgpu_vm_fragment_size < 4) {
> -               dev_warn(adev->dev, "valid rang is between 4 and 9\n");
> +       if (amdgpu_vm_fragment_size != -1 &&
> +           (amdgpu_vm_fragment_size > 9 || amdgpu_vm_fragment_size < 
> 4)) {
> +               dev_warn(adev->dev, "valid range is between 4 and 9\n");
>                  amdgpu_vm_fragment_size = -1;
>          }
>
> -- 
> 2.5.5
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
> amd-gfx Info Page - freedesktop.org 
> <https://lists.freedesktop.org/mailman/listinfo/amd-gfx>
> lists.freedesktop.org
> Subscribing to amd-gfx: Subscribe to amd-gfx by filling out the 
> following form. Use of all freedesktop.org lists is subject to our 
> Code of ...
>
>
>
>
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx