* [LTP] [PATCH V2] common_timers: staticize all definitions
@ 2020-04-28 8:10 Viresh Kumar
2020-04-28 8:26 ` Petr Vorel
2020-05-04 14:45 ` Cyril Hrubis
0 siblings, 2 replies; 3+ messages in thread
From: Viresh Kumar @ 2020-04-28 8:10 UTC (permalink / raw)
To: ltp
Staticize all variable and function definitions to avoid build failures
in the future if this gets included by multiple files.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
Make clock_list static const to avoid warnings.
include/lapi/common_timers.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/lapi/common_timers.h b/include/lapi/common_timers.h
index df4196eeb579..b783beff4f8b 100644
--- a/include/lapi/common_timers.h
+++ b/include/lapi/common_timers.h
@@ -15,7 +15,7 @@
#define NSEC_PER_SEC (1000000000L)
#endif
-clock_t clock_list[] = {
+static const clock_t clock_list[] = {
CLOCK_REALTIME,
CLOCK_MONOTONIC,
CLOCK_PROCESS_CPUTIME_ID,
@@ -34,7 +34,7 @@ clock_t clock_list[] = {
case def_name: \
return #def_name;
-const char *get_clock_str(const int clock_id)
+static inline const char *get_clock_str(const int clock_id)
{
switch (clock_id) {
CLOCK_TO_STR(CLOCK_REALTIME);
@@ -50,7 +50,7 @@ const char *get_clock_str(const int clock_id)
}
}
-int possibly_unsupported(clock_t clock)
+static inline int possibly_unsupported(clock_t clock)
{
switch (clock) {
case CLOCK_BOOTTIME:
@@ -63,7 +63,7 @@ int possibly_unsupported(clock_t clock)
}
}
-int have_cputime_timers(void)
+static inline int have_cputime_timers(void)
{
return tst_kvercmp(2, 6, 12) >= 0;
}
--
2.25.0.rc1.19.g042ed3e048af
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-05-04 14:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-28 8:10 [LTP] [PATCH V2] common_timers: staticize all definitions Viresh Kumar
2020-04-28 8:26 ` Petr Vorel
2020-05-04 14:45 ` Cyril Hrubis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox