Re: [PATCH] issei: Fix size_t printk specifier in heci_{write,read}_buf()

From: Nathan Chancellor

Date: Wed Jul 22 2026 - 14:54:01 EST


On Wed, Jul 22, 2026 at 05:57:53AM +0000, Usyskin, Alexander wrote:
> > Subject: [PATCH] issei: Fix size_t printk specifier in heci_{write,read}_buf()
> >
> > 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
> >
> > Use '%zu' for printing these values, the proper printk specifier for
> > 'size_t'.
> >
>
> Thanks for a fix!
> Interesting, which checker should catch such errors?

I saw this with both Clang and GCC when building ARCH=i386 allmodconfig.

> Acked-by: Alexander Usyskin <alexander.usyskin@xxxxxxxxx>

Thanks for the quick response!

--
Cheers,
Nathan