[PATCH OLK-5.10] soc: hisilicon: Fix one printing issue and simplify some printing

From: Xiaofei Tan <tanxiaofei@huawei.com> driver inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IBS9WQ CVE: NA ---------------------------------------------------------------------- It's the opposite of what acls_repair_store printing really means. Fix it and add some printing simplification. Fixes: efb5bc7b199e ("soc: hisilicon: Support memory repair driver on Kunpeng SoC") Signed-off-by: Xiaofei Tan <tanxiaofei@huawei.com> Signed-off-by: Qizhi Zhang <zhangqizhi3@h-partners.com> --- drivers/soc/hisilicon/hisi_mem_ras.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/soc/hisilicon/hisi_mem_ras.c b/drivers/soc/hisilicon/hisi_mem_ras.c index 765132cf1c04..991b76e3075d 100644 --- a/drivers/soc/hisilicon/hisi_mem_ras.c +++ b/drivers/soc/hisilicon/hisi_mem_ras.c @@ -229,7 +229,7 @@ static struct page *trans_and_check_paddr(struct device *dev, const char *buf, u page = pfn_to_online_page(__phys_to_pfn(paddr_tmp)); if (!page) { - dev_info(dev, "The page of paddr 0x%llx is not online page.\n", paddr_tmp); + dev_info(dev, "The page of paddr 0x%llx not online.\n", paddr_tmp); return NULL; } @@ -283,7 +283,7 @@ static ssize_t acls_repair_store(struct device *dev, struct device_attribute *at return -EINVAL; if (hdev->mem_type == MEMORY_TYPE_HBM && !PageHWPoison(page)) { - dev_info(dev, "The page of paddr 0x%llx is not unpoisoned.\n", paddr); + dev_info(dev, "The page of paddr 0x%llx not poisoned.\n", paddr); return -EIO; } @@ -350,7 +350,7 @@ static ssize_t sppr_repair_store(struct device *dev, struct device_attribute *at return -EINVAL; if (hdev->mem_type == MEMORY_TYPE_HBM && !PageHWPoison(page)) { - dev_info(dev, "The page of paddr 0x%llx is not poisoned.\n", paddr); + dev_info(dev, "The page of paddr 0x%llx not poisoned.\n", paddr); return -EIO; } -- 2.33.0

driver inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IBS9WQ CVE: NA ---------------------------------------------------------------------- The function of ACPI_COMPANION returns a NULL pointer when the device without an fwnode, so add checks for this to fix NULL pointer reference at ACPI_COMPANION. fixes: efb5bc7b199e ("soc: hisilicon: Support memory repair driver on Kunpeng SoC") Signed-off-by: Junhao He <hejunhao3@huawei.com> Signed-off-by: Qizhi Zhang <zhangqizhi3@h-partners.com> --- drivers/soc/hisilicon/hisi_mem_ras.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/soc/hisilicon/hisi_mem_ras.c b/drivers/soc/hisilicon/hisi_mem_ras.c index 991b76e3075d..556a6be8afda 100644 --- a/drivers/soc/hisilicon/hisi_mem_ras.c +++ b/drivers/soc/hisilicon/hisi_mem_ras.c @@ -43,16 +43,20 @@ static int hisi_mem_get_pcc_chan_id(struct hisi_mem_dev *hdev) struct platform_device *pdev = hdev->pdev; struct acpi_device *adev = ACPI_COMPANION(&pdev->dev); struct hisi_mem_register_ctx ctx = {0}; - acpi_handle handle = adev->handle; acpi_status status; - if (!acpi_has_method(handle, METHOD_NAME__CRS)) { + if (!adev) { + dev_err(&pdev->dev, "ACPI companion missing\n"); + return -ENODEV; + } + + if (!acpi_has_method(adev->handle, METHOD_NAME__CRS)) { dev_err(&pdev->dev, "No _CRS method.\n"); return -ENODEV; } ctx.dev = &pdev->dev; - status = acpi_walk_resources(handle, METHOD_NAME__CRS, + status = acpi_walk_resources(adev->handle, METHOD_NAME__CRS, hisi_mem_get_chan_id_cb, &ctx); if (ACPI_FAILURE(status)) return ctx.err; -- 2.33.0

反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/15455 邮件列表地址:https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/LSL... FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://gitee.com/openeuler/kernel/pulls/15455 Mailing list address: https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/LSL...

反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/15456 邮件列表地址:https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/4RL... FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://gitee.com/openeuler/kernel/pulls/15456 Mailing list address: https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/4RL...
participants (2)
-
Junhao He
-
patchwork bot