All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: David Airlie <airlied@linux.ie>, Jammy Zhou <Jammy.Zhou@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>,
	Tom St Denis <tom.stdenis@amd.com>,
	kernel-janitors@vger.kernel.org, Rex Zhu <Rex.Zhu@amd.com>,
	dri-devel@lists.freedesktop.org
Subject: [patch] drm/amd/powerplay: precedence bug in init_non_clock_fields()
Date: Mon, 04 Jan 2016 20:44:24 +0000	[thread overview]
Message-ID: <20160104204424.GD19867@mwanda> (raw)

The cast to uint8_t happens before the right shift so this always sets
.m3arb to zero.  The cast is actually a no-op so we can remove it.

Fixes: 3bace3591493 ('drm/amd/powerplay: add hardware manager sub-component')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
Static analysis stuff.  Not tested.

diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c b/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c
index 1d385f4..9031a44 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c
@@ -735,8 +735,8 @@ static int init_non_clock_fields(struct pp_hwmgr *hwmgr,
 
 	ps->memory.dllOff = (0 != tmp);
 
-	ps->memory.m3arb = (uint8_t)(le32_to_cpu(pnon_clock_info->ulCapsAndSettings) &
-						ATOM_PPLIB_M3ARB_MASK) >> ATOM_PPLIB_M3ARB_SHIFT;
+	ps->memory.m3arb = (le32_to_cpu(pnon_clock_info->ulCapsAndSettings) &
+			    ATOM_PPLIB_M3ARB_MASK) >> ATOM_PPLIB_M3ARB_SHIFT;
 
 	ps->temperatures.min = PP_TEMPERATURE_UNITS_PER_CENTIGRADES *
 				     pnon_clock_info->ucMinTemperature;

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: David Airlie <airlied@linux.ie>, Jammy Zhou <Jammy.Zhou@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>,
	Tom St Denis <tom.stdenis@amd.com>,
	kernel-janitors@vger.kernel.org, Rex Zhu <Rex.Zhu@amd.com>,
	dri-devel@lists.freedesktop.org
Subject: [patch] drm/amd/powerplay: precedence bug in init_non_clock_fields()
Date: Mon, 4 Jan 2016 23:44:24 +0300	[thread overview]
Message-ID: <20160104204424.GD19867@mwanda> (raw)

The cast to uint8_t happens before the right shift so this always sets
.m3arb to zero.  The cast is actually a no-op so we can remove it.

Fixes: 3bace3591493 ('drm/amd/powerplay: add hardware manager sub-component')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
Static analysis stuff.  Not tested.

diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c b/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c
index 1d385f4..9031a44 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c
@@ -735,8 +735,8 @@ static int init_non_clock_fields(struct pp_hwmgr *hwmgr,
 
 	ps->memory.dllOff = (0 != tmp);
 
-	ps->memory.m3arb = (uint8_t)(le32_to_cpu(pnon_clock_info->ulCapsAndSettings) &
-						ATOM_PPLIB_M3ARB_MASK) >> ATOM_PPLIB_M3ARB_SHIFT;
+	ps->memory.m3arb = (le32_to_cpu(pnon_clock_info->ulCapsAndSettings) &
+			    ATOM_PPLIB_M3ARB_MASK) >> ATOM_PPLIB_M3ARB_SHIFT;
 
 	ps->temperatures.min = PP_TEMPERATURE_UNITS_PER_CENTIGRADES *
 				     pnon_clock_info->ucMinTemperature;
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

             reply	other threads:[~2016-01-04 20:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-04 20:44 Dan Carpenter [this message]
2016-01-04 20:44 ` [patch] drm/amd/powerplay: precedence bug in init_non_clock_fields() Dan Carpenter
2016-01-04 21:22 ` Alex Deucher
2016-01-04 21:22   ` Alex Deucher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160104204424.GD19867@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=Jammy.Zhou@amd.com \
    --cc=Rex.Zhu@amd.com \
    --cc=airlied@linux.ie \
    --cc=alexander.deucher@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=tom.stdenis@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.