提交 259be550 编写于 作者: G Giulio Benetti 提交者: sanglipeng

ARM: 9280/1: mm: fix warning on phys_addr_t to void pointer assignment

stable inclusion
from stable-v5.10.166
commit 0cb922cef7e93a565e8eeccf810a863a24be9fd6
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7TH9O

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=0cb922cef7e93a565e8eeccf810a863a24be9fd6

--------------------------------

commit a4e03921 upstream.

zero_page is a void* pointer but memblock_alloc() returns phys_addr_t type
so this generates a warning while using clang and with -Wint-error enabled
that becomes and error. So let's cast the return of memblock_alloc() to
(void *).

Cc: <stable@vger.kernel.org> # 4.14.x +
Fixes: 340a9828 ("ARM: 9266/1: mm: fix no-MMU ZERO_PAGE() implementation")
Signed-off-by: NGiulio Benetti <giulio.benetti@benettiengineering.com>
Signed-off-by: NRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Nsanglipeng <sanglipeng1@jd.com>
上级 91593788
...@@ -161,7 +161,7 @@ void __init paging_init(const struct machine_desc *mdesc) ...@@ -161,7 +161,7 @@ void __init paging_init(const struct machine_desc *mdesc)
mpu_setup(); mpu_setup();
/* allocate the zero page. */ /* allocate the zero page. */
zero_page = memblock_alloc(PAGE_SIZE, PAGE_SIZE); zero_page = (void *)memblock_alloc(PAGE_SIZE, PAGE_SIZE);
if (!zero_page) if (!zero_page)
panic("%s: Failed to allocate %lu bytes align=0x%lx\n", panic("%s: Failed to allocate %lu bytes align=0x%lx\n",
__func__, PAGE_SIZE, PAGE_SIZE); __func__, PAGE_SIZE, PAGE_SIZE);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册