Commit 701ca365 authored by Nathan Lynch's avatar Nathan Lynch Committed by Michael Ellerman

selftests/powerpc: add const qualification where possible

Various char * parameters in the common powerpc selftest APIs can be
const.
Signed-off-by: default avatarNathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230817-powerpc-selftest-misc-v1-2-a84cc1ef78b2@linux.ibm.com
parent ae3a8cc2
......@@ -24,7 +24,7 @@
/* Setting timeout to -1 disables the alarm */
static uint64_t timeout = 120;
int run_test(int (test_function)(void), char *name)
int run_test(int (test_function)(void), const char *name)
{
bool terminated;
int rc, status;
......@@ -101,7 +101,7 @@ void test_harness_set_timeout(uint64_t time)
timeout = time;
}
int test_harness(int (test_function)(void), char *name)
int test_harness(int (test_function)(void), const char *name)
{
int rc;
......
......@@ -6,37 +6,37 @@
#ifndef _SELFTESTS_POWERPC_SUBUNIT_H
#define _SELFTESTS_POWERPC_SUBUNIT_H
static inline void test_start(char *name)
static inline void test_start(const char *name)
{
printf("test: %s\n", name);
}
static inline void test_failure_detail(char *name, char *detail)
static inline void test_failure_detail(const char *name, const char *detail)
{
printf("failure: %s [%s]\n", name, detail);
}
static inline void test_failure(char *name)
static inline void test_failure(const char *name)
{
printf("failure: %s\n", name);
}
static inline void test_error(char *name)
static inline void test_error(const char *name)
{
printf("error: %s\n", name);
}
static inline void test_skip(char *name)
static inline void test_skip(const char *name)
{
printf("skip: %s\n", name);
}
static inline void test_success(char *name)
static inline void test_success(const char *name)
{
printf("success: %s\n", name);
}
static inline void test_finish(char *name, int status)
static inline void test_finish(const char *name, int status)
{
if (status)
test_failure(name);
......@@ -44,7 +44,7 @@ static inline void test_finish(char *name, int status)
test_success(name);
}
static inline void test_set_git_version(char *value)
static inline void test_set_git_version(const char *value)
{
printf("tags: git_version:%s\n", value);
}
......
......@@ -32,7 +32,7 @@ typedef uint16_t u16;
typedef uint8_t u8;
void test_harness_set_timeout(uint64_t time);
int test_harness(int (test_function)(void), char *name);
int test_harness(int (test_function)(void), const char *name);
int read_auxv(char *buf, ssize_t buf_size);
void *find_auxv_entry(int type, char *auxv);
......
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