From 1f7f85fe13d73b59ea949d2709eb3173481cd23a Mon Sep 17 00:00:00 2001
From: Nico Huber <nico.h@gmx.de>
Date: Sat, 14 Feb 2026 11:55:04 +0100
Subject: [PATCH] udelay: Add cast for `tv_nsec` to always meet format string

There are libc's around where `tv_nsec` isn't a `long`, e.g. glibc
on x32. Casting to long should always be safe, as `tv_nsec` is de-
fined to be within [0, 999'999'999] (on this code path even within
[0, 100]).

Change-Id: Ic6318401db2134069c588c96e730b493496e8efb
Signed-off-by: Nico Huber <nico.h@gmx.de>
---

diff --git a/udelay.c b/udelay.c
index f47714b..268d0fb 100644
--- a/udelay.c
+++ b/udelay.c
@@ -58,7 +58,7 @@
 	if (!clock_getres(clock_id, &res)) {
 		if (res.tv_sec == 0 && res.tv_nsec <= 100) {
 			msg_pinfo("Using clock_gettime for delay loops (clk_id: %d, resolution: %ldns).\n",
-				  (int)clock_id, res.tv_nsec);
+				  (int)clock_id, (long)res.tv_nsec);
 			use_clock_gettime = true;
 			return 1;
 		}
