From: "Christian König" <christian.koenig@amd.com>
To: "Gustavo A. R. Silva" <garsilva@embeddedor.com>,
Alex Deucher <alexander.deucher@amd.com>,
David Airlie <airlied@linux.ie>,
Tom St Denis <tom.stdenis@amd.com>,
Chunming Zhou <David1.Zhou@amd.com>, Monk Liu <Monk.Liu@amd.com>,
Huang Rui <ray.huang@amd.com>
Cc: <amd-gfx@lists.freedesktop.org>,
<dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>,
Peter Senna Tschudin <peter.senna@gmail.com>
Subject: Re: [PATCH] gpu: drm: amd: amdgpu: remove dead code
Date: Tue, 9 May 2017 13:27:34 +0200 [thread overview]
Message-ID: <3356a8d8-2cb0-7572-7bd4-2b2e4c509441@amd.com> (raw)
In-Reply-To: <20170508164113.GA9196@embeddedgus>
Am 08.05.2017 um 18:41 schrieb Gustavo A. R. Silva:
> Local variable use_doorbell is assigned to a constant value and it is never
> updated again. Remove this variable and the dead code it guards.
>
> Addresses-Coverity-ID: 1401837
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Acked-by: Christian König <christian.koenig@amd.com> for this one and
the same patch for gfx_v8.
> ---
> drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | 20 ++++++--------------
> 1 file changed, 6 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
> index 1f93545..27ea28f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
> @@ -2936,7 +2936,6 @@ static int gfx_v7_0_cp_compute_resume(struct amdgpu_device *adev)
> {
> int r, i, j;
> u32 tmp;
> - bool use_doorbell = true;
> u64 hqd_gpu_addr;
> u64 mqd_gpu_addr;
> u64 eop_gpu_addr;
> @@ -3034,10 +3033,7 @@ static int gfx_v7_0_cp_compute_resume(struct amdgpu_device *adev)
> /* enable doorbell? */
> mqd->queue_state.cp_hqd_pq_doorbell_control =
> RREG32(mmCP_HQD_PQ_DOORBELL_CONTROL);
> - if (use_doorbell)
> - mqd->queue_state.cp_hqd_pq_doorbell_control |= CP_HQD_PQ_DOORBELL_CONTROL__DOORBELL_EN_MASK;
> - else
> - mqd->queue_state.cp_hqd_pq_doorbell_control &= ~CP_HQD_PQ_DOORBELL_CONTROL__DOORBELL_EN_MASK;
> + mqd->queue_state.cp_hqd_pq_doorbell_control |= CP_HQD_PQ_DOORBELL_CONTROL__DOORBELL_EN_MASK;
> WREG32(mmCP_HQD_PQ_DOORBELL_CONTROL,
> mqd->queue_state.cp_hqd_pq_doorbell_control);
>
> @@ -3116,23 +3112,19 @@ static int gfx_v7_0_cp_compute_resume(struct amdgpu_device *adev)
> mqd->queue_state.cp_hqd_pq_rptr_report_addr_hi);
>
> /* enable the doorbell if requested */
> - if (use_doorbell) {
> - mqd->queue_state.cp_hqd_pq_doorbell_control =
> + mqd->queue_state.cp_hqd_pq_doorbell_control =
> RREG32(mmCP_HQD_PQ_DOORBELL_CONTROL);
> - mqd->queue_state.cp_hqd_pq_doorbell_control &=
> + mqd->queue_state.cp_hqd_pq_doorbell_control &=
> ~CP_HQD_PQ_DOORBELL_CONTROL__DOORBELL_OFFSET_MASK;
> - mqd->queue_state.cp_hqd_pq_doorbell_control |=
> + mqd->queue_state.cp_hqd_pq_doorbell_control |=
> (ring->doorbell_index <<
> CP_HQD_PQ_DOORBELL_CONTROL__DOORBELL_OFFSET__SHIFT);
> - mqd->queue_state.cp_hqd_pq_doorbell_control |=
> + mqd->queue_state.cp_hqd_pq_doorbell_control |=
> CP_HQD_PQ_DOORBELL_CONTROL__DOORBELL_EN_MASK;
> - mqd->queue_state.cp_hqd_pq_doorbell_control &=
> + mqd->queue_state.cp_hqd_pq_doorbell_control &=
> ~(CP_HQD_PQ_DOORBELL_CONTROL__DOORBELL_SOURCE_MASK |
> CP_HQD_PQ_DOORBELL_CONTROL__DOORBELL_HIT_MASK);
>
> - } else {
> - mqd->queue_state.cp_hqd_pq_doorbell_control = 0;
> - }
> WREG32(mmCP_HQD_PQ_DOORBELL_CONTROL,
> mqd->queue_state.cp_hqd_pq_doorbell_control);
>
next prev parent reply other threads:[~2017-05-09 11:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-08 16:41 Gustavo A. R. Silva
2017-05-09 11:27 ` Christian König [this message]
2017-05-08 17:01 Gustavo A. R. Silva
2017-05-09 12:53 ` 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=3356a8d8-2cb0-7572-7bd4-2b2e4c509441@amd.com \
--to=christian.koenig@amd.com \
--cc=David1.Zhou@amd.com \
--cc=Monk.Liu@amd.com \
--cc=airlied@linux.ie \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=garsilva@embeddedor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peter.senna@gmail.com \
--cc=ray.huang@amd.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®