From: Manuel Ebner <manuelebnerli@mailbox.org>
To: Nathan Chancellor <nathan@kernel.org>,
Alexander Usyskin <alexander.usyskin@intel.com>,
Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Karol Wachowski <karol.wachowski@linux.intel.com>,
Vitaly Lubart <lubvital@gmail.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] issei: Fix size_t printk specifier in heci_{write,read}_buf()
Date: Tue, 28 Jul 2026 14:43:37 +0200 [thread overview]
Message-ID: <ace2ea1f73be097de9b69a8dd1eafddbbb8b7036.camel@mailbox.org> (raw)
In-Reply-To: <20260721-issei-fix-size_t-specifier-v1-1-246155b42d48@kernel.org>
On Tue, 2026-07-21 at 14:32 -0700, Nathan Chancellor wrote:
> When building for 32-bit platforms, for which 'size_t' is
> 'unsigned int', there are a couple of warnings around incorrect printk
> specifiers:
>
> In file included from drivers/misc/issei/hw_heci.c:7:
> drivers/misc/issei/hw_heci.c: In function 'heci_write_hbuf':
> drivers/misc/issei/hw_heci.c:374:37: error: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'unsigned int' [-Werror=format=]
> 374 | dev_err(&idev->dev, "Data size %zu not aligned to slot size %lu\n",
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ...
> drivers/misc/issei/hw_heci.c:374:79: note: format string is defined here
> 374 | dev_err(&idev->dev, "Data size %zu not aligned to slot size %lu\n",
> | ~~^
> | |
> | long unsigned int
> | %u
> drivers/misc/issei/hw_heci.c: In function 'heci_read_hbuf':
> drivers/misc/issei/hw_heci.c:404:37: error: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'unsigned int' [-Werror=format=]
> 404 | dev_err(&idev->dev, "Data size %zu not aligned to slot size %lu\n",
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ...
> drivers/misc/issei/hw_heci.c:404:79: note: format string is defined here
> 404 | dev_err(&idev->dev, "Data size %zu not aligned to slot size %lu\n",
> | ~~^
> | |
> | long unsigned int
> | %u
> cc1: all warnings being treated as errors
I had the same errors and eight notes:
In file included from drivers/misc/issei/hw_heci.c:7:
drivers/misc/issei/hw_heci.c: In function ‘heci_write_hbuf’:
drivers/misc/issei/hw_heci.c:374:37: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘unsigned int’ [-Werror=format=]
374 | dev_err(&idev->dev, "Data size %zu not aligned to slot size %lu\n",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/dev_printk.h:110:30: note: in definition of macro ‘dev_printk_index_wrap’
110 | _p_func(dev, fmt, ##__VA_ARGS__); \
| ^~~
./include/linux/dev_printk.h:154:56: note: in expansion of macro ‘dev_fmt’
154 | dev_printk_index_wrap(_dev_err, KERN_ERR, dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~
drivers/misc/issei/hw_heci.c:374:17: note: in expansion of macro ‘dev_err’
374 | dev_err(&idev->dev, "Data size %zu not aligned to slot size %lu\n",
| ^~~~~~~
drivers/misc/issei/hw_heci.c:374:79: note: format string is defined here
374 | dev_err(&idev->dev, "Data size %zu not aligned to slot size %lu\n",
| ~~^
| |
| long unsigned int
| %u
drivers/misc/issei/hw_heci.c: In function ‘heci_read_hbuf’:
drivers/misc/issei/hw_heci.c:404:37: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘unsigned int’ [-Werror=format=]
404 | dev_err(&idev->dev, "Data size %zu not aligned to slot size %lu\n",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/dev_printk.h:110:30: note: in definition of macro ‘dev_printk_index_wrap’
110 | _p_func(dev, fmt, ##__VA_ARGS__); \
| ^~~
./include/linux/dev_printk.h:154:56: note: in expansion of macro ‘dev_fmt’
154 | dev_printk_index_wrap(_dev_err, KERN_ERR, dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~
drivers/misc/issei/hw_heci.c:404:17: note: in expansion of macro ‘dev_err’
404 | dev_err(&idev->dev, "Data size %zu not aligned to slot size %lu\n",
| ^~~~~~~
drivers/misc/issei/hw_heci.c:404:79: note: format string is defined here
404 | dev_err(&idev->dev, "Data size %zu not aligned to slot size %lu\n",
| ~~^
| |
| long unsigned int
| %u
cc1: all warnings being treated as errors
Can the notes be improved? If so please advice.
>
> Use '%zu' for printing these values, the proper printk specifier for
> 'size_t'.
>
> Fixes: 8bf5e84998c3 ("issei: add heci hardware module")
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by Manuel Ebner <manuelebnerli@mailbox.org>
Thanks
Manuel
> [...]
next prev parent reply other threads:[~2026-07-28 12:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-21 21:32 Nathan Chancellor
2026-07-22 5:57 ` Usyskin, Alexander
2026-07-22 18:53 ` Nathan Chancellor
2026-07-28 12:43 ` Manuel Ebner [this message]
2026-07-28 21:46 ` Nathan Chancellor
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=ace2ea1f73be097de9b69a8dd1eafddbbb8b7036.camel@mailbox.org \
--to=manuelebnerli@mailbox.org \
--cc=alexander.usyskin@intel.com \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=karol.wachowski@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lubvital@gmail.com \
--cc=nathan@kernel.org \
/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