public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/tiny: fix printk format string for 32-bit
@ 2025-03-04 14:27 Arnd Bergmann
  2025-03-04 14:46 ` Aditya Garg
  0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2025-03-04 14:27 UTC (permalink / raw)
  To: Aun-Ali Zaidi, Aditya Garg, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Atharva Tiwari,
	Kerem Karabay
  Cc: Arnd Bergmann, dri-devel, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

A size_t must be printed with the %z modifier instead of %l:

In file included from include/linux/device.h:15,
                 from include/linux/usb.h:19,
                 from drivers/gpu/drm/tiny/appletbdrm.c:19:
drivers/gpu/drm/tiny/appletbdrm.c: In function 'appletbdrm_send_request':
include/drm/drm_print.h:589:54: error: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]
drivers/gpu/drm/tiny/appletbdrm.c:170:17: note: in expansion of macro 'drm_err'
  170 |                 drm_err(drm, "Actual size (%d) doesn't match expected size (%lu)\n",
      |                 ^~~~~~~
drivers/gpu/drm/tiny/appletbdrm.c: In function 'appletbdrm_read_response':
include/drm/drm_print.h:589:54: error: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]
drivers/gpu/drm/tiny/appletbdrm.c:211:17: note: in expansion of macro 'drm_err'
  211 |                 drm_err(drm, "Actual size (%d) doesn't match expected size (%lu)\n",
      |                 ^~~~~~~

Fixes: 0670c2f56e45 ("drm/tiny: add driver for Apple Touch Bars in x86 Macs")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/gpu/drm/tiny/appletbdrm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/tiny/appletbdrm.c b/drivers/gpu/drm/tiny/appletbdrm.c
index f5d177e234e4..394c8f9bd41a 100644
--- a/drivers/gpu/drm/tiny/appletbdrm.c
+++ b/drivers/gpu/drm/tiny/appletbdrm.c
@@ -167,7 +167,7 @@ static int appletbdrm_send_request(struct appletbdrm_device *adev,
 	}
 
 	if (actual_size != size) {
-		drm_err(drm, "Actual size (%d) doesn't match expected size (%lu)\n",
+		drm_err(drm, "Actual size (%d) doesn't match expected size (%zu)\n",
 			actual_size, size);
 		return -EIO;
 	}
@@ -208,7 +208,7 @@ static int appletbdrm_read_response(struct appletbdrm_device *adev,
 	}
 
 	if (actual_size != size) {
-		drm_err(drm, "Actual size (%d) doesn't match expected size (%lu)\n",
+		drm_err(drm, "Actual size (%d) doesn't match expected size (%zu)\n",
 			actual_size, size);
 		return -EBADMSG;
 	}
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/tiny: fix printk format string for 32-bit
  2025-03-04 14:27 [PATCH] drm/tiny: fix printk format string for 32-bit Arnd Bergmann
@ 2025-03-04 14:46 ` Aditya Garg
  2025-03-04 15:10   ` Jani Nikula
  0 siblings, 1 reply; 3+ messages in thread
From: Aditya Garg @ 2025-03-04 14:46 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Aun-Ali Zaidi, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Jani Nikula,
	Atharva Tiwari, Kerem Karabay, Arnd Bergmann,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	Nathan Chancellor

Hi

> On 4 Mar 2025, at 7:57 PM, Arnd Bergmann <arnd@kernel.org> wrote:
> 
> From: Arnd Bergmann <arnd@arndb.de>
> 
> A size_t must be printed with the %z modifier instead of %l:
> 
> In file included from include/linux/device.h:15,
>                 from include/linux/usb.h:19,
>                 from drivers/gpu/drm/tiny/appletbdrm.c:19:
> drivers/gpu/drm/tiny/appletbdrm.c: In function 'appletbdrm_send_request':
> include/drm/drm_print.h:589:54: error: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]
> drivers/gpu/drm/tiny/appletbdrm.c:170:17: note: in expansion of macro 'drm_err'
>  170 |                 drm_err(drm, "Actual size (%d) doesn't match expected size (%lu)\n",
>      |                 ^~~~~~~
> drivers/gpu/drm/tiny/appletbdrm.c: In function 'appletbdrm_read_response':
> include/drm/drm_print.h:589:54: error: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]
> drivers/gpu/drm/tiny/appletbdrm.c:211:17: note: in expansion of macro 'drm_err'
>  211 |                 drm_err(drm, "Actual size (%d) doesn't match expected size (%lu)\n",
>      |                 ^~~~~~~
> 
> Fixes: 0670c2f56e45 ("drm/tiny: add driver for Apple Touch Bars in x86 Macs")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> —

Its the duplicate of:

https://lore.kernel.org/dri-devel/20250304-appletbdrm-fix-size_t-specifier-v1-1-94fe1d2c91f8@kernel.org/

as well as

https://lore.kernel.org/dri-devel/20250304135456.429407-1-jani.nikula@intel.com/



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/tiny: fix printk format string for 32-bit
  2025-03-04 14:46 ` Aditya Garg
@ 2025-03-04 15:10   ` Jani Nikula
  0 siblings, 0 replies; 3+ messages in thread
From: Jani Nikula @ 2025-03-04 15:10 UTC (permalink / raw)
  To: Aditya Garg, Arnd Bergmann
  Cc: Aun-Ali Zaidi, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Atharva Tiwari,
	Kerem Karabay, Arnd Bergmann, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, Nathan Chancellor

On Tue, 04 Mar 2025, Aditya Garg <gargaditya08@live.com> wrote:
> Hi
>
>> On 4 Mar 2025, at 7:57 PM, Arnd Bergmann <arnd@kernel.org> wrote:
>> 
>> From: Arnd Bergmann <arnd@arndb.de>
>> 
>> A size_t must be printed with the %z modifier instead of %l:
>> 
>> In file included from include/linux/device.h:15,
>>                 from include/linux/usb.h:19,
>>                 from drivers/gpu/drm/tiny/appletbdrm.c:19:
>> drivers/gpu/drm/tiny/appletbdrm.c: In function 'appletbdrm_send_request':
>> include/drm/drm_print.h:589:54: error: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]
>> drivers/gpu/drm/tiny/appletbdrm.c:170:17: note: in expansion of macro 'drm_err'
>>  170 |                 drm_err(drm, "Actual size (%d) doesn't match expected size (%lu)\n",
>>      |                 ^~~~~~~
>> drivers/gpu/drm/tiny/appletbdrm.c: In function 'appletbdrm_read_response':
>> include/drm/drm_print.h:589:54: error: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]
>> drivers/gpu/drm/tiny/appletbdrm.c:211:17: note: in expansion of macro 'drm_err'
>>  211 |                 drm_err(drm, "Actual size (%d) doesn't match expected size (%lu)\n",
>>      |                 ^~~~~~~
>> 
>> Fixes: 0670c2f56e45 ("drm/tiny: add driver for Apple Touch Bars in x86 Macs")
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>> —
>
> Its the duplicate of:
>
> https://lore.kernel.org/dri-devel/20250304-appletbdrm-fix-size_t-specifier-v1-1-94fe1d2c91f8@kernel.org/

Pushed this one to drm-misc-next.

BR,
Jani.

>
> as well as
>
> https://lore.kernel.org/dri-devel/20250304135456.429407-1-jani.nikula@intel.com/
>
>

-- 
Jani Nikula, Intel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-03-04 15:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-04 14:27 [PATCH] drm/tiny: fix printk format string for 32-bit Arnd Bergmann
2025-03-04 14:46 ` Aditya Garg
2025-03-04 15:10   ` Jani Nikula

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox