Skip to content

Commit a30e7d1

Browse files
Vincent ChenGreentime Hu
authored andcommitted
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: Vincent Chen <[email protected]> Reviewed-by: Greentime Hu <[email protected]> Signed-off-by: Greentime Hu <[email protected]>
1 parent aaaaba5 commit a30e7d1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

arch/nds32/kernel/vdso.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include <asm/vdso_timer_info.h>
2424
#include <asm/cache_info.h>
2525
extern struct cache_info L1_cache_info[2];
26-
extern char vdso_start, vdso_end;
26+
extern char vdso_start[], vdso_end[];
2727
static unsigned long vdso_pages __ro_after_init;
2828
static unsigned long timer_mapping_base;
2929

@@ -66,24 +66,24 @@ static int __init vdso_init(void)
6666
int i;
6767
struct page **vdso_pagelist;
6868

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

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

8080
/* Allocate the vDSO pagelist */
8181
vdso_pagelist = kcalloc(vdso_pages, sizeof(struct page *), GFP_KERNEL);
8282
if (vdso_pagelist == NULL)
8383
return -ENOMEM;
8484

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

8989
return 0;

0 commit comments

Comments
 (0)