Archive-only list for patches
 help / color / mirror / Atom feed
* [PATCH] drm/appletbdrm: Fix format specifier for size_t variables
@ 2025-03-04 13:19 Nathan Chancellor
  2025-03-04 14:09 ` Jani Nikula
  2025-03-04 14:20 ` Aditya Garg
  0 siblings, 2 replies; 4+ messages in thread
From: Nathan Chancellor @ 2025-03-04 13:19 UTC (permalink / raw)
  To: Aun-Ali Zaidi, Aditya Garg, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann
  Cc: Atharva Tiwari, Kerem Karabay, dri-devel, linux-kernel, patches,
	Nathan Chancellor

When building for a 32-bit platform, there are some warnings (or errors
with CONFIG_WERROR=y) due to an incorrect specifier for 'size_t'
variables, which is typedef'd as 'unsigned int' for these architectures:

  drivers/gpu/drm/tiny/appletbdrm.c:171:17: error: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') [-Werror,-Wformat]
    170 |                 drm_err(drm, "Actual size (%d) doesn't match expected size (%lu)\n",
        |                                                                             ~~~
        |                                                                             %zu
    171 |                         actual_size, size);
        |                                      ^~~~
  ...
  drivers/gpu/drm/tiny/appletbdrm.c:212:17: error: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') [-Werror,-Wformat]
    211 |                 drm_err(drm, "Actual size (%d) doesn't match expected size (%lu)\n",
        |                                                                             ~~~
        |                                                                             %zu
    212 |                         actual_size, size);
        |                                      ^~~~

Use '%zu' as suggested, clearing up the warnings.

Fixes: 0670c2f56e45 ("drm/tiny: add driver for Apple Touch Bars in x86 Macs")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 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;
 	}

---
base-commit: 95a5c9d197bb22a506913acb330a926d4e51aa95
change-id: 20250304-appletbdrm-fix-size_t-specifier-d3c547522379

Best regards,
-- 
Nathan Chancellor <nathan@kernel.org>


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

* Re: [PATCH] drm/appletbdrm: Fix format specifier for size_t variables
  2025-03-04 13:19 [PATCH] drm/appletbdrm: Fix format specifier for size_t variables Nathan Chancellor
@ 2025-03-04 14:09 ` Jani Nikula
  2025-03-04 14:20 ` Aditya Garg
  1 sibling, 0 replies; 4+ messages in thread
From: Jani Nikula @ 2025-03-04 14:09 UTC (permalink / raw)
  To: Nathan Chancellor, Aun-Ali Zaidi, Aditya Garg, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann
  Cc: Atharva Tiwari, Kerem Karabay, dri-devel, linux-kernel, patches,
	Nathan Chancellor

On Tue, 04 Mar 2025, Nathan Chancellor <nathan@kernel.org> wrote:
> When building for a 32-bit platform, there are some warnings (or errors
> with CONFIG_WERROR=y) due to an incorrect specifier for 'size_t'
> variables, which is typedef'd as 'unsigned int' for these architectures:
>
>   drivers/gpu/drm/tiny/appletbdrm.c:171:17: error: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') [-Werror,-Wformat]
>     170 |                 drm_err(drm, "Actual size (%d) doesn't match expected size (%lu)\n",
>         |                                                                             ~~~
>         |                                                                             %zu
>     171 |                         actual_size, size);
>         |                                      ^~~~
>   ...
>   drivers/gpu/drm/tiny/appletbdrm.c:212:17: error: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') [-Werror,-Wformat]
>     211 |                 drm_err(drm, "Actual size (%d) doesn't match expected size (%lu)\n",
>         |                                                                             ~~~
>         |                                                                             %zu
>     212 |                         actual_size, size);
>         |                                      ^~~~
>
> Use '%zu' as suggested, clearing up the warnings.
>
> Fixes: 0670c2f56e45 ("drm/tiny: add driver for Apple Touch Bars in x86 Macs")
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>

Just sent an identical patch [1]. :)

You have a better commit message, let's go with this. With Aditya's ack
from the other thread,

Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Acked-by: Aditya Garg <gargaditya08@live.com>

[1] https://lore.kernel.org/r/20250304135456.429407-1-jani.nikula@intel.com

> ---
>  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;
>  	}
>
> ---
> base-commit: 95a5c9d197bb22a506913acb330a926d4e51aa95
> change-id: 20250304-appletbdrm-fix-size_t-specifier-d3c547522379
>
> Best regards,

-- 
Jani Nikula, Intel

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

* Re: [PATCH] drm/appletbdrm: Fix format specifier for size_t variables
  2025-03-04 13:19 [PATCH] drm/appletbdrm: Fix format specifier for size_t variables Nathan Chancellor
  2025-03-04 14:09 ` Jani Nikula
@ 2025-03-04 14:20 ` Aditya Garg
  2025-03-04 15:22   ` Jani Nikula
  1 sibling, 1 reply; 4+ messages in thread
From: Aditya Garg @ 2025-03-04 14:20 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Aun-Ali Zaidi, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Atharva Tiwari, Kerem Karabay,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	patches@lists.linux.dev, Nathan Chancellor



> On 4 Mar 2025, at 6:49 PM, Nathan Chancellor <nathan@kernel.org> wrote:
> 
> When building for a 32-bit platform, there are some warnings (or errors
> with CONFIG_WERROR=y) due to an incorrect specifier for 'size_t'
> variables, which is typedef'd as 'unsigned int' for these architectures:
> 
>  drivers/gpu/drm/tiny/appletbdrm.c:171:17: error: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') [-Werror,-Wformat]
>    170 |                 drm_err(drm, "Actual size (%d) doesn't match expected size (%lu)\n",
>        |                                                                             ~~~
>        |                                                                             %zu
>    171 |                         actual_size, size);
>        |                                      ^~~~
>  ...
>  drivers/gpu/drm/tiny/appletbdrm.c:212:17: error: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') [-Werror,-Wformat]
>    211 |                 drm_err(drm, "Actual size (%d) doesn't match expected size (%lu)\n",
>        |                                                                             ~~~
>        |                                                                             %zu
>    212 |                         actual_size, size);
>        |                                      ^~~~
> 
> Use '%zu' as suggested, clearing up the warnings.
> 
> Fixes: 0670c2f56e45 ("drm/tiny: add driver for Apple Touch Bars in x86 Macs")
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---
> drivers/gpu/drm/tiny/appletbdrm.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)

This went into my spam for some reason, but looks like Jani already informed you about my Ack :)

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

* Re: [PATCH] drm/appletbdrm: Fix format specifier for size_t variables
  2025-03-04 14:20 ` Aditya Garg
@ 2025-03-04 15:22   ` Jani Nikula
  0 siblings, 0 replies; 4+ messages in thread
From: Jani Nikula @ 2025-03-04 15:22 UTC (permalink / raw)
  To: Aditya Garg, Nathan Chancellor
  Cc: Aun-Ali Zaidi, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Atharva Tiwari, Kerem Karabay,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	patches@lists.linux.dev, Nathan Chancellor

On Tue, 04 Mar 2025, Aditya Garg <gargaditya08@live.com> wrote:
>> On 4 Mar 2025, at 6:49 PM, Nathan Chancellor <nathan@kernel.org> wrote:
>> 
>> When building for a 32-bit platform, there are some warnings (or errors
>> with CONFIG_WERROR=y) due to an incorrect specifier for 'size_t'
>> variables, which is typedef'd as 'unsigned int' for these architectures:
>> 
>>  drivers/gpu/drm/tiny/appletbdrm.c:171:17: error: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') [-Werror,-Wformat]
>>    170 |                 drm_err(drm, "Actual size (%d) doesn't match expected size (%lu)\n",
>>        |                                                                             ~~~
>>        |                                                                             %zu
>>    171 |                         actual_size, size);
>>        |                                      ^~~~
>>  ...
>>  drivers/gpu/drm/tiny/appletbdrm.c:212:17: error: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') [-Werror,-Wformat]
>>    211 |                 drm_err(drm, "Actual size (%d) doesn't match expected size (%lu)\n",
>>        |                                                                             ~~~
>>        |                                                                             %zu
>>    212 |                         actual_size, size);
>>        |                                      ^~~~
>> 
>> Use '%zu' as suggested, clearing up the warnings.
>> 
>> Fixes: 0670c2f56e45 ("drm/tiny: add driver for Apple Touch Bars in x86 Macs")
>> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
>> ---
>> drivers/gpu/drm/tiny/appletbdrm.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> This went into my spam for some reason, but looks like Jani already informed you about my Ack :)

Thanks for the patch and ack, pushed to drm-misc-next.

BR,
Jani.



-- 
Jani Nikula, Intel

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

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

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-04 13:19 [PATCH] drm/appletbdrm: Fix format specifier for size_t variables Nathan Chancellor
2025-03-04 14:09 ` Jani Nikula
2025-03-04 14:20 ` Aditya Garg
2025-03-04 15:22   ` Jani Nikula

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