[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <adaabv1i49q.fsf@cisco.com>
Date: Fri, 15 Jun 2007 09:14:25 -0700
From: Roland Dreier <rdreier@...co.com>
To: "jidong xiao" <jidong.xiao@...il.com>
Cc: "Randy Dunlap" <randy.dunlap@...cle.com>,
"Vegard Nossum" <vegard.nossum@...il.com>,
linux-kernel@...r.kernel.org
Subject: Re: How to printk unsigned long long variable?
> 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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists