linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Roland Dreier <rdreier@cisco.com>
To: "jidong xiao" <jidong.xiao@gmail.com>
Cc: "Randy Dunlap" <randy.dunlap@oracle.com>,
	"Vegard Nossum" <vegard.nossum@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: How to printk unsigned long long variable?
Date: Fri, 15 Jun 2007 09:14:25 -0700	[thread overview]
Message-ID: <adaabv1i49q.fsf@cisco.com> (raw)
In-Reply-To: <4104961b0706150839t1a54ccdaq4ddc747d04538a19@mail.gmail.com> (jidong xiao's message of "Fri, 15 Jun 2007 23:39:59 +0800")

 > 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.

  reply	other threads:[~2007-06-15 16:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-15 14:59 How to printk unsigned long long variable? jidong xiao
2007-06-15 15:04 ` Vegard Nossum
2007-06-15 15:33   ` Randy Dunlap
2007-06-15 15:39     ` jidong xiao
2007-06-15 16:14       ` Roland Dreier [this message]
2007-06-15 16:18         ` jidong xiao
2007-06-15 16:29           ` Jan Engelhardt
2007-06-15 18:41           ` Roland Dreier
2007-06-17  6:55             ` Stephen Rothwell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=adaabv1i49q.fsf@cisco.com \
    --to=rdreier@cisco.com \
    --cc=jidong.xiao@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=randy.dunlap@oracle.com \
    --cc=vegard.nossum@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).