Commit 9d73d192 authored by Mark Brown's avatar Mark Brown Committed by Takashi Iwai

kselftest: alsa: Declare most functions static

This program has only one file so most functions can be static.
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Reviewed-by: default avatarShuah Khan <skhan@linuxfoundation.org>
Reviewed-by: default avatarJaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20220202150902.19563-2-broonie@kernel.orgSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent b1446bda
...@@ -71,7 +71,8 @@ struct ctl_data *ctl_list = NULL; ...@@ -71,7 +71,8 @@ struct ctl_data *ctl_list = NULL;
#endif #endif
#ifndef LIB_HAS_LOAD_STRING #ifndef LIB_HAS_LOAD_STRING
int snd_config_load_string(snd_config_t **config, const char *s, size_t size) static int snd_config_load_string(snd_config_t **config, const char *s,
size_t size)
{ {
snd_input_t *input; snd_input_t *input;
snd_config_t *dst; snd_config_t *dst;
...@@ -99,7 +100,7 @@ int snd_config_load_string(snd_config_t **config, const char *s, size_t size) ...@@ -99,7 +100,7 @@ int snd_config_load_string(snd_config_t **config, const char *s, size_t size)
} }
#endif #endif
void find_controls(void) static void find_controls(void)
{ {
char name[32]; char name[32];
int card, ctl, err; int card, ctl, err;
...@@ -222,7 +223,7 @@ void find_controls(void) ...@@ -222,7 +223,7 @@ void find_controls(void)
* Block for up to timeout ms for an event, returns a negative value * Block for up to timeout ms for an event, returns a negative value
* on error, 0 for no event and 1 for an event. * on error, 0 for no event and 1 for an event.
*/ */
int wait_for_event(struct ctl_data *ctl, int timeout) static int wait_for_event(struct ctl_data *ctl, int timeout)
{ {
unsigned short revents; unsigned short revents;
snd_ctl_event_t *event; snd_ctl_event_t *event;
...@@ -291,8 +292,9 @@ int wait_for_event(struct ctl_data *ctl, int timeout) ...@@ -291,8 +292,9 @@ int wait_for_event(struct ctl_data *ctl, int timeout)
return 1; return 1;
} }
bool ctl_value_index_valid(struct ctl_data *ctl, snd_ctl_elem_value_t *val, static bool ctl_value_index_valid(struct ctl_data *ctl,
int index) snd_ctl_elem_value_t *val,
int index)
{ {
long int_val; long int_val;
long long int64_val; long long int64_val;
...@@ -403,7 +405,7 @@ bool ctl_value_index_valid(struct ctl_data *ctl, snd_ctl_elem_value_t *val, ...@@ -403,7 +405,7 @@ bool ctl_value_index_valid(struct ctl_data *ctl, snd_ctl_elem_value_t *val,
* Check that the provided value meets the constraints for the * Check that the provided value meets the constraints for the
* provided control. * provided control.
*/ */
bool ctl_value_valid(struct ctl_data *ctl, snd_ctl_elem_value_t *val) static bool ctl_value_valid(struct ctl_data *ctl, snd_ctl_elem_value_t *val)
{ {
int i; int i;
bool valid = true; bool valid = true;
...@@ -419,7 +421,7 @@ bool ctl_value_valid(struct ctl_data *ctl, snd_ctl_elem_value_t *val) ...@@ -419,7 +421,7 @@ bool ctl_value_valid(struct ctl_data *ctl, snd_ctl_elem_value_t *val)
* Check that we can read the default value and it is valid. Write * Check that we can read the default value and it is valid. Write
* tests use the read value to restore the default. * tests use the read value to restore the default.
*/ */
void test_ctl_get_value(struct ctl_data *ctl) static void test_ctl_get_value(struct ctl_data *ctl)
{ {
int err; int err;
...@@ -454,9 +456,9 @@ void test_ctl_get_value(struct ctl_data *ctl) ...@@ -454,9 +456,9 @@ void test_ctl_get_value(struct ctl_data *ctl)
ctl->card->card, ctl->elem); ctl->card->card, ctl->elem);
} }
bool show_mismatch(struct ctl_data *ctl, int index, static bool show_mismatch(struct ctl_data *ctl, int index,
snd_ctl_elem_value_t *read_val, snd_ctl_elem_value_t *read_val,
snd_ctl_elem_value_t *expected_val) snd_ctl_elem_value_t *expected_val)
{ {
long long expected_int, read_int; long long expected_int, read_int;
...@@ -519,9 +521,9 @@ bool show_mismatch(struct ctl_data *ctl, int index, ...@@ -519,9 +521,9 @@ bool show_mismatch(struct ctl_data *ctl, int index,
* the write to fail, for verifying that invalid writes don't corrupt * the write to fail, for verifying that invalid writes don't corrupt
* anything. * anything.
*/ */
int write_and_verify(struct ctl_data *ctl, static int write_and_verify(struct ctl_data *ctl,
snd_ctl_elem_value_t *write_val, snd_ctl_elem_value_t *write_val,
snd_ctl_elem_value_t *expected_val) snd_ctl_elem_value_t *expected_val)
{ {
int err, i; int err, i;
bool error_expected, mismatch_shown; bool error_expected, mismatch_shown;
...@@ -628,7 +630,7 @@ int write_and_verify(struct ctl_data *ctl, ...@@ -628,7 +630,7 @@ int write_and_verify(struct ctl_data *ctl,
* Make sure we can write the default value back to the control, this * Make sure we can write the default value back to the control, this
* should validate that at least some write works. * should validate that at least some write works.
*/ */
void test_ctl_write_default(struct ctl_data *ctl) static void test_ctl_write_default(struct ctl_data *ctl)
{ {
int err; int err;
...@@ -661,7 +663,7 @@ void test_ctl_write_default(struct ctl_data *ctl) ...@@ -661,7 +663,7 @@ void test_ctl_write_default(struct ctl_data *ctl)
ctl->card->card, ctl->elem); ctl->card->card, ctl->elem);
} }
bool test_ctl_write_valid_boolean(struct ctl_data *ctl) static bool test_ctl_write_valid_boolean(struct ctl_data *ctl)
{ {
int err, i, j; int err, i, j;
bool fail = false; bool fail = false;
...@@ -682,7 +684,7 @@ bool test_ctl_write_valid_boolean(struct ctl_data *ctl) ...@@ -682,7 +684,7 @@ bool test_ctl_write_valid_boolean(struct ctl_data *ctl)
return !fail; return !fail;
} }
bool test_ctl_write_valid_integer(struct ctl_data *ctl) static bool test_ctl_write_valid_integer(struct ctl_data *ctl)
{ {
int err; int err;
int i; int i;
...@@ -712,7 +714,7 @@ bool test_ctl_write_valid_integer(struct ctl_data *ctl) ...@@ -712,7 +714,7 @@ bool test_ctl_write_valid_integer(struct ctl_data *ctl)
return !fail; return !fail;
} }
bool test_ctl_write_valid_integer64(struct ctl_data *ctl) static bool test_ctl_write_valid_integer64(struct ctl_data *ctl)
{ {
int err, i; int err, i;
long long j, step; long long j, step;
...@@ -740,7 +742,7 @@ bool test_ctl_write_valid_integer64(struct ctl_data *ctl) ...@@ -740,7 +742,7 @@ bool test_ctl_write_valid_integer64(struct ctl_data *ctl)
return !fail; return !fail;
} }
bool test_ctl_write_valid_enumerated(struct ctl_data *ctl) static bool test_ctl_write_valid_enumerated(struct ctl_data *ctl)
{ {
int err, i, j; int err, i, j;
bool fail = false; bool fail = false;
...@@ -761,7 +763,7 @@ bool test_ctl_write_valid_enumerated(struct ctl_data *ctl) ...@@ -761,7 +763,7 @@ bool test_ctl_write_valid_enumerated(struct ctl_data *ctl)
return !fail; return !fail;
} }
void test_ctl_write_valid(struct ctl_data *ctl) static void test_ctl_write_valid(struct ctl_data *ctl)
{ {
bool pass; bool pass;
int err; int err;
...@@ -814,8 +816,8 @@ void test_ctl_write_valid(struct ctl_data *ctl) ...@@ -814,8 +816,8 @@ void test_ctl_write_valid(struct ctl_data *ctl)
ctl->card->card, ctl->elem); ctl->card->card, ctl->elem);
} }
bool test_ctl_write_invalid_value(struct ctl_data *ctl, static bool test_ctl_write_invalid_value(struct ctl_data *ctl,
snd_ctl_elem_value_t *val) snd_ctl_elem_value_t *val)
{ {
int err; int err;
long val_read; long val_read;
...@@ -836,7 +838,7 @@ bool test_ctl_write_invalid_value(struct ctl_data *ctl, ...@@ -836,7 +838,7 @@ bool test_ctl_write_invalid_value(struct ctl_data *ctl,
return !ctl_value_valid(ctl, val); return !ctl_value_valid(ctl, val);
} }
bool test_ctl_write_invalid_boolean(struct ctl_data *ctl) static bool test_ctl_write_invalid_boolean(struct ctl_data *ctl)
{ {
int err, i; int err, i;
long val_read; long val_read;
...@@ -855,7 +857,7 @@ bool test_ctl_write_invalid_boolean(struct ctl_data *ctl) ...@@ -855,7 +857,7 @@ bool test_ctl_write_invalid_boolean(struct ctl_data *ctl)
return !fail; return !fail;
} }
bool test_ctl_write_invalid_integer(struct ctl_data *ctl) static bool test_ctl_write_invalid_integer(struct ctl_data *ctl)
{ {
int i; int i;
bool fail = false; bool fail = false;
...@@ -901,7 +903,7 @@ bool test_ctl_write_invalid_integer(struct ctl_data *ctl) ...@@ -901,7 +903,7 @@ bool test_ctl_write_invalid_integer(struct ctl_data *ctl)
return !fail; return !fail;
} }
bool test_ctl_write_invalid_integer64(struct ctl_data *ctl) static bool test_ctl_write_invalid_integer64(struct ctl_data *ctl)
{ {
int i; int i;
bool fail = false; bool fail = false;
...@@ -947,7 +949,7 @@ bool test_ctl_write_invalid_integer64(struct ctl_data *ctl) ...@@ -947,7 +949,7 @@ bool test_ctl_write_invalid_integer64(struct ctl_data *ctl)
return !fail; return !fail;
} }
bool test_ctl_write_invalid_enumerated(struct ctl_data *ctl) static bool test_ctl_write_invalid_enumerated(struct ctl_data *ctl)
{ {
int err, i; int err, i;
unsigned int val_read; unsigned int val_read;
...@@ -979,7 +981,7 @@ bool test_ctl_write_invalid_enumerated(struct ctl_data *ctl) ...@@ -979,7 +981,7 @@ bool test_ctl_write_invalid_enumerated(struct ctl_data *ctl)
} }
void test_ctl_write_invalid(struct ctl_data *ctl) static void test_ctl_write_invalid(struct ctl_data *ctl)
{ {
bool pass; bool pass;
int err; int err;
...@@ -1032,13 +1034,13 @@ void test_ctl_write_invalid(struct ctl_data *ctl) ...@@ -1032,13 +1034,13 @@ void test_ctl_write_invalid(struct ctl_data *ctl)
ctl->card->card, ctl->elem); ctl->card->card, ctl->elem);
} }
void test_ctl_event_missing(struct ctl_data *ctl) static void test_ctl_event_missing(struct ctl_data *ctl)
{ {
ksft_test_result(!ctl->event_missing, "event_missing.%d.%d\n", ksft_test_result(!ctl->event_missing, "event_missing.%d.%d\n",
ctl->card->card, ctl->elem); ctl->card->card, ctl->elem);
} }
void test_ctl_event_spurious(struct ctl_data *ctl) static void test_ctl_event_spurious(struct ctl_data *ctl)
{ {
ksft_test_result(!ctl->event_spurious, "event_spurious.%d.%d\n", ksft_test_result(!ctl->event_spurious, "event_spurious.%d.%d\n",
ctl->card->card, ctl->elem); ctl->card->card, ctl->elem);
......
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