From patchwork Thu Jul 4 05:52:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 11031115 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7FCEC138B for ; Thu, 4 Jul 2019 07:26:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6C44628A33 for ; Thu, 4 Jul 2019 07:26:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6058728A3F; Thu, 4 Jul 2019 07:26:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 16FCE28A33 for ; Thu, 4 Jul 2019 07:26:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 354856E293; Thu, 4 Jul 2019 07:25:18 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ed1-x541.google.com (mail-ed1-x541.google.com [IPv6:2a00:1450:4864:20::541]) by gabe.freedesktop.org (Postfix) with ESMTPS id 35CD16E25D; Thu, 4 Jul 2019 05:52:58 +0000 (UTC) Received: by mail-ed1-x541.google.com with SMTP id w13so4245220eds.4; Wed, 03 Jul 2019 22:52:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=N8j4/lfObWKsySJXHjiTJhYwv3YoOUa3RyuF9b2OiCM=; b=PFktc+J09sy8PMv4Q0Hh3Z8KndGly92m8j47D72Q9jlZOK3lAbjjP96iF8+z60vUOY gTOeFhHNyJw8SNkbueCgk0IN/Kp8Jvly+LJViTxiPzewV7hLOwNDk9tRTDJx4VXBziFJ aMwFTZjwJN0OwJCh/WsuOUaPeuucfI7sI7ikwJ2COZht7PmbL7dxOMpQXbVzxd+w3uVa CfcEHbkouuX5wH9HS2FvFi012l2pLU14/fsCKVPWIuyaRY6RL8LMJVe78vsxJTdrT5GV DbXhn4z3GSDgdqa5EK5d9Wir1/dZvcOPxQWH/acCTcsnCUz4w1fEqdSmfXy5CEW6CviQ 7iXQ== X-Gm-Message-State: APjAAAUtVgu9W5rZTJYaXWBDI5wEgR2bCyi9ixtu09+kU8zrcvzjBruh h4uf9jNj0cE5XXHYPpIOpEY= X-Google-Smtp-Source: APXvYqyEV4E8nukKV6omo3iH8YCRstVAvf1CQz8Y0UriutmKpBEO8S4OT87MNMKrRaN3/rlsXae2Kw== X-Received: by 2002:aa7:d68e:: with SMTP id d14mr46710516edr.253.1562219576755; Wed, 03 Jul 2019 22:52:56 -0700 (PDT) Received: from localhost.localdomain ([2a01:4f9:2b:2b15::2]) by smtp.gmail.com with ESMTPSA id j30sm1343532edb.8.2019.07.03.22.52.55 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 03 Jul 2019 22:52:56 -0700 (PDT) From: Nathan Chancellor To: Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= , "David (ChunMing) Zhou" , Harry Wentland , Leo Li , Rex Zhu , Evan Quan Subject: [PATCH 6/7] drm/amd/powerplay: Use proper enums in vega20_print_clk_levels Date: Wed, 3 Jul 2019 22:52:17 -0700 Message-Id: <20190704055217.45860-7-natechancellor@gmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190704055217.45860-1-natechancellor@gmail.com> References: <20190704055217.45860-1-natechancellor@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 04 Jul 2019 07:25:13 +0000 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=N8j4/lfObWKsySJXHjiTJhYwv3YoOUa3RyuF9b2OiCM=; b=knXHCJL6QcZzMVgVNUiZIanYTejfXIDYg2v2DTquN8FlJf1PUoIPvsEtxcfPAoYlHC UEoUo//wjy3wqe8hDRPSZlJm6o1NaokVDYHJZqYjtg/2Ll4hDOsP50MQs1ObKlZlKGdK vlKr9Og8jwfSHADn/MqQXE17Mt2OCsbSNbCM0qFPR8cmCbdgSVqfGkXq81DMswrni7wT CmzUNIMVIm0tuj8dkJJddCMCVOSE8ziuHNXVRz7m0TdgV1bqSextCYzGeA+MMtXNZziH m37DPf7guudTsok5GLEYP0pgKsKJYisHc7u9FSdNVi8gu48ggzD9wWuDqyvQ5Xr4vPaU NTLQ== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, clang-built-linux@googlegroups.com, amd-gfx@lists.freedesktop.org, Nathan Chancellor Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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;