Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a30e7d1e authored by Vincent Chen's avatar Vincent Chen Committed by Greentime Hu
Browse files

nds32: Fix compiler warning, Wstringop-overflow, in vdso.c



Getting a compiler warning, Wstringop-overflow, in
arch/nds32/kernel/vdso.c when kernel is built by gcc-8. Declaring
vdso_start and vdso_end as a pointer to fix this compiler warning.

Signed-off-by: default avatarVincent Chen <vincentc@andestech.com>
Reviewed-by: default avatarGreentime Hu <greentime@andestech.com>
Signed-off-by: default avatarGreentime Hu <greentime@andestech.com>
parent aaaaba57
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@
#include <asm/vdso_timer_info.h>
#include <asm/cache_info.h>
extern struct cache_info L1_cache_info[2];
extern char vdso_start, vdso_end;
extern char vdso_start[], vdso_end[];
static unsigned long vdso_pages __ro_after_init;
static unsigned long timer_mapping_base;

@@ -66,16 +66,16 @@ static int __init vdso_init(void)
	int i;
	struct page **vdso_pagelist;

	if (memcmp(&vdso_start, "\177ELF", 4)) {
	if (memcmp(vdso_start, "\177ELF", 4)) {
		pr_err("vDSO is not a valid ELF object!\n");
		return -EINVAL;
	}
	/* Creat a timer io mapping to get clock cycles counter */
	get_timer_node_info();

	vdso_pages = (&vdso_end - &vdso_start) >> PAGE_SHIFT;
	vdso_pages = (vdso_end - vdso_start) >> PAGE_SHIFT;
	pr_info("vdso: %ld pages (%ld code @ %p, %ld data @ %p)\n",
		vdso_pages + 1, vdso_pages, &vdso_start, 1L, vdso_data);
		vdso_pages + 1, vdso_pages, vdso_start, 1L, vdso_data);

	/* Allocate the vDSO pagelist */
	vdso_pagelist = kcalloc(vdso_pages, sizeof(struct page *), GFP_KERNEL);
@@ -83,7 +83,7 @@ static int __init vdso_init(void)
		return -ENOMEM;

	for (i = 0; i < vdso_pages; i++)
		vdso_pagelist[i] = virt_to_page(&vdso_start + i * PAGE_SIZE);
		vdso_pagelist[i] = virt_to_page(vdso_start + i * PAGE_SIZE);
	vdso_spec[1].pages = &vdso_pagelist[0];

	return 0;