Re: How to printk unsigned long long variable?

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

 



 > 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux