[PATCH] resource: fix printk() of resource_size_t

From: H . Peter Anvin
Date: Mon Oct 13 2008 - 17:11:03 EST


Impact: crash on 32-bit platforms, warnings on 64-bit platforms

When printk'ing resource_size_t, we have to explicitly cast them to
unsigned long long in order to be safe on all platforms. We must not use
%z since that applies to size_t, which is frequently not the same type
as resource_size_t.

Signed-off-by: H. Peter Anvin <hpa@xxxxxxxxx>
---
kernel/resource.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/kernel/resource.c b/kernel/resource.c
index 414d6fc..f747fb6 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -550,8 +550,12 @@ static void __init __reserve_region_with_split(struct resource *root,

if (!res) {
printk(KERN_DEBUG " __reserve_region_with_split: (%s) [%llx, %llx], res: (%s) [%llx, %llx]\n",
- conflict->name, conflict->start, conflict->end,
- name, start, end);
+ conflict->name,
+ (unsigned long long)conflict->start,
+ (unsigned long long)conflict->end,
+ name,
+ (unsigned long long)start,
+ (unsigned long long)end);

/* failed, split and try again */

--
1.6.0.2


--------------060904060105010205010101--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/