public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] sched_stress: Use time_t instead of long for type
@ 2024-05-06 19:03 Khem Raj
  2024-05-06 21:00 ` Petr Vorel
  0 siblings, 1 reply; 4+ messages in thread
From: Khem Raj @ 2024-05-06 19:03 UTC (permalink / raw)
  To: ltp; +Cc: Khem Raj

This ensures it works across different architectures
Fixes

| sched_driver.c:744:43: error: passing argument 1 of 'ctime' from incompatible pointer type [-Wincompatible-pointer-types]
|   744 |         printf("\nend time = %s\n", ctime(&end_time));
|       |                                           ^~~~~~~~~

With gcc-14

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 testcases/kernel/sched/sched_stress/sched_driver.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/testcases/kernel/sched/sched_stress/sched_driver.c b/testcases/kernel/sched/sched_stress/sched_driver.c
index 61573d788..5b8c187fe 100644
--- a/testcases/kernel/sched/sched_stress/sched_driver.c
+++ b/testcases/kernel/sched/sched_stress/sched_driver.c
@@ -136,7 +136,7 @@ int debug = 0;
 /*
  * Function prototypes
  */
-void startup(long);
+void startup(time_t);
 int start_testcase(char *, char *, char *, char *, char *, char *);
 int process_slots_in_use();
 int available_user_process_slots();
@@ -251,7 +251,7 @@ int main(int argc, char **argv)
  * information to the screen and .  It also initializes the	 *
  * process id list and other global variables.	 			 *
  *-----------------------------------------------------------------------*/
-void startup(long start_time)
+void startup(time_t start_time)
 {
 	char tempbuffer[50];	/* temporary buffer to hold names */
 
@@ -734,7 +734,7 @@ void kill_short_term_testcases()
 void finishup(start_time)
 long start_time;		/* starting time to calculate elapsed time */
 {
-	long end_time;		/* time when program finished */
+	time_t end_time;		/* time when program finished */
 
 	/*
 	 * Get the end time and calculate elapsed time; write all this out
-- 
2.45.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-05-07  7:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-06 19:03 [LTP] [PATCH] sched_stress: Use time_t instead of long for type Khem Raj
2024-05-06 21:00 ` Petr Vorel
2024-05-06 23:15   ` Khem Raj
2024-05-07  7:28     ` Petr Vorel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox