From nobody Wed Dec 17 21:29:45 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 50269C001B0 for ; Wed, 16 Aug 2023 07:40:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242537AbjHPHkQ (ORCPT ); Wed, 16 Aug 2023 03:40:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242518AbjHPHkC (ORCPT ); Wed, 16 Aug 2023 03:40:02 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB3E5198C for ; Wed, 16 Aug 2023 00:40:00 -0700 (PDT) Received: from kwepemm600004.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4RQg353RX4zVkBw; Wed, 16 Aug 2023 15:37:53 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by kwepemm600004.china.huawei.com (7.193.23.242) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Wed, 16 Aug 2023 15:39:58 +0800 From: Huisong Li To: , , CC: , , , , Subject: [PATCH v2] soc: kunpeng_hccs: fix some sparse warnings about incorrect type Date: Wed, 16 Aug 2023 15:37:06 +0800 Message-ID: <20230816073706.33297-1-lihuisong@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20230815125233.65469-1-lihuisong@huawei.com> References: <20230815125233.65469-1-lihuisong@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.69.192.56] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemm600004.china.huawei.com (7.193.23.242) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" This patch fixes some sparse warnings about incorrect type. The address about PCC communication space should use '__iomem' tag. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202308151142.dH5Muhva-lkp@int= el.com/ Fixes: 886bdf9c883b ("soc: hisilicon: Support HCCS driver on Kunpeng SoC") Signed-off-by: Huisong Li --- v2: remove (u8 *) before cl_info->pcc_comm_addr to resolve "cast removes address space '__iomem' of expression" warning. --- drivers/soc/hisilicon/kunpeng_hccs.c | 13 +++++++------ drivers/soc/hisilicon/kunpeng_hccs.h | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/soc/hisilicon/kunpeng_hccs.c b/drivers/soc/hisilicon/k= unpeng_hccs.c index 0d6f6bacd3f6..f3810d9d1caa 100644 --- a/drivers/soc/hisilicon/kunpeng_hccs.c +++ b/drivers/soc/hisilicon/kunpeng_hccs.c @@ -156,8 +156,8 @@ static int hccs_register_pcc_channel(struct hccs_dev *h= dev) } =20 if (pcc_chan->shmem_base_addr) { - cl_info->pcc_comm_addr =3D (void __force *)ioremap( - pcc_chan->shmem_base_addr, pcc_chan->shmem_size); + cl_info->pcc_comm_addr =3D ioremap(pcc_chan->shmem_base_addr, + pcc_chan->shmem_size); if (!cl_info->pcc_comm_addr) { dev_err(dev, "Failed to ioremap PCC communication region for channel-%d= .\n", hdev->chan_id); @@ -177,7 +177,8 @@ static int hccs_register_pcc_channel(struct hccs_dev *h= dev) static int hccs_check_chan_cmd_complete(struct hccs_dev *hdev) { struct hccs_mbox_client_info *cl_info =3D &hdev->cl_info; - struct acpi_pcct_shared_memory *comm_base =3D cl_info->pcc_comm_addr; + struct acpi_pcct_shared_memory __iomem *comm_base =3D + cl_info->pcc_comm_addr; u16 status; int ret; =20 @@ -199,8 +200,8 @@ static int hccs_pcc_cmd_send(struct hccs_dev *hdev, u8 = cmd, struct hccs_desc *desc) { struct hccs_mbox_client_info *cl_info =3D &hdev->cl_info; - struct acpi_pcct_shared_memory *comm_base =3D cl_info->pcc_comm_addr; - void *comm_space =3D (void *)(comm_base + 1); + void __iomem *comm_space =3D cl_info->pcc_comm_addr + + sizeof(struct acpi_pcct_shared_memory); struct hccs_fw_inner_head *fw_inner_head; struct acpi_pcct_shared_memory tmp =3D {0}; u16 comm_space_size; @@ -212,7 +213,7 @@ static int hccs_pcc_cmd_send(struct hccs_dev *hdev, u8 = cmd, tmp.command =3D cmd; /* Clear cmd complete bit */ tmp.status =3D 0; - memcpy_toio(comm_base, (void *)&tmp, + memcpy_toio(cl_info->pcc_comm_addr, (void *)&tmp, sizeof(struct acpi_pcct_shared_memory)); =20 /* Copy the message to the PCC comm space */ diff --git a/drivers/soc/hisilicon/kunpeng_hccs.h b/drivers/soc/hisilicon/k= unpeng_hccs.h index 9d71fb78443f..6012d2776028 100644 --- a/drivers/soc/hisilicon/kunpeng_hccs.h +++ b/drivers/soc/hisilicon/kunpeng_hccs.h @@ -50,7 +50,7 @@ struct hccs_mbox_client_info { struct mbox_chan *mbox_chan; struct pcc_mbox_chan *pcc_chan; u64 deadline_us; - void *pcc_comm_addr; + void __iomem *pcc_comm_addr; }; =20 struct hccs_dev { --=20 2.33.0