Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1143427pxb; Wed, 6 Apr 2022 09:43:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwxgo0rmMwcdCVe+TBod9IOK8vvP3QYLU7bFSZe/7TvoWVTBQQdf4FtecKVtlWbXtft1Bok X-Received: by 2002:a17:903:11c7:b0:151:9769:3505 with SMTP id q7-20020a17090311c700b0015197693505mr9376302plh.72.1649263414470; Wed, 06 Apr 2022 09:43:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649263414; cv=none; d=google.com; s=arc-20160816; b=F9mSPdGfBdMQqqKDnJBW+wyAeY7SBZQf0Qk7ee59PRG1JSUj398M6zY+wyNiG/77Be YNogJHvoq67cyzVMvobyYYzFXar+UYqsj3YXKAudXMZAwEc9X0WTebFwIkPYA4cgalWm 1q/8ay+q6Q/85kEmDYHPNkgOlh5lPwFSx7AhNASnuSwB3v4iGlIppGbt8LqLxHnCzsJS BCKc+9/kBmoruv3jU6zAPcUmGypxNG7dSkVHarzfxiDnIW3uOdAiSsFlm+YjveqMe+kB 45Am2eO+pvi85ZCHsdHIRKpPcBRr0JE0r5t6jSdl6I+DCZB0rxcnTKSsCHBySMjTSJ0t Bs2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=nR+sDilSKYVfN9qDJ/g98wvIu+WPZhJinVPgYGsVVDE=; b=PaiwG82aOpwkWXqip1wLJVW6GarkLlucvd8aVym0BytZ3dOVfkGdSnyPcITK5U9s7y PNKBcVGxUJNsIRjKFzth8Uldr/ql3WA/PizVgmIyPlbkVQWNWjB1FJhQYpeDfhb6MubI HsUMZhgKgdA308I0Q633J3kcDPSf4zAcJtG8rX32Xx/Coyfn0Q7JLizTbK2Rw7Az2NT3 QvR+mlCQKA+4ZiXbYhUnTA1zEJrF1s889gRdMufn8GNa1mRTuWrxr6xM4xmwn03C3Dwu jmn8Eb3rFnLrNZWoaL9x4IVDQEQ2A6mlq7cZDhsi/xAPovd6IMGc/OqAhSmRJKPv07FK 6B6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=iprevJ6F; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id s10-20020a63b40a000000b003816043f0f0si15595709pgf.741.2022.04.06.09.43.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 09:43:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=iprevJ6F; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2E7132EC51F; Wed, 6 Apr 2022 08:54:31 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236843AbiDFP4V (ORCPT + 99 others); Wed, 6 Apr 2022 11:56:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236730AbiDFP4O (ORCPT ); Wed, 6 Apr 2022 11:56:14 -0400 Received: from mail-oi1-x235.google.com (mail-oi1-x235.google.com [IPv6:2607:f8b0:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22FEB24A12A for ; Wed, 6 Apr 2022 06:20:01 -0700 (PDT) Received: by mail-oi1-x235.google.com with SMTP id e189so2329754oia.8 for ; Wed, 06 Apr 2022 06:20:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=nR+sDilSKYVfN9qDJ/g98wvIu+WPZhJinVPgYGsVVDE=; b=iprevJ6Fyj+Zg9sDtMftRf78BwUL9DqO4cEkI/ScLzlTDexBgwMjru/ra3o0B7l1gu OJ20vYFsppHRlvKzZC28kzKR1hMyQwEsq9luV9cffZWeNE3vD+xf2WJv0Ca0dXadfQlj 953oj+T6OUBOFGr+ot77RkmEcJoYJLsVMzPoMCP3RjNP7dekojnm6Fk8nu37iGq0duT8 e08lmohwbasaykFFyW0Y/V5gQmgMHRDYdkmMKNwiglGCPR+86ugUxeRMo0SxI3b4z3Wx D+4wb3YcZzZLkr6ytY77qTmzkcgBjeoIIkpuRsjLV7h5+4hL294JmkK+1N9vxQ5eNgOf joTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nR+sDilSKYVfN9qDJ/g98wvIu+WPZhJinVPgYGsVVDE=; b=rCGQlgvVnzUO5PlxpMkStYfk6tmE5W+VJbQ3xGsPEFuKhexSY9rfqexS65EErrJykT bFKmSPCOkwuZlg6eTC5Fe+smXhzxSJbhf+dkKbEp+hW852RGsiQgfhQ2vxbpe64iNXPv io4sqlosvIQqHVSyMjSMect8haTt6HOZ/Oj6PBY5I1jvSYrGsg5ETBA55zbMgbKObNaF 7NTAVy0W5Wgz1cHDVqm1O9Bmu1TYjMLhq6PGO2l1mzPwQprqC59ubXaGn5xNiAcb84V2 MFM6IRyzppABmekl78w3XoI5Raq5Sij6JXyyZ2aOntNTsjOxereVwbiHtPlZ5FFuVBbD 0z0g== X-Gm-Message-State: AOAM530ijTQLCpeeBHDwSZxVr1FqA5xj6Qt0/IQhwpDRdO0BGXrEeFQn LL4Ne2nEhBL7yEh5ii3BoPcXPKD+N5SsoDHPZtA= X-Received: by 2002:aca:d04:0:b0:2ef:8b45:d235 with SMTP id 4-20020aca0d04000000b002ef8b45d235mr3630825oin.253.1649251200316; Wed, 06 Apr 2022 06:20:00 -0700 (PDT) MIME-Version: 1.0 References: <20220405213800.90205-1-h0tc0d3@gmail.com> In-Reply-To: <20220405213800.90205-1-h0tc0d3@gmail.com> From: Alex Deucher Date: Wed, 6 Apr 2022 09:19:49 -0400 Message-ID: Subject: Re: [PATCH] drm/amdgpu: Unnecessary code in gfx_v7_0.c To: Grigory Vasilyev Cc: Rodrigo Siqueira , Melissa Wen , Bhaskar Chowdhury , Joseph Greathouse , Guchun Chen , "Pan, Xinhui" , LKML , amd-gfx list , David Airlie , Maling list - DRI developers , Alex Deucher , Evan Quan , Lee Jones , =?UTF-8?Q?Christian_K=C3=B6nig?= Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 6, 2022 at 4:00 AM Grigory Vasilyev wrote: > > The code is useless and doesn't change the value. > > (0 << GB_ADDR_CONFIG__ROW_SIZE__SHIFT) = 0 > gb_addr_config | 0 = gb_addr_config > > Perhaps there could be 1 instead of 0, but this does not correspond with > the logic of the switch. It doesn't do anything, but it helps the developer to understand how the driver state maps to hardware state. Alex > > Signed-off-by: Grigory Vasilyev > --- > drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c > index 1cb5db17d2b9..5ed84a6467ee 100644 > --- a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c > +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c > @@ -4409,16 +4409,14 @@ static void gfx_v7_0_gpu_early_init(struct amdgpu_device *adev) > /* fix up row size */ > gb_addr_config &= ~GB_ADDR_CONFIG__ROW_SIZE_MASK; > switch (adev->gfx.config.mem_row_size_in_kb) { > - case 1: > - default: > - gb_addr_config |= (0 << GB_ADDR_CONFIG__ROW_SIZE__SHIFT); > - break; > case 2: > gb_addr_config |= (1 << GB_ADDR_CONFIG__ROW_SIZE__SHIFT); > break; > case 4: > gb_addr_config |= (2 << GB_ADDR_CONFIG__ROW_SIZE__SHIFT); > break; > + default: > + break; > } > adev->gfx.config.gb_addr_config = gb_addr_config; > } > -- > 2.35.1 >