From patchwork Fri Sep 21 21:01:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 10611669 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 A07DE5A4 for ; Sun, 23 Sep 2018 12:30:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8F90E2A1DF for ; Sun, 23 Sep 2018 12:30:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 83BEB2A1D9; Sun, 23 Sep 2018 12:30:51 +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 3BB022A1D9 for ; Sun, 23 Sep 2018 12:30:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4A0AA6E123; Sun, 23 Sep 2018 12:30:39 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by gabe.freedesktop.org (Postfix) with ESMTPS id 350956E24F; Fri, 21 Sep 2018 21:01:20 +0000 (UTC) Received: by mail-wm1-x344.google.com with SMTP id j192-v6so4639650wmj.1; Fri, 21 Sep 2018 14:01:20 -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:mime-version :content-transfer-encoding; bh=XS6nk/K8/ILhnPOmEe3KYBFW8ubwsYuiH108d+DXuQc=; b=VTv8MRgoS95sBvSILDtAz6gYu65Pk+U6E3OSo8BmF1AbGmaB1O5GxDOhWCiJ0XkjUe CxF6wYvvMEETWtdL32qH8ME/Cmsa1ZqXG7aTU2BbLK+cB3osQUJ80Vv5q9nDnezkHhLW WCHVXfTsu8Uwk/AwNtFmfDknHslStpnj817yhfHWDJ1MkqwlgNo+zsPIaayoxloOZCUD 04DVcitmQhK9zp39zYZdI5PAGK059UWwD6QznpO8UJj8xMqLnNheVqPbyPLm8MUMkoju NjtICsfV89aPm2O4TOBa4iP7x7erF/B2GjV8cMVajjY/viJLYPvRTh+7ywNYlz4WqPoW X98g== X-Gm-Message-State: APzg51Dz7XGmxcrRhl4qOX5vUCFrqOzUK6RQcJUWOAlcJgTQ68QnwsBS mosVrbsdkhpZd/S4niiDXQc= X-Google-Smtp-Source: ANB0Vdb7qMvcI8u6a8sYGcx1+3sUAUiiVrxtjAUqtEzyXZvBjK7bfJeF/UjZxAsLrqhdGHDafBqSTA== X-Received: by 2002:a1c:be14:: with SMTP id o20-v6mr8509750wmf.73.1537563678379; Fri, 21 Sep 2018 14:01:18 -0700 (PDT) Received: from localhost.localdomain ([2a01:4f8:10b:24a5::2]) by smtp.gmail.com with ESMTPSA id u127-v6sm4268909wmf.48.2018.09.21.14.01.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Sep 2018 14:01:17 -0700 (PDT) From: Nathan Chancellor To: Rex Zhu , Evan Quan , Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= , "David (ChunMing) Zhou" Subject: [PATCH] drm/amd/powerplay: Change id parameter type in pp_atomfwctrl_get_clk_information_by_clkid Date: Fri, 21 Sep 2018 14:01:06 -0700 Message-Id: <20180921210106.24310-1-natechancellor@gmail.com> X-Mailer: git-send-email 2.19.0 MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 23 Sep 2018 12:30:38 +0000 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: Nathan Chancellor , Nick Desaulniers , dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Clang generates warnings when one enumerated type is implicitly converted to another. drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomfwctrl.c:532:57: warning: implicit conversion from enumeration type 'enum atom_smu11_syspll0_clock_id' to different enumeration type 'BIOS_CLKID' (aka 'enum atom_smu9_syspll0_clock_id') [-Wenum-conversion] if (!pp_atomfwctrl_get_clk_information_by_clkid(hwmgr, SMU11_SYSPLL0_SOCCLK_ID, &frequency)) In this case, that is expected behavior. To make that clear to Clang without explicitly casting these values, change id's type to uint8_t in pp_atomfwctrl_get_clk_information_by_clkid so no conversion happens. Reported-by: Nick Desaulniers Signed-off-by: Nathan Chancellor --- drivers/gpu/drm/amd/powerplay/hwmgr/ppatomfwctrl.c | 3 ++- drivers/gpu/drm/amd/powerplay/hwmgr/ppatomfwctrl.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/ppatomfwctrl.c b/drivers/gpu/drm/amd/powerplay/hwmgr/ppatomfwctrl.c index d27c1c9df286..4588bddf8b33 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/ppatomfwctrl.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/ppatomfwctrl.c @@ -488,7 +488,8 @@ int pp_atomfwctrl_get_gpio_information(struct pp_hwmgr *hwmgr, return 0; } -int pp_atomfwctrl_get_clk_information_by_clkid(struct pp_hwmgr *hwmgr, BIOS_CLKID id, uint32_t *frequency) +int pp_atomfwctrl_get_clk_information_by_clkid(struct pp_hwmgr *hwmgr, + uint8_t id, uint32_t *frequency) { struct amdgpu_device *adev = hwmgr->adev; struct atom_get_smu_clock_info_parameters_v3_1 parameters; diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/ppatomfwctrl.h b/drivers/gpu/drm/amd/powerplay/hwmgr/ppatomfwctrl.h index 22e21668c93a..fe9e8ceef50e 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/ppatomfwctrl.h +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/ppatomfwctrl.h @@ -236,7 +236,7 @@ int pp_atomfwctrl_get_vbios_bootup_values(struct pp_hwmgr *hwmgr, int pp_atomfwctrl_get_smc_dpm_information(struct pp_hwmgr *hwmgr, struct pp_atomfwctrl_smc_dpm_parameters *param); int pp_atomfwctrl_get_clk_information_by_clkid(struct pp_hwmgr *hwmgr, - BIOS_CLKID id, uint32_t *frequency); + uint8_t id, uint32_t *frequency); #endif