public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libsupport: change get_thread_id return type to unsigned long long
@ 2026-04-03 15:19 Darrick J. Wong
  2026-04-03 21:10 ` Theodore Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: Darrick J. Wong @ 2026-04-03 15:19 UTC (permalink / raw)
  To: Theodore Ts'o; +Cc: Ext4 Developers List

From: Darrick J. Wong <djwong@kernel.org>

With -Wformat enabled, the e2fsprogs build spews out a lot of warnings
for fuse2fs:

 ../../misc/fuse2fs.c: In function ‘__fuse2fs_finish’:
 ../../misc/fuse2fs.c:152:24: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘uint64_t’ {aka ‘long unsigned int’} [-Wformat=]
   152 |                 printf("FUSE2FS (%s): tid=%llu " format, (fuse2fs)->shortdev, get_thread_id(), ##__VA_ARGS__); \
       |                        ^~~~~~~~~~~~~~~~~~~~~~~~~                              ~~~~~~~~~~~~~~~
       |                                                                               |
       |                                                                               uint64_t {aka long unsigned int}
 ../../misc/fuse2fs.c:556:17: note: in expansion of macro ‘dbg_printf’
   556 |                 dbg_printf(ff, "%s: libfuse ret=%d\n", func, ret);
       |                 ^~~~~~~~~~

Because the linter doesn't like mixing %llu with a uint64_t type.
On some platforms, uint64_t is merely "unsigned long" and whiiiiine.

Since this is a new wrapper function, let's change the return type.

Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
---
 lib/support/thread.h |    2 +-
 lib/support/thread.c |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/support/thread.h b/lib/support/thread.h
index 9a7f5c9db1b7a2..efba1c3b1eec0b 100644
--- a/lib/support/thread.h
+++ b/lib/support/thread.h
@@ -2,4 +2,4 @@
  * thread.h -- header file for thread utilities
  */
 
-uint64_t get_thread_id(void);
+unsigned long long get_thread_id(void);
diff --git a/lib/support/thread.c b/lib/support/thread.c
index a9a10940c0fd3e..651be1cf833860 100644
--- a/lib/support/thread.c
+++ b/lib/support/thread.c
@@ -12,7 +12,7 @@
 
 #include "support/thread.h"
 
-uint64_t get_thread_id(void)
+unsigned long long get_thread_id(void)
 {
 #if defined(HAVE_GETTID)
 	return gettid();
@@ -22,7 +22,7 @@ uint64_t get_thread_id(void)
 	if (pthread_threadid_np(NULL, &tid))
 		return tid;
 #elif defined(HAVE_PTHREAD)
-	return (__u64)(uintptr_t) pthread_self();
+	return (unsigned long long)(uintptr_t) pthread_self();
 #endif
 	return getpid();
 }

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

end of thread, other threads:[~2026-04-03 21:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-03 15:19 [PATCH] libsupport: change get_thread_id return type to unsigned long long Darrick J. Wong
2026-04-03 21:10 ` Theodore Ts'o

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