From patchwork Fri Feb 19 07:29:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Li X-Patchwork-Id: 12094767 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 50EAFC433DB for ; Fri, 19 Feb 2021 07:29:36 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DFE7764DE8 for ; Fri, 19 Feb 2021 07:29:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DFE7764DE8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E94756E8A5; Fri, 19 Feb 2021 07:29:34 +0000 (UTC) Received: from out30-133.freemail.mail.aliyun.com (out30-133.freemail.mail.aliyun.com [115.124.30.133]) by gabe.freedesktop.org (Postfix) with ESMTPS id 74E816E8A5; Fri, 19 Feb 2021 07:29:32 +0000 (UTC) X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R671e4; CH=green; DM=||false|; DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=e01e04423; MF=yang.lee@linux.alibaba.com; NM=1; PH=DS; RN=8; SR=0; TI=SMTPD_---0UOxD3N8_1613719765; Received: from j63c13417.sqa.eu95.tbsite.net(mailfrom:yang.lee@linux.alibaba.com fp:SMTPD_---0UOxD3N8_1613719765) by smtp.aliyun-inc.com(127.0.0.1); Fri, 19 Feb 2021 15:29:25 +0800 From: Yang Li To: airlied@linux.ie Subject: [PATCH] drm/radeon/dpm: fix non-restricted types with le16_to_cpu() Date: Fri, 19 Feb 2021 15:29:20 +0800 Message-Id: <1613719760-42773-1-git-send-email-yang.lee@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Yang Li , amd-gfx@lists.freedesktop.org, alexander.deucher@amd.com, christian.koenig@amd.com MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Fix the following sparse warnings: drivers/gpu/drm/radeon/rv6xx_dpm.c:1798:21: warning: cast to restricted __le32 drivers/gpu/drm/radeon/rv6xx_dpm.c:1799:22: warning: cast to restricted __le16 drivers/gpu/drm/radeon/rv6xx_dpm.c:1800:23: warning: cast to restricted __le16 Reported-by: Abaci Robot Signed-off-by: Yang Li --- drivers/gpu/drm/radeon/rv6xx_dpm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/radeon/rv6xx_dpm.c b/drivers/gpu/drm/radeon/rv6xx_dpm.c index 69d380f..e6ab99e 100644 --- a/drivers/gpu/drm/radeon/rv6xx_dpm.c +++ b/drivers/gpu/drm/radeon/rv6xx_dpm.c @@ -1795,9 +1795,9 @@ static void rv6xx_parse_pplib_non_clock_info(struct radeon_device *rdev, struct radeon_ps *rps, struct _ATOM_PPLIB_NONCLOCK_INFO *non_clock_info) { - rps->caps = le32_to_cpu(non_clock_info->ulCapsAndSettings); - rps->class = le16_to_cpu(non_clock_info->usClassification); - rps->class2 = le16_to_cpu(non_clock_info->usClassification2); + rps->caps = le32_to_cpu((__le32 __force)non_clock_info->ulCapsAndSettings); + rps->class = le16_to_cpu((__le16 __force)non_clock_info->usClassification); + rps->class2 = le16_to_cpu((__le16 __force)non_clock_info->usClassification2); if (r600_is_uvd_state(rps->class, rps->class2)) { rps->vclk = RV6XX_DEFAULT_VCLK_FREQ;