Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4008908ybi; Mon, 15 Jul 2019 02:26:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqwMKQIkn/+UizsYpNoYXAFHmsby/qeoULigRGtPaygP62YuYUndsbQNDaoohuUwjNivtMiF X-Received: by 2002:a63:2ad5:: with SMTP id q204mr12974867pgq.140.1563182787570; Mon, 15 Jul 2019 02:26:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563182787; cv=none; d=google.com; s=arc-20160816; b=B1VCvN/Pr1GSzo0C4mAPzg1ZzSWtsJDl/AIykYSwPVe9PlmPyg+AD36vHYbe3Nl1Rj VVk+wyf+mQNcAV30nqkETANaqyv8r2f2cC/A2s2BYjLTCmUot5+J15BFngx078qrFI71 X17dvu+hYH+az+69zghmOUf2E90AQEwpX07V9EfGaHkal0SH75D6LVMgCJGyaP4zlZrf 8Zn/2ojl39/+AsiR8C8odHLjm8PXtPn/XaPOJWM9hEN/MLL+9cYTeM9mqE5VMaSlO2DX 4C0Jn0wj5NBkDgXfX/WdqHAgu8p/i5r3edoJGFRQSX+mPkGdzFPTGdTgS/Tm+cwkyV9T nKQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=rPkUhtxg4MFrjNr+Dr5xrJl5bg2MfLxjRYrMvZrd2ec=; b=WqwySKaVwwrwm3W0QGQY48E2/vbZeyE1YOnGgdJoLmPGRolfsTSIdRkGTatvavwfEp TfYb6HJWK8SdaTZ74j7c4kxyr1akvJ0LSP9C7xXJEfzuLBl2haX9WtVkYdp/vRwdUmBU nlfq2981G/SAnyr0dIIHOFxxDjY9EH7u51KbFl76PZEg1+ZSaXYQiEKC01S0+PN/gulQ LyDTFXACb2nK25/U4plO8d9PsPCDWTLiATou6m4MJE04/wUOqOwNIhp17/ujWMTilSIp 4ZcFBk86y92G1f9/CdHwDq/EAztRqcWhmzu/G/czVbklSQ35kYYc4SBDg5FaJjgbSvIb pnXA== ARC-Authentication-Results: i=1; mx.google.com; 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 65si15737099ple.240.2019.07.15.02.26.11; Mon, 15 Jul 2019 02:26:27 -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; 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 S1729617AbfGOJZr (ORCPT + 99 others); Mon, 15 Jul 2019 05:25:47 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:40888 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729394AbfGOJZq (ORCPT ); Mon, 15 Jul 2019 05:25:46 -0400 Received: by mail-qk1-f196.google.com with SMTP id s145so11046293qke.7 for ; Mon, 15 Jul 2019 02:25:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=rPkUhtxg4MFrjNr+Dr5xrJl5bg2MfLxjRYrMvZrd2ec=; b=gP7sh1dNi+v9wtb47wHxlGhwMMdYRbmdbnQeqiu2B0LNj4+FOncY/hWbvCfQiayCSp dT2V/gVMT0ZPWxCFIbjOw+FGF7a6RJIbbvnAeO9HVCHVO21TYl32Q7LE76OrylmhX22m 9TdpvTL8t3N25WkU9MxWO5woO0MKbciGjFn1Zki5C+HEt3kWmjaCV0rZmU2WmR5LZzgy 2Vr+NC5Ih7+dBsBAb+TN2IwziABnV9SXXjRaHE5IFT55tc3Am/9lc2UJSm5czq2yF0QE WEPxgXGTFpcK8hJ7sDaTackqhdOoQwFMS0h5uVEBCxvaMCxYcxMD1hofBZXghqmrlvy4 Rdkg== X-Gm-Message-State: APjAAAX+jnBAv625A4OCxQSDcFLrkWfUxnBlnFKRx6ZQlnsrjTBOXPbB +fuSGSBMWDGOyXCtyC6Gq6PgB4QZq/g3a1ax/0o= X-Received: by 2002:a37:5f45:: with SMTP id t66mr15941069qkb.286.1563182746083; Mon, 15 Jul 2019 02:25:46 -0700 (PDT) MIME-Version: 1.0 References: <20190704055217.45860-1-natechancellor@gmail.com> <20190704055217.45860-7-natechancellor@gmail.com> In-Reply-To: <20190704055217.45860-7-natechancellor@gmail.com> From: Arnd Bergmann Date: Mon, 15 Jul 2019 11:25:29 +0200 Message-ID: Subject: Re: [PATCH 6/7] drm/amd/powerplay: Use proper enums in vega20_print_clk_levels To: Nathan Chancellor Cc: Alex Deucher , =?UTF-8?Q?Christian_K=C3=B6nig?= , "David (ChunMing) Zhou" , Harry Wentland , Leo Li , Rex Zhu , Evan Quan , David Airlie , Daniel Vetter , amd-gfx list , dri-devel , Linux Kernel Mailing List , clang-built-linux , Kevin Wang Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 4, 2019 at 7:52 AM Nathan Chancellor wrote: > > clang warns: > > drivers/gpu/drm/amd/amdgpu/../powerplay/vega20_ppt.c:995:39: warning: > implicit conversion from enumeration type 'PPCLK_e' to different > enumeration type 'enum smu_clk_type' [-Wenum-conversion] > ret = smu_get_current_clk_freq(smu, PPCLK_SOCCLK, &now); > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~ > drivers/gpu/drm/amd/amdgpu/../powerplay/vega20_ppt.c:1016:39: warning: > implicit conversion from enumeration type 'PPCLK_e' to different > enumeration type 'enum smu_clk_type' [-Wenum-conversion] > ret = smu_get_current_clk_freq(smu, PPCLK_FCLK, &now); > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ > drivers/gpu/drm/amd/amdgpu/../powerplay/vega20_ppt.c:1031:39: warning: > implicit conversion from enumeration type 'PPCLK_e' to different > enumeration type 'enum smu_clk_type' [-Wenum-conversion] > ret = smu_get_current_clk_freq(smu, PPCLK_DCEFCLK, &now); > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~ > > The values are mapped one to one in vega20_get_smu_clk_index so just use > the proper enums here. > > Fixes: 096761014227 ("drm/amd/powerplay: support sysfs to get socclk, fclk, dcefclk") > Link: https://github.com/ClangBuiltLinux/linux/issues/587 > Signed-off-by: Nathan Chancellor > --- Adding Kevin Wang for further review, as he sent a related patch in d36893362d22 ("drm/amd/powerplay: fix smu clock type change miss error") I assume this one is still required as it triggers the same warning. Kevin, can you have a look? Arnd > drivers/gpu/drm/amd/powerplay/vega20_ppt.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/amd/powerplay/vega20_ppt.c b/drivers/gpu/drm/amd/powerplay/vega20_ppt.c > index 0f14fe14ecd8..e62dd6919b24 100644 > --- a/drivers/gpu/drm/amd/powerplay/vega20_ppt.c > +++ b/drivers/gpu/drm/amd/powerplay/vega20_ppt.c > @@ -992,7 +992,7 @@ static int vega20_print_clk_levels(struct smu_context *smu, > break; > > case SMU_SOCCLK: > - ret = smu_get_current_clk_freq(smu, PPCLK_SOCCLK, &now); > + ret = smu_get_current_clk_freq(smu, SMU_SOCCLK, &now); > if (ret) { > pr_err("Attempt to get current socclk Failed!"); > return ret; > @@ -1013,7 +1013,7 @@ static int vega20_print_clk_levels(struct smu_context *smu, > break; > > case SMU_FCLK: > - ret = smu_get_current_clk_freq(smu, PPCLK_FCLK, &now); > + ret = smu_get_current_clk_freq(smu, SMU_FCLK, &now); > if (ret) { > pr_err("Attempt to get current fclk Failed!"); > return ret; > @@ -1028,7 +1028,7 @@ static int vega20_print_clk_levels(struct smu_context *smu, > break; > > case SMU_DCEFCLK: > - ret = smu_get_current_clk_freq(smu, PPCLK_DCEFCLK, &now); > + ret = smu_get_current_clk_freq(smu, SMU_DCEFCLK, &now); > if (ret) { > pr_err("Attempt to get current dcefclk Failed!"); > return ret;