[PATCH] block/m68k: z2ram - correct printing of sector_t

From: Geert Uytterhoeven
Date: Mon Aug 30 2010 - 03:07:36 EST


If CONFIG_LBDAF=y, `sector_t' becomes `u64' instead of `unsigned long':

drivers/block/z2ram.c: In function ʽdo_z2_requestʼ:
drivers/block/z2ram.c:83: warning: format ʽ%luʼ expects type ʽlong unsigned intʼ, but argument 2 has type ʽsector_tʼ

Hence always cast it to `unsigned long long' for printing.
Also do the pr_err() dance, while we're at it.

Signed-off-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
---
drivers/block/z2ram.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/block/z2ram.c b/drivers/block/z2ram.c
index d75b2bb..2dbcaaa 100644
--- a/drivers/block/z2ram.c
+++ b/drivers/block/z2ram.c
@@ -79,8 +79,10 @@ static void do_z2_request(struct request_queue *q)
int err = 0;

if (start + len > z2ram_size) {
- printk( KERN_ERR DEVICE_NAME ": bad access: block=%lu, count=%u\n",
- blk_rq_pos(req), blk_rq_cur_sectors(req));
+ pr_err(DEVICE_NAME ": bad access: block=%llu, "
+ "count=%u\n",
+ (unsigned long long)blk_rq_pos(req),
+ blk_rq_cur_sectors(req));
err = -EIO;
goto done;
}
--
1.7.0.4

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
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/