Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2363547ybi; Thu, 4 Jul 2019 09:35:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqx7ZKFrHfaaYSZRFnb8C9cHngVEy2IjjHRR7nIpTWvlXPlwYY2cbYCXWgqb4vsZ5TnNK4oM X-Received: by 2002:a63:5114:: with SMTP id f20mr29891001pgb.173.1562258121530; Thu, 04 Jul 2019 09:35:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562258121; cv=none; d=google.com; s=arc-20160816; b=JLs9mZqvHKqNtW7371Nnzpz4K9Mz8WQpazBabseHIqP7m60UsQqjnOgsOpIJXAYIYT BhoY6/iGCQwkfGoyoyzQChJDnbyr+UBDeC3kb124MNGH/Htkv9xGdvf3oWMazd62QsoZ a8zU1IX63pRkCmchSdbUlmG2/dFH7IOXez4ITW81zsLm7Z1RDKYl5KiC9LxuNy5ekybz FsC7zK2v4P6wTxOoABTMVZseNLRHu/DQDI0Gqy+Raa0gNORNF1BUM8Dn740hDiChUZeD Adoy4g2DwnLsi8KsFGcq/9SbpXcFxSHJT5FbOw1NXUKRo16pgbXLFPqpJOFC2N0mAk9o 4VdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :references:subject:cc:to:mime-version:user-agent:reply-to:from:date :message-id:dkim-signature; bh=jaFxumsbIvgDr1oe7Gu7eEItmhTPfpnc41s1w8Cw8C8=; b=zkTxVclIIj6ENWlj+z0tD6bk6lePIhJr5cOLeE+TxQAvz0Z9XaIHHJqy1MLjET3w4D 3QP9tBMf7q5oJG5OghgXErJ60qzPs2lhKtXMbUZ5awrc4fSNwlAxDqIR5N5KpoUnpi04 u/11Z1ngpf4Pqy0u/uzCpFOi18pdB/e8S7H/eDtrYO2VrQWTl7jQoWETaDjKLLxm1jce web6K0RRfetnbafg0JEsDEPCqolD0uTvxMYDMDYu8WXAxwkcghL9ROLIyXbPAVptBMIs XDDEMVVJBthHgwXCMHMH4yNI8lwriiBUQMTsayQwEuVOUV9Wkohi4BwlCQWvpf2Gk7NY bifQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@bfs.de header.s=dkim201901 header.b="oOz5/INU"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g13si5899211pgr.577.2019.07.04.09.34.28; Thu, 04 Jul 2019 09:35:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@bfs.de header.s=dkim201901 header.b="oOz5/INU"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727122AbfGDQWW (ORCPT + 99 others); Thu, 4 Jul 2019 12:22:22 -0400 Received: from mx01-fr.bfs.de ([193.174.231.67]:50264 "EHLO mx01-fr.bfs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727044AbfGDQWW (ORCPT ); Thu, 4 Jul 2019 12:22:22 -0400 Received: from mail-fr.bfs.de (mail-fr.bfs.de [10.177.18.200]) by mx01-fr.bfs.de (Postfix) with ESMTPS id DA27920218; Thu, 4 Jul 2019 18:22:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bfs.de; s=dkim201901; t=1562257334; h=from:from:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jaFxumsbIvgDr1oe7Gu7eEItmhTPfpnc41s1w8Cw8C8=; b=oOz5/INU3oEaMkX8uIJCsxzJMHv+cm/MtyDtpqKDGEfZFTtBX3FBswAPSfdn3kJJsMjhtd Hc2CS0nhd66uaF4cZEJqZofQohfkywmbqwJQtHO6sy0q/2NUlUIgPL76l0osm+2Myu+0/8 DpQkPr5p2OF7sCHAH/Xm7e+3OPt1qtkIEoMtecfgDjghxuXjoBMhMER2QQMgbK21Zn/cLM WCFwSPRb9Z6xtwqDDbZpdwq+COl+OSyxhD5rJl7ZzgiQjYjIuuOJ0vwc5+YnxK5muRmlOQ gEz8B/HkVChsUqQN/4VQww02A72N8q/uUbyK7a0DB3IDas170rRZWE/6ljk3sg== Received: from [134.92.181.33] (unknown [134.92.181.33]) by mail-fr.bfs.de (Postfix) with ESMTPS id 36779BEEBD; Thu, 4 Jul 2019 18:22:13 +0200 (CEST) Message-ID: <5D1E27B4.9000003@bfs.de> Date: Thu, 04 Jul 2019 18:22:12 +0200 From: walter harms Reply-To: wharms@bfs.de User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.1.16) Gecko/20101125 SUSE/3.0.11 Thunderbird/3.0.11 MIME-Version: 1.0 To: Colin King CC: Alex Deucher , =?UTF-8?B?Q2hyaXN0aWFuIEvDtg==?= =?UTF-8?B?bmln?= , David Zhou , David Airlie , Daniel Vetter , 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 References: <20190704142329.22983-1-colin.king@canonical.com> In-Reply-To: <20190704142329.22983-1-colin.king@canonical.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.10 Authentication-Results: mx01-fr.bfs.de X-Spamd-Result: default: False [-3.10 / 7.00]; HAS_REPLYTO(0.00)[wharms@bfs.de]; TO_DN_SOME(0.00)[]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCPT_COUNT_SEVEN(0.00)[10]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; MID_RHS_MATCH_FROM(0.00)[]; BAYES_HAM(-3.00)[100.00%]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DKIM_SIGNED(0.00)[]; NEURAL_HAM(-0.00)[-0.999,0]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 04.07.2019 16:23, schrieb Colin King: > From: Colin Ian King > > 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 > --- > 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. re, wh