Skip to content

Commit

Permalink
selftests/powerpc: add const qualification where possible
Browse files Browse the repository at this point in the history
Various char * parameters in the common powerpc selftest APIs can be
const.

Signed-off-by: Nathan Lynch <[email protected]>
  • Loading branch information
nathanlynch authored and intel-lab-lkp committed Aug 17, 2023
1 parent 5e7fada commit c49abb7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions tools/testing/selftests/powerpc/harness.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down
16 changes: 8 additions & 8 deletions tools/testing/selftests/powerpc/include/subunit.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,45 +6,45 @@
#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);
else
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);
}
Expand Down
2 changes: 1 addition & 1 deletion tools/testing/selftests/powerpc/include/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c49abb7

Please sign in to comment.