From patchwork Mon Jul 8 13:57:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11035157 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 9408714C0 for ; Mon, 8 Jul 2019 13:57:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 806A6205A9 for ; Mon, 8 Jul 2019 13:57:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 726D322701; Mon, 8 Jul 2019 13:57:39 +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,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 1C4A0205A9 for ; Mon, 8 Jul 2019 13:57:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E2C9889CF4; Mon, 8 Jul 2019 13:57:36 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.73]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0510589CF4; Mon, 8 Jul 2019 13:57:34 +0000 (UTC) Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.145]) with ESMTPA (Nemesis) id 1N63JO-1iZC2B3Bai-016SJP; Mon, 08 Jul 2019 15:57:27 +0200 From: Arnd Bergmann To: Rex Zhu , Evan Quan , Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= , "David (ChunMing) Zhou" , David Airlie , Daniel Vetter Subject: [PATCH] drm/amd/powerplay: work around enum conversion warnings Date: Mon, 8 Jul 2019 15:57:06 +0200 Message-Id: <20190708135725.844960-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:HFJkRL/u3m2h7/kWPZ2uweQQNsKNk+l+VGn5825pAbgysbgYwaT s3QkxM4NKWF+vHWVUAOEs/maQ8DqGz7XjO8XGncS/eCce3++nGb4cf2kdDLLJtnJTwBHax7 LYcBNwvdhdbuYu9JXkgQg6JgBVBuSYUzObUfv8XhNL2XYcu4un+h3iikS2W68ur9ppkwoTd A+FiuYeCaHA/M2b49R9vg== X-UI-Out-Filterresults: notjunk:1;V03:K0:vmEqUqwMfX0=:G9E21xJMV/y1DCq1lu03hI lRFdCR79iFIrvVOJxLPANX3KpKHjZV0JXcPUVkAysCfC8XuS7Kl5jiUexkqtG3pIXfoqvEVU5 8ftcewsSQ7pPM4qF/gluJgtlZYDGLYZu/9uFuk1zMnnSYYIR1zy0c+6ZpZ3VVqilhZ4CS50Vs WSBSl2Y/evTMvg+F1ogc2h3aUr+xYFufDiJnqNUaEA7tY3KKUvovtGYcpw2o/o+SaZi3MU54v tBJ1ghxC0RRAZW7Nrr08IO/MmjS0Zl9Xn+9GXlWV3qQ9fq+3kGEDlLg2DkNKq3IEGsNFQHprN XhkWVF3L+LpEMK7755WegE85UHj449PeDcKHHSYft7GHZJp1VtfJDh/xprn1+d0HIcae6QBa2 j6f2nQA2Axhlbmk0J2xOiqK1zrEJZtzhy/Kvr2MSmSRqfZyf9VOWinabm5KN48Kq6JKIFr9br YeMySEGjKn4CFd1Ll97o8UWm4Muq+wuIHJFWYLVNJkapyHzHSr92EsD7kAgXk0UTd+tfSKeav lMk+tjBdhY5uR/22xnNDVRBfNQSqjHKXGBjIKPfDYuDEXWlBy9gG6MQzlnuuYNDL8/0kl3lQi cIOFcjtiDsxjefksgiyS3G5+CQTMeBNFCfXtvLsSi8HxpShotLtVx3KtlNCYbdAfGZRSMTPwC 49h+V3kq3ggh8tXxaQJm4Skqpnr1V0OXBwqmeCTkZBkMWJfDfH8nRL94l+3r1Jv7aOFUXWQhI SjZzBNqMGYAL8RNbBc/bj+NiSoQrg2ifKa9CIg== 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: Gui Chengming , Arnd Bergmann , Kevin Wang , linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, clang-built-linux@googlegroups.com, Huang Rui , dri-devel@lists.freedesktop.org, Likun Gao , Hawking Zhang Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP A couple of calls to smu_get_current_clk_freq() and smu_force_clk_levels() pass constants of the wrong type, leading to warnings with clang-8: drivers/gpu/drm/amd/amdgpu/../powerplay/vega20_ppt.c:995:39: error: implicit conversion from enumeration type 'PPCLK_e' to different enumeration type 'enum smu_clk_type' [-Werror,-Wenum-conversion] ret = smu_get_current_clk_freq(smu, PPCLK_SOCCLK, &now); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/amd/amdgpu/../powerplay/inc/amdgpu_smu.h:775:82: note: expanded from macro 'smu_get_current_clk_freq' ((smu)->funcs->get_current_clk_freq? (smu)->funcs->get_current_clk_freq((smu), (clk_id), (value)) : 0) I could not figure out what the purpose is of mixing the types like this and if it is written like this intentionally. Assuming this is all correct, adding an explict case is an easy way to shut up the warnings. Fixes: bc0fcffd36ba ("drm/amd/powerplay: Unify smu handle task function (v2)") Fixes: 096761014227 ("drm/amd/powerplay: support sysfs to get socclk, fclk, dcefclk") Signed-off-by: Arnd Bergmann --- Please check carefully if the warning is just a false positive or we need a different patch. --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 4 ++-- drivers/gpu/drm/amd/powerplay/vega20_ppt.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c index 755c6c79f724..93732623b507 100644 --- a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +++ b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c @@ -1386,8 +1386,8 @@ int smu_adjust_power_state_dynamic(struct smu_context *smu, &soc_mask); if (ret) return ret; - smu_force_clk_levels(smu, PP_SCLK, 1 << sclk_mask); - smu_force_clk_levels(smu, PP_MCLK, 1 << mclk_mask); + smu_force_clk_levels(smu, (enum smu_clk_type)PP_SCLK, 1 << sclk_mask); + smu_force_clk_levels(smu, (enum smu_clk_type)PP_MCLK, 1 << mclk_mask); break; case AMD_DPM_FORCED_LEVEL_MANUAL: diff --git a/drivers/gpu/drm/amd/powerplay/vega20_ppt.c b/drivers/gpu/drm/amd/powerplay/vega20_ppt.c index dba02fa0de01..20d477f8dc84 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, (enum smu_clk_type)PPCLK_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, (enum smu_clk_type)PPCLK_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, (enum smu_clk_type)PPCLK_DCEFCLK, &now); if (ret) { pr_err("Attempt to get current dcefclk Failed!"); return ret;