Commit bc7e5d23 authored by Nathan Chancellor's avatar Nathan Chancellor Committed by Shuah Khan
Browse files

selftests: timers: ksft_exit functions do not return



After commit f7d5bcd3 ("selftests: kselftest: Mark functions that
unconditionally call exit() as __noreturn"), ksft_exit_...() functions
are marked as __noreturn, which means the return type should not be
'int' but 'void' because they are not returning anything (and never were
since exit() has always been called).

To facilitate updating the return type of these functions, remove
'return' before the calls to ksft_exit_...(), as __noreturn prevents the
compiler from warning that a caller of the ksft_exit functions does not
return a value because the program will terminate upon calling these
functions.

Reviewed-by: default avatarMuhammad Usama Anjum <usama.anjum@collabora.com>
Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
parent 102690be
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -205,7 +205,7 @@ int main(int argc, char **argv)
	adjtimex(&tx1);

	if (err)
		return ksft_exit_fail();
		ksft_exit_fail();

	return ksft_exit_pass();
	ksft_exit_pass();
}
+2 −2
Original line number Diff line number Diff line
@@ -173,6 +173,6 @@ int main(void)
		timer_delete(tm1);
	}
	if (final_ret)
		return ksft_exit_fail();
	return ksft_exit_pass();
		ksft_exit_fail();
	ksft_exit_pass();
}
+2 −2
Original line number Diff line number Diff line
@@ -89,8 +89,8 @@ int main(int argc, char **argv)

	if (ret) {
		printf("[FAIL]");
		return ksft_exit_fail();
		ksft_exit_fail();
	}
	printf("[OK]");
	return ksft_exit_pass();
	ksft_exit_pass();
}
+2 −2
Original line number Diff line number Diff line
@@ -257,7 +257,7 @@ int main(int argc, char **argv)
	set_frequency(0.0);

	if (fails)
		return ksft_exit_fail();
		ksft_exit_fail();

	return ksft_exit_pass();
	ksft_exit_pass();
}
+5 −5
Original line number Diff line number Diff line
@@ -268,7 +268,7 @@ int main(int argc, char **argv)
		if (ret < 0) {
			printf("Error: Problem setting STA_INS/STA_DEL!: %s\n",
							time_state_str(ret));
			return ksft_exit_fail();
			ksft_exit_fail();
		}

		/* Validate STA_INS was set */
@@ -277,7 +277,7 @@ int main(int argc, char **argv)
		if (tx.status != STA_INS && tx.status != STA_DEL) {
			printf("Error: STA_INS/STA_DEL not set!: %s\n",
							time_state_str(ret));
			return ksft_exit_fail();
			ksft_exit_fail();
		}

		if (tai_time) {
@@ -295,7 +295,7 @@ int main(int argc, char **argv)
		se.sigev_value.sival_int = 0;
		if (timer_create(CLOCK_REALTIME, &se, &tm1) == -1) {
			printf("Error: timer_create failed\n");
			return ksft_exit_fail();
			ksft_exit_fail();
		}
		its1.it_value.tv_sec = next_leap;
		its1.it_value.tv_nsec = 0;
@@ -366,7 +366,7 @@ int main(int argc, char **argv)
		if (error_found) {
			printf("Errors observed\n");
			clear_time_state();
			return ksft_exit_fail();
			ksft_exit_fail();
		}
		printf("\n");
		if ((iterations != -1) && !(--iterations))
@@ -374,5 +374,5 @@ int main(int argc, char **argv)
	}

	clear_time_state();
	return ksft_exit_pass();
	ksft_exit_pass();
}
Loading