Re: [drm:drm-next 169/234] drivers/gpu/drm/radeon/radeon_acpi.c:128:3: warning: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'size_t'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Oct 03, 2012 at 09:18:22AM +0800, Fengguang Wu wrote:
> All warnings:
> 
> drivers/gpu/drm/radeon/radeon_acpi.c: In function 'radeon_atif_verify_interface':
> drivers/gpu/drm/radeon/radeon_acpi.c:128:3: warning: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'size_t' [-Wformat]

Yup, %lu is wrong on 32bit. There's also another occurence in that file,
attached patch agains drm-next fixes both.

Luca
>From d0c3d0f858d3f2cdae2bbf63aac0303d4c14aa9a Mon Sep 17 00:00:00 2001
From: Luca Tettamanti <kronos.it@xxxxxxxxx>
Date: Wed, 3 Oct 2012 15:00:19 +0200
Subject: [PATCH] drm/radeon: use %zu for formatting size_t

Fixes compiler warnings on 32bit.

Signed-off-by: Luca Tettamanti <kronos.it@xxxxxxxxx>
---
 drivers/gpu/drm/radeon/radeon_acpi.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_acpi.c b/drivers/gpu/drm/radeon/radeon_acpi.c
index c3976eb..faf1ed5 100644
--- a/drivers/gpu/drm/radeon/radeon_acpi.c
+++ b/drivers/gpu/drm/radeon/radeon_acpi.c
@@ -203,7 +203,7 @@ static int radeon_atif_verify_interface(acpi_handle handle,
 
 	size = *(u16 *) info->buffer.pointer;
 	if (size < 12) {
-		DRM_INFO("ATIF buffer is too small: %lu\n", size);
+		DRM_INFO("ATIF buffer is too small: %zu\n", size);
 		err = -EINVAL;
 		goto out;
 	}
@@ -487,7 +487,7 @@ static int radeon_atcs_verify_interface(acpi_handle handle,
 
 	size = *(u16 *) info->buffer.pointer;
 	if (size < 8) {
-		DRM_INFO("ATCS buffer is too small: %lu\n", size);
+		DRM_INFO("ATCS buffer is too small: %zu\n", size);
 		err = -EINVAL;
 		goto out;
 	}
-- 
1.7.10.4


[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux