public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Theodore Ts'o <tytso@mit.edu>
Cc: Ext4 Developers List <linux-ext4@vger.kernel.org>
Subject: [PATCH] libsupport: change get_thread_id return type to unsigned long long
Date: Fri, 3 Apr 2026 08:19:27 -0700	[thread overview]
Message-ID: <20260403151927.GB6192@frogsfrogsfrogs> (raw)

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();
 }

             reply	other threads:[~2026-04-03 15:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-03 15:19 Darrick J. Wong [this message]
2026-04-03 21:10 ` [PATCH] libsupport: change get_thread_id return type to unsigned long long Theodore Ts'o

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260403151927.GB6192@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox