Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1151002pxb; Wed, 6 Apr 2022 09:55:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnU4JgblWfblfoofinosjopPXNl1grlowyqhRsZj4xYbJJoFrYnwMk7SekxHIKBZ5XRUtr X-Received: by 2002:a17:90b:1b4e:b0:1c6:fff4:34dc with SMTP id nv14-20020a17090b1b4e00b001c6fff434dcmr11038655pjb.76.1649264112083; Wed, 06 Apr 2022 09:55:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649264112; cv=none; d=google.com; s=arc-20160816; b=KL+iTGP61VxIFZu35DykNKaRSJy1n4un8dS1X7FpQXOox+7fKlfcZYuK4YZFLdomJC 0uOVycYE95fKrKhkaOFjL1l5nPBlOGNBc4kG4yUaMy5DbzW6I9u6l8Y+YxuH3cBCVobD 2IrdTQU3GzLvpGtiuLxy+zx7VahcSfooEVnRbTlOZMUtcPoNiXGft+POZV7aMbdasCOe AOFyW54XQLGltVg753L0DV5GqNgy54lmgZ7HRfXp5SHqZs9XfCiqXIn3ggwPEpvkoIDo 34tQuZcRo8du8efcXw8hV+wa3E7y+yzB4aIWQ9K4dadpip2BQv4RLZbkj/zJ9it/HU4C Huig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=iyJLK8l5hs8KCNBFxlx1llqa+FYfySe8JZbdJuv2BSY=; b=s4eVFFMpGYhdj/csqXRIAbRfawbCx5wjlDiJGdMKwOUb3bVluEZjy4ORZdmhDyE1Ml fVl3doiJE54keP6g7mjqFCgdRyM21iN7y/Ogmwh6e4dtW7oB09uZ2JWiS3WMQXanyQ9c qslQNNM8XbZ47DL4CuF2fg2cX+H9S+M8asWhisetGehwd00KJAgBitsDIKRx50EvEOuW w9td7M/P+k1OWEPIyp+DqfjOL8s05gZzeWVDpwAgPUL96J4sva69XlKAKQUBv4Xq8PBY rsyTvyUXH0a1t+QQGvyxbpunJczjMfRYP5Ru+7a997GER2u7CMlXJmPaifOdDHK3AVhd UCfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=AZPHzmAk; 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 p6-20020a170902e74600b001569eedd2dasi11045940plf.408.2022.04.06.09.55.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 09:55:12 -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=AZPHzmAk; 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 3C4F62AA876; Wed, 6 Apr 2022 09:09:57 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237381AbiDFQLs (ORCPT + 99 others); Wed, 6 Apr 2022 12:11:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237373AbiDFQLf (ORCPT ); Wed, 6 Apr 2022 12:11:35 -0400 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 836154E0035 for ; Wed, 6 Apr 2022 06:39:49 -0700 (PDT) Received: by mail-ej1-x62e.google.com with SMTP id a6so4454371ejk.0 for ; Wed, 06 Apr 2022 06:39:49 -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:content-transfer-encoding; bh=iyJLK8l5hs8KCNBFxlx1llqa+FYfySe8JZbdJuv2BSY=; b=AZPHzmAkPb4vBz8KQIFg70PyU76BInADKyX8st0Ig2+U518SEl0fYZpUw9xiNqn87K aFxAL3Rzj+bm6m248CxtYI2apq5TfG0PFHHUmZ81yjVBfZyky+nQJ/y68jjzZEoz3IVP 2ZeHrhjWp7zRdPFnB94aJ4/AKOIGQDHMVIHBYN9336v/0QdlpMxxmRvr9byy1Bbv4vDL t/8yFF66Fj9bRZzxcLG0bXKl15HjhRZclLJAUz756gQUgnTvBYY20cHN7doi1i5nWcX4 ErVcNb4eFZDmVj0lZzaKcxqtV9IkWmD3avg4JPdWRFGAV0+pyTjszJMDk1upXk7xhzUN JwKw== 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:content-transfer-encoding; bh=iyJLK8l5hs8KCNBFxlx1llqa+FYfySe8JZbdJuv2BSY=; b=U+DoP9+SCQIW9mWelHpeg3+c5hosev8xFySgzH8gaszeGvBL+JPRvPhNJlgCOMHDel UGaxAfzi2uhCOE+vcn30D6CiHwO9R5MUMsiteMvyjz3HmkMra3+1eKxZs+XhguqEJl9N zkEkbCcL/Om6RC6maIvfkJkiehx1cUxKFGXwK9VJKHQBckFqc/KnzmTKCcKfEtJ3ymbY oewVhfiH+JhQVxURhRv3yjkZUbC64nRSC75Gz02HqjN46Ya0FH3uDvVOq3KczTtWQHpb QwWev1K28vU2Uq+WI83GAiEsgF53H7ss0L17a+uSlnbHw0W00UpZQgPZ0XDXiUNXoUgG pMtw== X-Gm-Message-State: AOAM533tQAu4yrhNVi+L2fks5uhcOghRzv0nF8p7oeK2FRX6H31w+dCo NUU4xOoZPEH0POd5dUgWmW6mqUynXjARD8pdJjc= X-Received: by 2002:a17:906:7947:b0:6da:892f:2503 with SMTP id l7-20020a170906794700b006da892f2503mr8161523ejo.710.1649252387873; Wed, 06 Apr 2022 06:39:47 -0700 (PDT) MIME-Version: 1.0 References: <20220405213800.90205-1-h0tc0d3@gmail.com> In-Reply-To: From: =?UTF-8?B?0JPRgNC40LPQvtGA0LjQuQ==?= Date: Wed, 6 Apr 2022 16:39:46 +0300 Message-ID: Subject: Re: [PATCH] drm/amdgpu: Unnecessary code in gfx_v7_0.c To: Alex Deucher 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" Content-Transfer-Encoding: quoted-printable 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 Alex Deucher, Thanks, that's what I thought too. But this code is uninformative, and without it is clear what this code is doing. If you need to provide additional information on how the code works, then for me it's better to leave a comment. This is actually more like a bug than an explanation of what the code is do= ing. =D1=81=D1=80, 6 =D0=B0=D0=BF=D1=80. 2022 =D0=B3. =D0=B2 16:20, Alex Deucher= : > > 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) =3D 0 > > gb_addr_config | 0 =3D gb_addr_config > > > > Perhaps there could be 1 instead of 0, but this does not correspond wit= h > > 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/am= d/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 amdg= pu_device *adev) > > /* fix up row size */ > > gb_addr_config &=3D ~GB_ADDR_CONFIG__ROW_SIZE_MASK; > > switch (adev->gfx.config.mem_row_size_in_kb) { > > - case 1: > > - default: > > - gb_addr_config |=3D (0 << GB_ADDR_CONFIG__ROW_SIZE__SHI= FT); > > - break; > > case 2: > > gb_addr_config |=3D (1 << GB_ADDR_CONFIG__ROW_SIZE__SHI= FT); > > break; > > case 4: > > gb_addr_config |=3D (2 << GB_ADDR_CONFIG__ROW_SIZE__SHI= FT); > > break; > > + default: > > + break; > > } > > adev->gfx.config.gb_addr_config =3D gb_addr_config; > > } > > -- > > 2.35.1 > >