From patchwork Mon Jul 10 10:09:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sui Jingfeng X-Patchwork-Id: 13306689 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id DB11AEB64D9 for ; Mon, 10 Jul 2023 10:09:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DAE6B10E257; Mon, 10 Jul 2023 10:09:43 +0000 (UTC) Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by gabe.freedesktop.org (Postfix) with ESMTP id 865DA10E257 for ; Mon, 10 Jul 2023 10:09:40 +0000 (UTC) Received: from loongson.cn (unknown [10.20.42.43]) by gateway (Coremail) with SMTP id _____8Axjuvh2KtkvRcDAA--.6181S3; Mon, 10 Jul 2023 18:09:37 +0800 (CST) Received: from openarena.loongson.cn (unknown [10.20.42.43]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Cx_c7g2KtknCInAA--.45834S2; Mon, 10 Jul 2023 18:09:36 +0800 (CST) From: Sui Jingfeng To: Sui Jingfeng , David Airlie , Daniel Vetter , Thomas Zimmermann , Li Yi Subject: [PATCH] drm/loongson: Fix two warnings because of passing wrong type Date: Mon, 10 Jul 2023 18:09:31 +0800 Message-Id: <20230710100931.255234-1-suijingfeng@loongson.cn> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CM-TRANSID: AQAAf8Cx_c7g2KtknCInAA--.45834S2 X-CM-SenderInfo: xvxlyxpqjiv03j6o00pqjv00gofq/ X-Coremail-Antispam: 1Uk129KBj93XoW7tw4fur45Gw15KFWUXFyk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ists.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: loongson-kernel@lists.loongnix.cn, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel test robot Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" When accessing I/O memory, we should pass '__iomem *' type instead of 'void *' simply, otherwise sparse tests will complain. After applied this patch, the following two sparse warnings got fixed. 1) drivers/gpu/drm/loongson/lsdc_benchmark.c:27:35: sparse: expected void volatile [noderef] __iomem * sparse: got void *kptr 2) drivers/gpu/drm/loongson/lsdc_benchmark.c:42:51: sparse: expected void const volatile [noderef] __iomem * sparse: got void *kptr Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202307100243.v3hv6aes-lkp@intel.com/ Signed-off-by: Sui Jingfeng --- drivers/gpu/drm/loongson/lsdc_benchmark.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/loongson/lsdc_benchmark.c b/drivers/gpu/drm/loongson/lsdc_benchmark.c index b088646a2ff9..36e352820bdb 100644 --- a/drivers/gpu/drm/loongson/lsdc_benchmark.c +++ b/drivers/gpu/drm/loongson/lsdc_benchmark.c @@ -24,7 +24,7 @@ static void lsdc_copy_gtt_to_vram_cpu(struct lsdc_bo *src_bo, lsdc_bo_kmap(dst_bo); while (n--) - memcpy_toio(dst_bo->kptr, src_bo->kptr, size); + memcpy_toio((void __iomem *)dst_bo->kptr, src_bo->kptr, size); lsdc_bo_kunmap(src_bo); lsdc_bo_kunmap(dst_bo); @@ -39,7 +39,7 @@ static void lsdc_copy_vram_to_gtt_cpu(struct lsdc_bo *src_bo, lsdc_bo_kmap(dst_bo); while (n--) - memcpy_fromio(dst_bo->kptr, src_bo->kptr, size); + memcpy_fromio(dst_bo->kptr, (void __iomem *)src_bo->kptr, size); lsdc_bo_kunmap(src_bo); lsdc_bo_kunmap(dst_bo);