All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: Justin Stitt <justinstitt@google.com>
Cc: dhowells@redhat.com, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, linux-afs@lists.infradead.org,
	linux-kernel@vger.kernel.org, llvm@lists.linux.dev,
	marc.dionne@auristor.com, nathan@kernel.org,
	ndesaulniers@google.com, netdev@vger.kernel.org,
	pabeni@redhat.com, trix@redhat.com
Subject: Re: [PATCH v2] net: rxrpc: fix clang -Wformat warning
Date: Fri, 08 Jul 2022 10:39:04 +0100	[thread overview]
Message-ID: <1840089.1657273144@warthog.procyon.org.uk> (raw)
In-Reply-To: <20220707182052.769989-1-justinstitt@google.com>

Justin Stitt <justinstitt@google.com> wrote:

> y is a u32 but the format specifier is `%hx`. Going from unsigned int to
> short int results in a loss of data. This is surely not intended
> behavior. If it is intended, the warning should be suppressed through
> other means.

Yeah, y is reduced to a 16-bit number so that it can be used in the protocol,
but the type is still 32-bit because that's needed for the calculation.  An
alternative would be to print sp->hdr.cksum since that's the value that will
appear on the wire, but I've no objection to this change either.

> This patch should get us closer to the goal of enabling the -Wformat
> flag for Clang builds.
> 
> Link: https://github.com/ClangBuiltLinux/linux/issues/378
> Signed-off-by: Justin Stitt <justinstitt@google.com>

Acked-by: David Howells <dhowells@redhat.com>


  parent reply	other threads:[~2022-07-08  9:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-06 23:56 [PATCH] net: rxrpc: fix clang -Wformat warning Justin Stitt
2022-07-07 17:58 ` Nathan Chancellor
2022-07-07 18:20 ` [PATCH v2] " Justin Stitt
2022-07-07 18:24   ` Nathan Chancellor
2022-07-08  9:39   ` David Howells [this message]
2022-07-09  3:20   ` patchwork-bot+netdevbpf
2022-07-07 23:10 ` [PATCH] " Joe Perches
2022-07-08  9:39   ` David Howells
2022-07-08  9:40   ` David Howells

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=1840089.1657273144@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=justinstitt@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-afs@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=marc.dionne@auristor.com \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=trix@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.