Commit 7d17b29b authored by John Hubbard's avatar John Hubbard Committed by Shuah Khan

selftests/x86: remove (or use) unused variables and functions

When building with clang, via:

    make LLVM=1 -C tools/testing/selftests

...quite a few functions are variables are generating "unused" warnings.
Fix the warnings by deleting the unused items.

One item, the "nerrs" variable in vsdo_restorer.c's main(), is unused
but probably wants to be returned from main(), as a non-zero result.
That result is also unused right now, so another option would be to
delete it entirely, but this way, main() also gets fixed. It was missing
a return value.
Acked-by: default avatarMuhammad Usama Anjum <usama.anjum@collabora.com>
Signed-off-by: default avatarJohn Hubbard <jhubbard@nvidia.com>
Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
parent a89e5890
...@@ -39,16 +39,6 @@ struct xsave_buffer { ...@@ -39,16 +39,6 @@ struct xsave_buffer {
}; };
}; };
static inline uint64_t xgetbv(uint32_t index)
{
uint32_t eax, edx;
asm volatile("xgetbv;"
: "=a" (eax), "=d" (edx)
: "c" (index));
return eax + ((uint64_t)edx << 32);
}
static inline void xsave(struct xsave_buffer *xbuf, uint64_t rfbm) static inline void xsave(struct xsave_buffer *xbuf, uint64_t rfbm)
{ {
uint32_t rfbm_lo = rfbm; uint32_t rfbm_lo = rfbm;
...@@ -164,12 +154,6 @@ static inline void clear_xstate_header(struct xsave_buffer *buffer) ...@@ -164,12 +154,6 @@ static inline void clear_xstate_header(struct xsave_buffer *buffer)
memset(&buffer->header, 0, sizeof(buffer->header)); memset(&buffer->header, 0, sizeof(buffer->header));
} }
static inline uint64_t get_xstatebv(struct xsave_buffer *buffer)
{
/* XSTATE_BV is at the beginning of the header: */
return *(uint64_t *)&buffer->header;
}
static inline void set_xstatebv(struct xsave_buffer *buffer, uint64_t bv) static inline void set_xstatebv(struct xsave_buffer *buffer, uint64_t bv)
{ {
/* XSTATE_BV is at the beginning of the header: */ /* XSTATE_BV is at the beginning of the header: */
......
...@@ -109,11 +109,6 @@ static inline void wrgsbase(unsigned long gsbase) ...@@ -109,11 +109,6 @@ static inline void wrgsbase(unsigned long gsbase)
asm volatile("wrgsbase %0" :: "r" (gsbase) : "memory"); asm volatile("wrgsbase %0" :: "r" (gsbase) : "memory");
} }
static inline void wrfsbase(unsigned long fsbase)
{
asm volatile("wrfsbase %0" :: "r" (fsbase) : "memory");
}
enum which_base { FS, GS }; enum which_base { FS, GS };
static unsigned long read_base(enum which_base which) static unsigned long read_base(enum which_base which)
...@@ -212,7 +207,6 @@ static void mov_0_gs(unsigned long initial_base, bool schedule) ...@@ -212,7 +207,6 @@ static void mov_0_gs(unsigned long initial_base, bool schedule)
} }
static volatile unsigned long remote_base; static volatile unsigned long remote_base;
static volatile bool remote_hard_zero;
static volatile unsigned int ftx; static volatile unsigned int ftx;
/* /*
......
...@@ -29,7 +29,6 @@ static void sethandler(int sig, void (*handler)(int, siginfo_t *, void *), ...@@ -29,7 +29,6 @@ static void sethandler(int sig, void (*handler)(int, siginfo_t *, void *),
err(1, "sigaction"); err(1, "sigaction");
} }
static volatile sig_atomic_t sig_traps;
static sigjmp_buf jmpbuf; static sigjmp_buf jmpbuf;
static volatile sig_atomic_t n_errs; static volatile sig_atomic_t n_errs;
......
...@@ -97,11 +97,6 @@ static inline long sys_gtod(struct timeval *tv, struct timezone *tz) ...@@ -97,11 +97,6 @@ static inline long sys_gtod(struct timeval *tv, struct timezone *tz)
return syscall(SYS_gettimeofday, tv, tz); return syscall(SYS_gettimeofday, tv, tz);
} }
static inline int sys_clock_gettime(clockid_t id, struct timespec *ts)
{
return syscall(SYS_clock_gettime, id, ts);
}
static inline long sys_time(time_t *t) static inline long sys_time(time_t *t)
{ {
return syscall(SYS_time, t); return syscall(SYS_time, t);
......
...@@ -92,4 +92,6 @@ int main() ...@@ -92,4 +92,6 @@ int main()
printf("[FAIL]\t!SA_SIGINFO handler was not called\n"); printf("[FAIL]\t!SA_SIGINFO handler was not called\n");
nerrs++; nerrs++;
} }
return nerrs;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment