All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] drm/radeon: remove some buggy dead code
@ 2014-10-29 15:47 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2014-10-29 15:47 UTC (permalink / raw)
  To: Alex Deucher; +Cc: kernel-janitors, Christian König, dri-devel

The calculation of "num_shader_engines" has a precedence bug because
the right shift happens before the mask, but this variable is never used
so we can just delete it.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c
index a31f1ca..f37d39d 100644
--- a/drivers/gpu/drm/radeon/evergreen.c
+++ b/drivers/gpu/drm/radeon/evergreen.c
@@ -3005,7 +3005,7 @@ static void evergreen_gpu_init(struct radeon_device *rdev)
 	u32 vgt_cache_invalidation;
 	u32 hdp_host_path_cntl, tmp;
 	u32 disabled_rb_mask;
-	int i, j, num_shader_engines, ps_thread_count;
+	int i, j, ps_thread_count;
 
 	switch (rdev->family) {
 	case CHIP_CYPRESS:
@@ -3303,8 +3303,6 @@ static void evergreen_gpu_init(struct radeon_device *rdev)
 	rdev->config.evergreen.tile_config | 		((gb_addr_config & 0x30000000) >> 28) << 12;
 
-	num_shader_engines = (gb_addr_config & NUM_SHADER_ENGINES(3) >> 12) + 1;
-
 	if ((rdev->family >= CHIP_CEDAR) && (rdev->family <= CHIP_HEMLOCK)) {
 		u32 efuse_straps_4;
 		u32 efuse_straps_3;

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

* [patch] drm/radeon: remove some buggy dead code
@ 2014-10-29 15:47 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2014-10-29 15:47 UTC (permalink / raw)
  To: Alex Deucher; +Cc: kernel-janitors, Christian König, dri-devel

The calculation of "num_shader_engines" has a precedence bug because
the right shift happens before the mask, but this variable is never used
so we can just delete it.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c
index a31f1ca..f37d39d 100644
--- a/drivers/gpu/drm/radeon/evergreen.c
+++ b/drivers/gpu/drm/radeon/evergreen.c
@@ -3005,7 +3005,7 @@ static void evergreen_gpu_init(struct radeon_device *rdev)
 	u32 vgt_cache_invalidation;
 	u32 hdp_host_path_cntl, tmp;
 	u32 disabled_rb_mask;
-	int i, j, num_shader_engines, ps_thread_count;
+	int i, j, ps_thread_count;
 
 	switch (rdev->family) {
 	case CHIP_CYPRESS:
@@ -3303,8 +3303,6 @@ static void evergreen_gpu_init(struct radeon_device *rdev)
 	rdev->config.evergreen.tile_config |=
 		((gb_addr_config & 0x30000000) >> 28) << 12;
 
-	num_shader_engines = (gb_addr_config & NUM_SHADER_ENGINES(3) >> 12) + 1;
-
 	if ((rdev->family >= CHIP_CEDAR) && (rdev->family <= CHIP_HEMLOCK)) {
 		u32 efuse_straps_4;
 		u32 efuse_straps_3;
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [patch] drm/radeon: remove some buggy dead code
  2014-10-29 15:47 ` Dan Carpenter
@ 2014-10-29 16:26   ` Alex Deucher
  -1 siblings, 0 replies; 4+ messages in thread
From: Alex Deucher @ 2014-10-29 16:26 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Alex Deucher, kernel-janitors, Christian König,
	Maling list - DRI developers

On Wed, Oct 29, 2014 at 11:47 AM, Dan Carpenter
<dan.carpenter@oracle.com> wrote:
> The calculation of "num_shader_engines" has a precedence bug because
> the right shift happens before the mask, but this variable is never used
> so we can just delete it.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied in preference to Joe Perches's patch.

Thanks!

Alex

>
> diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c
> index a31f1ca..f37d39d 100644
> --- a/drivers/gpu/drm/radeon/evergreen.c
> +++ b/drivers/gpu/drm/radeon/evergreen.c
> @@ -3005,7 +3005,7 @@ static void evergreen_gpu_init(struct radeon_device *rdev)
>         u32 vgt_cache_invalidation;
>         u32 hdp_host_path_cntl, tmp;
>         u32 disabled_rb_mask;
> -       int i, j, num_shader_engines, ps_thread_count;
> +       int i, j, ps_thread_count;
>
>         switch (rdev->family) {
>         case CHIP_CYPRESS:
> @@ -3303,8 +3303,6 @@ static void evergreen_gpu_init(struct radeon_device *rdev)
>         rdev->config.evergreen.tile_config |>                 ((gb_addr_config & 0x30000000) >> 28) << 12;
>
> -       num_shader_engines = (gb_addr_config & NUM_SHADER_ENGINES(3) >> 12) + 1;
> -
>         if ((rdev->family >= CHIP_CEDAR) && (rdev->family <= CHIP_HEMLOCK)) {
>                 u32 efuse_straps_4;
>                 u32 efuse_straps_3;
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [patch] drm/radeon: remove some buggy dead code
@ 2014-10-29 16:26   ` Alex Deucher
  0 siblings, 0 replies; 4+ messages in thread
From: Alex Deucher @ 2014-10-29 16:26 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Alex Deucher, kernel-janitors, Christian König,
	Maling list - DRI developers

On Wed, Oct 29, 2014 at 11:47 AM, Dan Carpenter
<dan.carpenter@oracle.com> wrote:
> The calculation of "num_shader_engines" has a precedence bug because
> the right shift happens before the mask, but this variable is never used
> so we can just delete it.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied in preference to Joe Perches's patch.

Thanks!

Alex

>
> diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c
> index a31f1ca..f37d39d 100644
> --- a/drivers/gpu/drm/radeon/evergreen.c
> +++ b/drivers/gpu/drm/radeon/evergreen.c
> @@ -3005,7 +3005,7 @@ static void evergreen_gpu_init(struct radeon_device *rdev)
>         u32 vgt_cache_invalidation;
>         u32 hdp_host_path_cntl, tmp;
>         u32 disabled_rb_mask;
> -       int i, j, num_shader_engines, ps_thread_count;
> +       int i, j, ps_thread_count;
>
>         switch (rdev->family) {
>         case CHIP_CYPRESS:
> @@ -3303,8 +3303,6 @@ static void evergreen_gpu_init(struct radeon_device *rdev)
>         rdev->config.evergreen.tile_config |=
>                 ((gb_addr_config & 0x30000000) >> 28) << 12;
>
> -       num_shader_engines = (gb_addr_config & NUM_SHADER_ENGINES(3) >> 12) + 1;
> -
>         if ((rdev->family >= CHIP_CEDAR) && (rdev->family <= CHIP_HEMLOCK)) {
>                 u32 efuse_straps_4;
>                 u32 efuse_straps_3;
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2014-10-29 16:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-29 15:47 [patch] drm/radeon: remove some buggy dead code Dan Carpenter
2014-10-29 15:47 ` Dan Carpenter
2014-10-29 16:26 ` Alex Deucher
2014-10-29 16:26   ` Alex Deucher

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.