ARM: VDSO: remove cntvct_ok global variable
PATCH 1/1 ARM: VDSO: remove cntvct_ok global variable
The cntvct_ok variable has not had any external user since commit c7a18100bdff ("lib/vdso: Avoid highres update if clocksource is not VDSO capable").
It also only has one user in vdso.c, once during init, so rather than having the caller of patch_vdso() initialize cntvct_ok, just call cntvct_functional() directly and avoid the global variable entirely.
--- arch/arm/include/asm/vdso/vsyscall.h | 1 - arch/arm/kernel/vdso.c | 10 +++------- 2 files changed, 3 insertions(+), 8 deletions(-)
arch/arm/include/asm/vdso/vsyscall.h +0 -1
@@ -9,7 +9,6 @@#include <asm/cacheflush.h> extern struct vdso_data *vdso_data; -extern bool cntvct_ok;/* * Update the vDSO data page to keep in sync with kernel timekeeping.
arch/arm/kernel/vdso.c +3 -7
@@ -67,11 +67,9 @@ struct elfinfo {char *dynstr;/* ptr to .dynstr section */ }; -/* Cached result of boot-time check for whether the arch timer exists, -* and if so, whether the virtual counter is useable. +/* Boot-time check for whether the arch timer exists, and if so, +* whether the virtual counter is useable. */ -bool cntvct_ok__ro_after_init ; -static bool __init cntvct_functional (void ) {struct device_node *np;
@@ -172,7 +170,7 @@ static void __init patch_vdso(void *ehdr)* want programs to incur the slight additional overhead of * dispatching through the VDSO only to fall back to syscalls. */ -if (!cntvct_ok) { +if (!cntvct_functional ()) {vdso_nullpatch_one (&einfo,"__vdso_gettimeofday" );vdso_nullpatch_one (&einfo,"__vdso_clock_gettime" );vdso_nullpatch_one (&einfo,"__vdso_clock_gettime64" );
@@ -213,8 +211,6 @@ static int __init vdso_init(void) vdso_total_pages =1 ;/* for the data/vvar page */ vdso_total_pages += text_pages; - cntvct_ok =cntvct_functional (); -patch_vdso (vdso_start);return 0 ;
Signature · 1 line
2.40.1.1.g1c60b9335d
Quoted 9 lines · Rasmus Villemoes
The
cntvct_okvariable has not had any external user since commitc7a18100bdff("lib/vdso: Avoid highres update if clocksource is not VDSO capable").It also only has one user in
vdso.c, once during init, so rather than having the caller ofpatch_vdso()initializecntvct_ok, just callcntvct_functional()directly and avoid the global variable entirely.Signed-off-by Rasmus Villemoes <[email protected]>
Fine by me.
Quoted 53 lines
--- arch/arm/include/asm/vdso/vsyscall.h | 1 - arch/arm/kernel/vdso.c | 10 +++------- 2 files changed, 3 insertions(+), 8 deletions(-)arch/arm/include/asm/vdso/vsyscall.h +0
-1@@ -9,7 +9,6 @@#include <asm/cacheflush.h> extern struct vdso_data *vdso_data; -extern bool cntvct_ok;/* * Update the vDSO data page to keep in sync with kernel timekeeping. arch/arm/kernel/vdso.c +3
-7@@ -67,11 +67,9 @@ struct elfinfo {char *dynstr;/* ptr to .dynstr section */ }; -/* Cached result of boot-time check for whether the arch timer exists, -* and if so, whether the virtual counter is useable. +/* Boot-time check for whether the arch timer exists, and if so, +* whether the virtual counter is useable. */ -bool cntvct_ok__ro_after_init ; -static bool __init cntvct_functional (void ) {struct device_node *np;@@ -172,7 +170,7 @@ static void __init patch_vdso(void *ehdr)* want programs to incur the slight additional overhead of * dispatching through the VDSO only to fall back to syscalls. */ -if (!cntvct_ok) { +if (!cntvct_functional ()) {vdso_nullpatch_one (&einfo,"__vdso_gettimeofday" );vdso_nullpatch_one (&einfo,"__vdso_clock_gettime" );vdso_nullpatch_one (&einfo,"__vdso_clock_gettime64" );@@ -213,8 +211,6 @@ static int __init vdso_init(void) vdso_total_pages =1 ;/* for the data/vvar page */ vdso_total_pages += text_pages; - cntvct_ok =cntvct_functional (); -patch_vdso (vdso_start);return 0 ;
Signature · 2 lines
Regards, Vincenzo