From: Colin Ian King <colin.king@canonical.com>
To: wharms@bfs.de
Cc: "Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"David Zhou" <David1.Zhou@amd.com>,
"David Airlie" <airlied@linux.ie>,
"Daniel Vetter" <daniel@ffwll.ch>,
amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH][next] drm/amdgpu/psp: fix incorrect logic when checking asic_type
Date: Thu, 4 Jul 2019 17:26:20 +0100 [thread overview]
Message-ID: <8f3385e9-4e53-b4b4-11ac-f77ec88bfc64@canonical.com> (raw)
In-Reply-To: <5D1E27B4.9000003@bfs.de>
On 04/07/2019 17:22, walter harms wrote:
>
>
> Am 04.07.2019 16:23, schrieb Colin King:
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> Currently the check of the asic_type is always returning true because
>> of the use of ||. Fix this by using && instead. Also break overly
>> wide line.
>>
>> Addresses-Coverity: ("Constant expression result")
>> Fixes: dab70ff24db6 ("drm/amdgpu/psp: add psp support for navi14")
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>> ---
>> drivers/gpu/drm/amd/amdgpu/psp_v11_0.c | 6 ++++--
>> 1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c b/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c
>> index 527dc371598d..e4afd34e3034 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c
>> @@ -540,7 +540,8 @@ psp_v11_0_sram_map(struct amdgpu_device *adev,
>>
>> case AMDGPU_UCODE_ID_RLC_G:
>> *sram_offset = 0x2000;
>> - if (adev->asic_type != CHIP_NAVI10 || adev->asic_type != CHIP_NAVI14) {
>> + if (adev->asic_type != CHIP_NAVI10 &&
>> + adev->asic_type != CHIP_NAVI14) {
>> *sram_addr_reg_offset = SOC15_REG_OFFSET(GC, 0, mmRLC_GPM_UCODE_ADDR);
>> *sram_data_reg_offset = SOC15_REG_OFFSET(GC, 0, mmRLC_GPM_UCODE_DATA);
>> } else {
>> @@ -551,7 +552,8 @@ psp_v11_0_sram_map(struct amdgpu_device *adev,
>>
>> case AMDGPU_UCODE_ID_SDMA0:
>> *sram_offset = 0x0;
>> - if (adev->asic_type != CHIP_NAVI10 || adev->asic_type != CHIP_NAVI14) {
>> + if (adev->asic_type != CHIP_NAVI10 &&
>> + adev->asic_type != CHIP_NAVI14) {
>> *sram_addr_reg_offset = SOC15_REG_OFFSET(SDMA0, 0, mmSDMA0_UCODE_ADDR);
>> *sram_data_reg_offset = SOC15_REG_OFFSET(SDMA0, 0, mmSDMA0_UCODE_DATA);
>> } else {
>
>
> maybe it is better to use
> if (adev->asic_type == CHIP_NAVI10 ||
> adev->asic_type == CHIP_NAVI14) {
>
> i guess tha was intended here and it is more easy to read.
> ppl are bad in non-non reading.
I'm not sure what the original intent was now. Lets see what the folk
at AMD say about this.
>
> re,
> wh
>
prev parent reply other threads:[~2019-07-04 16:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-04 14:23 Colin King
2019-07-04 16:22 ` walter harms
2019-07-04 16:26 ` Colin Ian King [this message]
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=8f3385e9-4e53-b4b4-11ac-f77ec88bfc64@canonical.com \
--to=colin.king@canonical.com \
--cc=David1.Zhou@amd.com \
--cc=airlied@linux.ie \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=wharms@bfs.de \
/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®