Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

KVM: selftests: Use s32 instead of int32_t

Use s32 instead of int32_t to make the KVM selftests code more concise
and more similar to the kernel (since selftests are primarily developed
by kernel developers).

This commit was generated with the following command:

git ls-files tools/testing/selftests/kvm | xargs sed -i 's/int32_t/s32/g'

Then by manually adjusting whitespace to make checkpatch.pl happy.

No functional change intended.

Signed-off-by: David Matlack <dmatlack@google.com>
Link: https://patch.msgid.link/20260420212004.3938325-8-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>

authored by

David Matlack and committed by
Sean Christopherson
7b609187 0c3a8774

+14 -14
+12 -12
tools/testing/selftests/kvm/arm64/arch_timer_edge_cases.c
··· 25 25 /* Depends on counter width. */ 26 26 static u64 CVAL_MAX; 27 27 /* tval is a signed 32-bit int. */ 28 - static const int32_t TVAL_MAX = INT32_MAX; 29 - static const int32_t TVAL_MIN = INT32_MIN; 28 + static const s32 TVAL_MAX = INT32_MAX; 29 + static const s32 TVAL_MIN = INT32_MIN; 30 30 31 31 /* After how much time we say there is no IRQ. */ 32 32 static const u32 TIMEOUT_NO_IRQ_US = 50000; ··· 355 355 test_timer_xval(timer, cval, TIMER_CVAL, wm, reset_state, reset_cnt); 356 356 } 357 357 358 - static void test_timer_tval(enum arch_timer timer, int32_t tval, 358 + static void test_timer_tval(enum arch_timer timer, s32 tval, 359 359 irq_wait_method_t wm, bool reset_state, 360 360 u64 reset_cnt) 361 361 { ··· 385 385 test_xval_check_no_irq(timer, cval, usec, TIMER_CVAL, wm); 386 386 } 387 387 388 - static void test_tval_no_irq(enum arch_timer timer, int32_t tval, u64 usec, 388 + static void test_tval_no_irq(enum arch_timer timer, s32 tval, u64 usec, 389 389 sleep_method_t wm) 390 390 { 391 - /* tval will be cast to an int32_t in test_xval_check_no_irq */ 391 + /* tval will be cast to an s32 in test_xval_check_no_irq */ 392 392 test_xval_check_no_irq(timer, (u64)tval, usec, TIMER_TVAL, wm); 393 393 } 394 394 ··· 463 463 * timeout for the wait: we use the wfi instruction. 464 464 */ 465 465 static void test_reprogramming_timer(enum arch_timer timer, irq_wait_method_t wm, 466 - int32_t delta_1_ms, int32_t delta_2_ms) 466 + s32 delta_1_ms, s32 delta_2_ms) 467 467 { 468 468 local_irq_disable(); 469 469 reset_timer_state(timer, DEF_CNT); ··· 504 504 505 505 static void test_basic_functionality(enum arch_timer timer) 506 506 { 507 - int32_t tval = (int32_t) msec_to_cycles(test_args.wait_ms); 507 + s32 tval = (s32)msec_to_cycles(test_args.wait_ms); 508 508 u64 cval = DEF_CNT + msec_to_cycles(test_args.wait_ms); 509 509 int i; 510 510 ··· 685 685 } 686 686 687 687 static void test_set_cnt_after_tval(enum arch_timer timer, u64 cnt_1, 688 - int32_t tval, u64 cnt_2, 688 + s32 tval, u64 cnt_2, 689 689 irq_wait_method_t wm) 690 690 { 691 691 test_set_cnt_after_xval(timer, cnt_1, tval, cnt_2, wm, TIMER_TVAL); ··· 699 699 } 700 700 701 701 static void test_set_cnt_after_tval_no_irq(enum arch_timer timer, 702 - u64 cnt_1, int32_t tval, 702 + u64 cnt_1, s32 tval, 703 703 u64 cnt_2, sleep_method_t wm) 704 704 { 705 705 test_set_cnt_after_xval_no_irq(timer, cnt_1, tval, cnt_2, wm, ··· 718 718 static void test_move_counters_ahead_of_timers(enum arch_timer timer) 719 719 { 720 720 int i; 721 - int32_t tval; 721 + s32 tval; 722 722 723 723 for (i = 0; i < ARRAY_SIZE(irq_wait_method); i++) { 724 724 irq_wait_method_t wm = irq_wait_method[i]; ··· 753 753 754 754 static void test_timers_in_the_past(enum arch_timer timer) 755 755 { 756 - int32_t tval = -1 * (int32_t) msec_to_cycles(test_args.wait_ms); 756 + s32 tval = -1 * (s32)msec_to_cycles(test_args.wait_ms); 757 757 u64 cval; 758 758 int i; 759 759 ··· 789 789 790 790 static void test_long_timer_delays(enum arch_timer timer) 791 791 { 792 - int32_t tval = (int32_t) msec_to_cycles(test_args.long_wait_ms); 792 + s32 tval = (s32)msec_to_cycles(test_args.long_wait_ms); 793 793 u64 cval = DEF_CNT + msec_to_cycles(test_args.long_wait_ms); 794 794 int i; 795 795
+2 -2
tools/testing/selftests/kvm/include/arm64/arch_timer.h
··· 79 79 return 0; 80 80 } 81 81 82 - static inline void timer_set_tval(enum arch_timer timer, int32_t tval) 82 + static inline void timer_set_tval(enum arch_timer timer, s32 tval) 83 83 { 84 84 switch (timer) { 85 85 case VIRTUAL: ··· 95 95 isb(); 96 96 } 97 97 98 - static inline int32_t timer_get_tval(enum arch_timer timer) 98 + static inline s32 timer_get_tval(enum arch_timer timer) 99 99 { 100 100 isb(); 101 101 switch (timer) {