Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1256144 > unrolled thread

RE: [PATCH 38/38] drm/radeon: simplify boot level calculation

Started by"Deucher, Alexander" <Alexander.Deucher@amd.com>
First post2015-10-26 17:30 +0100
Last post2015-10-26 17:30 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  RE: [PATCH 38/38] drm/radeon: simplify boot level calculation "Deucher, Alexander" <Alexander.Deucher@amd.com> - 2015-10-26 17:30 +0100

#1256144 — RE: [PATCH 38/38] drm/radeon: simplify boot level calculation

From"Deucher, Alexander" <Alexander.Deucher@amd.com>
Date2015-10-26 17:30 +0100
SubjectRE: [PATCH 38/38] drm/radeon: simplify boot level calculation
Message-ID<qnSOL-23f-13@gated-at.bofh.it>
> -----Original Message-----
> From: Andrzej Hajda [mailto:a.hajda@samsung.com]
> Sent: Monday, September 21, 2015 9:34 AM
> To: linux-kernel@vger.kernel.org
> Cc: Andrzej Hajda; Bartlomiej Zolnierkiewicz; Marek Szyprowski; David Airlie;
> Deucher, Alexander; Koenig, Christian; dri-devel@lists.freedesktop.org
> Subject: [PATCH 38/38] drm/radeon: simplify boot level calculation
> 
> The patch simplifies the code without changing behaviour, but most
> problably there is a bug somewhere else.

I'd prefer the leave the code as is in case we ever add ACP support to these asics.

Thanks,

Alex

> 
> The problem has been detected using proposed semantic patch
> scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1].
> 
> [1]: http://permalink.gmane.org/gmane.linux.kernel/2038576
> 
> Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/kv_dpm.c | 11 +----------
>  drivers/gpu/drm/radeon/kv_dpm.c     | 11 +----------
>  2 files changed, 2 insertions(+), 20 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/kv_dpm.c
> b/drivers/gpu/drm/amd/amdgpu/kv_dpm.c
> index 94ec04a..f9cfc56 100644
> --- a/drivers/gpu/drm/amd/amdgpu/kv_dpm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/kv_dpm.c
> @@ -1622,19 +1622,10 @@ static int kv_update_samu_dpm(struct
> amdgpu_device *adev, bool gate)
> 
>  static u8 kv_get_acp_boot_level(struct amdgpu_device *adev)
>  {
> -	u8 i;
>  	struct amdgpu_clock_voltage_dependency_table *table =
>  		&adev-
> >pm.dpm.dyn_state.acp_clock_voltage_dependency_table;
> 
> -	for (i = 0; i < table->count; i++) {
> -		if (table->entries[i].clk >= 0) /* XXX */
> -			break;
> -	}
> -
> -	if (i >= table->count)
> -		i = table->count - 1;
> -
> -	return i;
> +	return table->count ? 0 : -1;
>  }
> 
>  static void kv_update_acp_boot_level(struct amdgpu_device *adev)
> diff --git a/drivers/gpu/drm/radeon/kv_dpm.c
> b/drivers/gpu/drm/radeon/kv_dpm.c
> index 2d71da4..dc9aab5 100644
> --- a/drivers/gpu/drm/radeon/kv_dpm.c
> +++ b/drivers/gpu/drm/radeon/kv_dpm.c
> @@ -1546,19 +1546,10 @@ static int kv_update_samu_dpm(struct
> radeon_device *rdev, bool gate)
> 
>  static u8 kv_get_acp_boot_level(struct radeon_device *rdev)
>  {
> -	u8 i;
>  	struct radeon_clock_voltage_dependency_table *table =
>  		&rdev-
> >pm.dpm.dyn_state.acp_clock_voltage_dependency_table;
> 
> -	for (i = 0; i < table->count; i++) {
> -		if (table->entries[i].clk >= 0) /* XXX */
> -			break;
> -	}
> -
> -	if (i >= table->count)
> -		i = table->count - 1;
> -
> -	return i;
> +	return table->count ? 0 : -1;
>  }
> 
>  static void kv_update_acp_boot_level(struct radeon_device *rdev)
> --
> 1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web