diff options
Diffstat (limited to 'driver/gator_events_mali_t6xx_hw_test.c')
-rw-r--r-- | driver/gator_events_mali_t6xx_hw_test.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/driver/gator_events_mali_t6xx_hw_test.c b/driver/gator_events_mali_t6xx_hw_test.c index 2a35e77..eb77110 100644 --- a/driver/gator_events_mali_t6xx_hw_test.c +++ b/driver/gator_events_mali_t6xx_hw_test.c @@ -11,7 +11,7 @@ * Test functions for mali_t600_hw code. */ -static int is_read_scheduled(const struct timespec *current_time, u32* prev_time_s, s32* next_read_time_ns); +static int is_read_scheduled(const struct timespec *current_time, u32 *prev_time_s, s32 *next_read_time_ns); static int test_is_read_scheduled(u32 s, u32 ns, u32 prev_s, s32 next_ns, int expected_result, s32 expected_next_ns) { @@ -22,14 +22,12 @@ static int test_is_read_scheduled(u32 s, u32 ns, u32 prev_s, s32 next_ns, int ex current_time.tv_sec = s; current_time.tv_nsec = ns; - if(is_read_scheduled(¤t_time, &prev_time_s, &next_read_time_ns) != expected_result) - { + if (is_read_scheduled(¤t_time, &prev_time_s, &next_read_time_ns) != expected_result) { printk("Failed do_read(%u, %u, %u, %d): expected %d\n", s, ns, prev_s, next_ns, expected_result); return 0; } - if(next_read_time_ns != expected_next_ns) - { + if (next_read_time_ns != expected_next_ns) { printk("Failed: next_read_ns expected=%d, actual=%d\n", expected_next_ns, next_read_time_ns); return 0; } @@ -44,14 +42,14 @@ static void test_all_is_read_scheduled(void) printk("gator: running tests on %s\n", __FILE__); - n_tests_passed += test_is_read_scheduled(0,0,0,0, 1, READ_INTERVAL_NSEC); /* Null time */ - n_tests_passed += test_is_read_scheduled(100,1000,0,0, 1, READ_INTERVAL_NSEC + 1000); /* Initial values */ + n_tests_passed += test_is_read_scheduled(0, 0, 0, 0, 1, READ_INTERVAL_NSEC); /* Null time */ + n_tests_passed += test_is_read_scheduled(100, 1000, 0, 0, 1, READ_INTERVAL_NSEC + 1000); /* Initial values */ - n_tests_passed += test_is_read_scheduled(100, HIGHEST_NS, 100, HIGHEST_NS + 500, 0, HIGHEST_NS + 500); - n_tests_passed += test_is_read_scheduled(101, 0001, 100, HIGHEST_NS + 500, 0, HIGHEST_NS + 500 - NSEC_PER_SEC); - n_tests_passed += test_is_read_scheduled(101, 600, 100, HIGHEST_NS + 500 - NSEC_PER_SEC, 1, 600 + READ_INTERVAL_NSEC); + n_tests_passed += test_is_read_scheduled(100, HIGHEST_NS, 100, HIGHEST_NS + 500, 0, HIGHEST_NS + 500); + n_tests_passed += test_is_read_scheduled(101, 0001, 100, HIGHEST_NS + 500, 0, HIGHEST_NS + 500 - NSEC_PER_SEC); + n_tests_passed += test_is_read_scheduled(101, 600, 100, HIGHEST_NS + 500 - NSEC_PER_SEC, 1, 600 + READ_INTERVAL_NSEC); - n_tests_passed += test_is_read_scheduled(101, 600, 100, HIGHEST_NS + 500, 1, 600 + READ_INTERVAL_NSEC); + n_tests_passed += test_is_read_scheduled(101, 600, 100, HIGHEST_NS + 500, 1, 600 + READ_INTERVAL_NSEC); printk("gator: %d tests passed\n", n_tests_passed); } |