From: Huisong Li <lihuisong@huawei.com>
To: <xuwei5@hisilicon.com>, <arnd@arndb.de>, <arnd@kernel.org>
Cc: <linux-kernel@vger.kernel.org>, <soc@kernel.org>,
<linux-arm-kernel@lists.infradead.org>, <liuyonglong@huawei.com>,
<lihuisong@huawei.com>
Subject: [PATCH] soc: kunpeng_hccs: fix some sparse warnings about incorrect type
Date: Tue, 15 Aug 2023 20:52:33 +0800 [thread overview]
Message-ID: <20230815125233.65469-1-lihuisong@huawei.com> (raw)
This patch fixes some sparse warnings about incorrect type.
The address about PCC communication space should use '__iomem' tag.
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202308151142.dH5Muhva-lkp@intel.com/
Fixes: 886bdf9c883b ("soc: hisilicon: Support HCCS driver on Kunpeng SoC")
Signed-off-by: Huisong Li <lihuisong@huawei.com>
---
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/kunpeng_hccs.c
index 0d6f6bacd3f6..4e94753ab0f7 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 *hdev)
}
if (pcc_chan->shmem_base_addr) {
- cl_info->pcc_comm_addr = (void __force *)ioremap(
- pcc_chan->shmem_base_addr, pcc_chan->shmem_size);
+ cl_info->pcc_comm_addr = 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 *hdev)
static int hccs_check_chan_cmd_complete(struct hccs_dev *hdev)
{
struct hccs_mbox_client_info *cl_info = &hdev->cl_info;
- struct acpi_pcct_shared_memory *comm_base = cl_info->pcc_comm_addr;
+ struct acpi_pcct_shared_memory __iomem *comm_base =
+ cl_info->pcc_comm_addr;
u16 status;
int ret;
@@ -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 = &hdev->cl_info;
- struct acpi_pcct_shared_memory *comm_base = cl_info->pcc_comm_addr;
- void *comm_space = (void *)(comm_base + 1);
+ void __iomem *comm_space = (u8 *)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 = {0};
u16 comm_space_size;
@@ -212,7 +213,7 @@ static int hccs_pcc_cmd_send(struct hccs_dev *hdev, u8 cmd,
tmp.command = cmd;
/* Clear cmd complete bit */
tmp.status = 0;
- memcpy_toio(comm_base, (void *)&tmp,
+ memcpy_toio(cl_info->pcc_comm_addr, (void *)&tmp,
sizeof(struct acpi_pcct_shared_memory));
/* Copy the message to the PCC comm space */
diff --git a/drivers/soc/hisilicon/kunpeng_hccs.h b/drivers/soc/hisilicon/kunpeng_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;
};
struct hccs_dev {
--
2.33.0
next reply other threads:[~2023-08-15 12:56 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-15 12:52 Huisong Li [this message]
2023-08-16 7:37 ` [PATCH v2] " Huisong Li
2023-08-16 13:17 ` [PATCH] " Arnd Bergmann
2023-08-17 1:37 ` lihuisong (C)
2023-08-17 11:54 ` Arnd Bergmann
2023-08-18 1:38 ` lihuisong (C)
2023-08-18 1:57 ` Arnd Bergmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230815125233.65469-1-lihuisong@huawei.com \
--to=lihuisong@huawei.com \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liuyonglong@huawei.com \
--cc=soc@kernel.org \
--cc=xuwei5@hisilicon.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®