netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Kuniyuki Iwashima <kuniyu@amazon.com>
Cc: qasdev00@gmail.com, jlayton@kernel.org,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH] net: use %ld format specifier for PTR_ERR in pr_warn
Date: Sat, 12 Apr 2025 21:07:01 -0500	[thread overview]
Message-ID: <20250413020701.GA3020916@ax162> (raw)
In-Reply-To: <20250412232839.66642-1-kuniyu@amazon.com>

On Sat, Apr 12, 2025 at 04:28:38PM -0700, Kuniyuki Iwashima wrote:
> From: Qasim Ijaz <qasdev00@gmail.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

  reply	other threads:[~2025-04-13  2:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-12 22:55 [PATCH] net: use %ld format specifier for PTR_ERR in pr_warn Qasim Ijaz
2025-04-12 23:28 ` Kuniyuki Iwashima
2025-04-13  2:07   ` Nathan Chancellor [this message]
2025-04-13 10:56   ` Qasim Ijaz
2025-04-13 10:59 ` Jeff Layton

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=20250413020701.GA3020916@ax162 \
    --to=nathan@kernel.org \
    --cc=jlayton@kernel.org \
    --cc=kuniyu@amazon.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=qasdev00@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).