lkml.org 
[lkml]   [2007]   [Jun]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: How to printk unsigned long long variable?
From
Date
 > Is this right?

> dev->dev.dma_mask = bus->controller->dma_mask;
> printk(KERN_ERR "hey,jason,see,dma_mask is
> %llu\n",*(dev->dev.dma_mask));

No, why do you have the '*' -- dma_mask isn't a pointer, is it?

You probably want:

printk(KERN_ERR "hey,jason,see,dma_mask is %llx\n",
(unsigned long long) dev->dev.dma_mask);

(I would use a "%llx" format because masks are much clearer in hex).
The cast to unsigned long long is there because u64 is just unsigned
long on some 64-bit platforms, so you get a warning about the format
not matching on some architectures without the cast.

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

\
 
 \ /
  Last update: 2007-06-15 18:17    [W:0.040 / U:0.372 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site