linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rt-tests: Use gettid from rt-utils.c everywhere
@ 2019-06-26 11:08 John Kacur
  2019-06-26 11:12 ` Sebastian Siewior
  2019-06-26 11:25 ` Kurt Kanzenbach
  0 siblings, 2 replies; 3+ messages in thread
From: John Kacur @ 2019-06-26 11:08 UTC (permalink / raw)
  To: rt-users; +Cc: Sebastian Siewior, Kurt Kanzenbach, Clark Williams, John Kacur

gettid is defined in rt-utils, so we should use that everywhere instead
of defining a separate macro in each test for it.

Signed-off-by: John Kacur <jkacur@redhat.com>
---
 src/cyclictest/cyclictest.c           | 2 --
 src/pmqtest/pmqtest.c                 | 2 --
 src/ptsematest/ptsematest.c           | 2 --
 src/rt-migrate-test/rt-migrate-test.c | 2 --
 src/signaltest/signaltest.c           | 3 ---
 src/sigwaittest/sigwaittest.c         | 2 --
 src/svsematest/svsematest.c           | 2 --
 7 files changed, 15 deletions(-)

diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
index 03d56e4f520c..83f169d381b7 100644
--- a/src/cyclictest/cyclictest.c
+++ b/src/cyclictest/cyclictest.c
@@ -54,8 +54,6 @@
 
 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
 
-/* Ugly, but .... */
-#define gettid() syscall(__NR_gettid)
 #define sigev_notify_thread_id _sigev_un._tid
 
 #ifdef __UCLIBC__
diff --git a/src/pmqtest/pmqtest.c b/src/pmqtest/pmqtest.c
index 054768d161a7..2191710961fe 100644
--- a/src/pmqtest/pmqtest.c
+++ b/src/pmqtest/pmqtest.c
@@ -41,8 +41,6 @@
 
 #include <pthread.h>
 
-#define gettid() syscall(__NR_gettid)
-
 #define USEC_PER_SEC 1000000
 
 #define SYNCMQ_NAME "/syncmsg%d"
diff --git a/src/ptsematest/ptsematest.c b/src/ptsematest/ptsematest.c
index 6bedbc81b572..e8a3177b63dd 100644
--- a/src/ptsematest/ptsematest.c
+++ b/src/ptsematest/ptsematest.c
@@ -40,8 +40,6 @@
 
 #include <pthread.h>
 
-#define gettid() syscall(__NR_gettid)
-
 #define USEC_PER_SEC 1000000
 
 enum {
diff --git a/src/rt-migrate-test/rt-migrate-test.c b/src/rt-migrate-test/rt-migrate-test.c
index 8223d6669a37..f0a285d1d45f 100644
--- a/src/rt-migrate-test/rt-migrate-test.c
+++ b/src/rt-migrate-test/rt-migrate-test.c
@@ -43,8 +43,6 @@
 #include <pthread.h>
 #include "rt-utils.h"
 
-#define gettid() syscall(__NR_gettid)
-
 int nr_tasks;
 int lfd;
 
diff --git a/src/signaltest/signaltest.c b/src/signaltest/signaltest.c
index a168191b7573..4c952561d7f2 100644
--- a/src/signaltest/signaltest.c
+++ b/src/signaltest/signaltest.c
@@ -32,9 +32,6 @@
 
 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
 
-/* Ugly, but .... */
-#define gettid() syscall(__NR_gettid)
-
 #define USEC_PER_SEC		1000000
 #define NSEC_PER_SEC		1000000000
 
diff --git a/src/sigwaittest/sigwaittest.c b/src/sigwaittest/sigwaittest.c
index 6e3c28330447..4579f903c909 100644
--- a/src/sigwaittest/sigwaittest.c
+++ b/src/sigwaittest/sigwaittest.c
@@ -41,8 +41,6 @@
 
 #include <pthread.h>
 
-#define gettid() syscall(__NR_gettid)
-
 #define USEC_PER_SEC 1000000
 
 enum {
diff --git a/src/svsematest/svsematest.c b/src/svsematest/svsematest.c
index dfa4660c0e43..01083d13dde6 100644
--- a/src/svsematest/svsematest.c
+++ b/src/svsematest/svsematest.c
@@ -44,8 +44,6 @@
 #include "rt-get_cpu.h"
 #include "error.h"
 
-#define gettid() syscall(__NR_gettid)
-
 #define USEC_PER_SEC 1000000
 
 #define SEM_WAIT_FOR_RECEIVER 0
-- 
2.20.1


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

* Re: [PATCH] rt-tests: Use gettid from rt-utils.c everywhere
  2019-06-26 11:08 [PATCH] rt-tests: Use gettid from rt-utils.c everywhere John Kacur
@ 2019-06-26 11:12 ` Sebastian Siewior
  2019-06-26 11:25 ` Kurt Kanzenbach
  1 sibling, 0 replies; 3+ messages in thread
From: Sebastian Siewior @ 2019-06-26 11:12 UTC (permalink / raw)
  To: John Kacur; +Cc: rt-users, Kurt Kanzenbach, Clark Williams

On 2019-06-26 13:08:38 [+0200], John Kacur wrote:
> gettid is defined in rt-utils, so we should use that everywhere instead
> of defining a separate macro in each test for it.

perfect.

Sebastian

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

* Re: [PATCH] rt-tests: Use gettid from rt-utils.c everywhere
  2019-06-26 11:08 [PATCH] rt-tests: Use gettid from rt-utils.c everywhere John Kacur
  2019-06-26 11:12 ` Sebastian Siewior
@ 2019-06-26 11:25 ` Kurt Kanzenbach
  1 sibling, 0 replies; 3+ messages in thread
From: Kurt Kanzenbach @ 2019-06-26 11:25 UTC (permalink / raw)
  To: John Kacur; +Cc: rt-users, Sebastian Siewior, Clark Williams

[-- Attachment #1: Type: text/plain, Size: 224 bytes --]

Hi,

On Wed, Jun 26, 2019 at 01:08:38PM +0200, John Kacur wrote:
> gettid is defined in rt-utils, so we should use that everywhere instead
> of defining a separate macro in each test for it.

looks good to me.

Thanks,
Kurt

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2019-06-26 11:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-26 11:08 [PATCH] rt-tests: Use gettid from rt-utils.c everywhere John Kacur
2019-06-26 11:12 ` Sebastian Siewior
2019-06-26 11:25 ` Kurt Kanzenbach

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).