Skip to content

Commit c449f50

Browse files
nathanchancejnikula
authored andcommitted
drm/appletbdrm: Fix format specifier for size_t variables
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: 0670c2f ("drm/tiny: add driver for Apple Touch Bars in x86 Macs") Signed-off-by: Nathan Chancellor <[email protected]> Reviewed-by: Jani Nikula <[email protected]> Acked-by: Aditya Garg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/20250304-appletbdrm-fix-size_t-specifier-v1-1-94fe1d2c91f8@kernel.org Signed-off-by: Jani Nikula <[email protected]>
1 parent 95a5c9d commit c449f50

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/gpu/drm/tiny/appletbdrm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ static int appletbdrm_send_request(struct appletbdrm_device *adev,
167167
}
168168

169169
if (actual_size != size) {
170-
drm_err(drm, "Actual size (%d) doesn't match expected size (%lu)\n",
170+
drm_err(drm, "Actual size (%d) doesn't match expected size (%zu)\n",
171171
actual_size, size);
172172
return -EIO;
173173
}
@@ -208,7 +208,7 @@ static int appletbdrm_read_response(struct appletbdrm_device *adev,
208208
}
209209

210210
if (actual_size != size) {
211-
drm_err(drm, "Actual size (%d) doesn't match expected size (%lu)\n",
211+
drm_err(drm, "Actual size (%d) doesn't match expected size (%zu)\n",
212212
actual_size, size);
213213
return -EBADMSG;
214214
}

0 commit comments

Comments
 (0)