Skip to content

Commit 7d66128

Browse files
LiHuiSong1arndb
authored andcommitted
soc: kunpeng_hccs: fix some sparse warnings about incorrect type
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: 886bdf9 ("soc: hisilicon: Support HCCS driver on Kunpeng SoC") Signed-off-by: Huisong Li <lihuisong@huawei.com> Link: https://lore.kernel.org/r/20230816073706.33297-1-lihuisong@huawei.com Signed-off-by: Arnd Bergmann <arnd@arndb.de>
1 parent 67694c0 commit 7d66128

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

drivers/soc/hisilicon/kunpeng_hccs.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ static int hccs_register_pcc_channel(struct hccs_dev *hdev)
156156
}
157157

158158
if (pcc_chan->shmem_base_addr) {
159-
cl_info->pcc_comm_addr = (void __force *)ioremap(
160-
pcc_chan->shmem_base_addr, pcc_chan->shmem_size);
159+
cl_info->pcc_comm_addr = ioremap(pcc_chan->shmem_base_addr,
160+
pcc_chan->shmem_size);
161161
if (!cl_info->pcc_comm_addr) {
162162
dev_err(dev, "Failed to ioremap PCC communication region for channel-%d.\n",
163163
hdev->chan_id);
@@ -177,7 +177,8 @@ static int hccs_register_pcc_channel(struct hccs_dev *hdev)
177177
static int hccs_check_chan_cmd_complete(struct hccs_dev *hdev)
178178
{
179179
struct hccs_mbox_client_info *cl_info = &hdev->cl_info;
180-
struct acpi_pcct_shared_memory *comm_base = cl_info->pcc_comm_addr;
180+
struct acpi_pcct_shared_memory __iomem *comm_base =
181+
cl_info->pcc_comm_addr;
181182
u16 status;
182183
int ret;
183184

@@ -199,8 +200,8 @@ static int hccs_pcc_cmd_send(struct hccs_dev *hdev, u8 cmd,
199200
struct hccs_desc *desc)
200201
{
201202
struct hccs_mbox_client_info *cl_info = &hdev->cl_info;
202-
struct acpi_pcct_shared_memory *comm_base = cl_info->pcc_comm_addr;
203-
void *comm_space = (void *)(comm_base + 1);
203+
void __iomem *comm_space = cl_info->pcc_comm_addr +
204+
sizeof(struct acpi_pcct_shared_memory);
204205
struct hccs_fw_inner_head *fw_inner_head;
205206
struct acpi_pcct_shared_memory tmp = {0};
206207
u16 comm_space_size;
@@ -212,7 +213,7 @@ static int hccs_pcc_cmd_send(struct hccs_dev *hdev, u8 cmd,
212213
tmp.command = cmd;
213214
/* Clear cmd complete bit */
214215
tmp.status = 0;
215-
memcpy_toio(comm_base, (void *)&tmp,
216+
memcpy_toio(cl_info->pcc_comm_addr, (void *)&tmp,
216217
sizeof(struct acpi_pcct_shared_memory));
217218

218219
/* Copy the message to the PCC comm space */

drivers/soc/hisilicon/kunpeng_hccs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ struct hccs_mbox_client_info {
5050
struct mbox_chan *mbox_chan;
5151
struct pcc_mbox_chan *pcc_chan;
5252
u64 deadline_us;
53-
void *pcc_comm_addr;
53+
void __iomem *pcc_comm_addr;
5454
};
5555

5656
struct hccs_dev {

0 commit comments

Comments
 (0)