[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250413020701.GA3020916@ax162>
Date: Sat, 12 Apr 2025 21:07:01 -0500
From: Nathan Chancellor <nathan@...nel.org>
To: Kuniyuki Iwashima <kuniyu@...zon.com>
Cc: qasdev00@...il.com, jlayton@...nel.org, linux-kernel@...r.kernel.org,
netdev@...r.kernel.org
Subject: Re: [PATCH] net: use %ld format specifier for PTR_ERR in pr_warn
On Sat, Apr 12, 2025 at 04:28:38PM -0700, Kuniyuki Iwashima wrote:
> From: Qasim Ijaz <qasdev00@...il.com>
> Date: Sat, 12 Apr 2025 23:55:28 +0100
> > PTR_ERR yields type long, so use %ld format specifier in pr_warn.
>
> errno fits in the range of int, so no need to use %ld.
Sure but the compiler does not know that and will warn about the
format specifier and type mismatch:
https://lore.kernel.org/202504130642.HaAQv94V-lkp@intel.com/
I think my comment about switching to '%pe' on basically the same patch
in lib/ref_tracker.c is relevant here too:
https://lore.kernel.org/20250413013245.GA2989337@ax162/
Cheers,
Nathan
Powered by blists - more mailing lists