mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ben Dooks <ben.dooks@codethink.co.uk>
To: Alison Schofield <alison.schofield@intel.com>
Cc: Dan Williams <djbw@kernel.org>,
	Vishal Verma <vishal.l.verma@intel.com>,
	Dave Jiang <dave.jiang@intel.com>, Ira Weiny <iweiny@kernel.org>,
	nvdimm@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] nvdimm/btt: add endian conversion in dev_err in btt_log_read
Date: Wed, 24 Jun 2026 16:07:15 +0100	[thread overview]
Message-ID: <2ebb44d6-43b2-4e57-a044-9d3ec67ca6c7@codethink.co.uk> (raw)
In-Reply-To: <ajscAZsK9ulXov8w@aschofie-mobl2.lan>

On 24/06/2026 00:51, Alison Schofield wrote:
> On Mon, Jun 22, 2026 at 03:20:11PM +0100, Ben Dooks wrote:
>> The dev_err() call in btt_log_read() is passing a seq value
>> into dev_err() which is a __le32 without any conversion.
>>
>> Fix the following (prototype) sparse warnings:
>> drivers/nvdimm/btt.c:342:17: warning: incorrect type in argument 5 (different base types)
>> drivers/nvdimm/btt.c:342:17:    expected int
>> drivers/nvdimm/btt.c:342:17:    got restricted __le32 [usertype] seq
>> drivers/nvdimm/btt.c:342:17: warning: incorrect type in argument 6 (different base types)
>> drivers/nvdimm/btt.c:342:17:    expected int
>> drivers/nvdimm/btt.c:342:17:    got restricted __le32 [usertype] seq
> 
> Hi Ben,
> 
> Please revise the commit log.
> 
> The commit log is a message to all future readers, not a place to
> paste static analysis warnings and leave the user visible impact
> assumed, or as an exercise for the reader.
> 
> Prefer something like this:
> 
> 	When BTT log corruption is detected, btt_log_read() reports the
> 	sequence numbers of the two log entries. Those values are stored
> 	little-endian, so printing them without conversion can report
> 	byte-swapped sequence numbers on big-endian systems.
> 
> 	Convert the sequence numbers to CPU endianness before passing
> 	them to dev_err().
> 
> 	Issue reported by sparse.
> 
> 
> (There is no need for the sparse pastings.)

Thanks, I've posted a v2, with a reworded patch commit log.

The only comment is that I like the sparse warnings as it makes it
easier to search if there is a patch in flight for this.

-- 
Ben Dooks				http://www.codethink.co.uk/
Senior Engineer				Codethink - Providing Genius

https://www.codethink.co.uk/privacy.html

      reply	other threads:[~2026-06-24 15:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-22 14:20 Ben Dooks
2026-06-22 18:14 ` Dave Jiang
2026-06-23 23:51 ` Alison Schofield
2026-06-24 15:07   ` Ben Dooks [this message]

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=2ebb44d6-43b2-4e57-a044-9d3ec67ca6c7@codethink.co.uk \
    --to=ben.dooks@codethink.co.uk \
    --cc=alison.schofield@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=djbw@kernel.org \
    --cc=iweiny@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nvdimm@lists.linux.dev \
    --cc=vishal.l.verma@intel.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

Powered by JetHome