All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Wilcox <matthew@wil.cx>
To: rubisher <rubisher@scarlet.be>
Cc: linux-parisc <linux-parisc@vger.kernel.org>,
	John David Anglin <dave@hiauly1.hia.nrc.ca>
Subject: Re: Any idea why gcc "discards qualifiers from pointer target type"?
Date: Tue, 15 Jan 2008 05:31:14 -0700	[thread overview]
Message-ID: <20080115123114.GX18741@parisc-linux.org> (raw)
In-Reply-To: <JUOL5D$C964A06D0284BFBD2341C0E52FF636D0@scarlet.be>

On Tue, Jan 15, 2008 at 11:29:37AM +0100, rubisher wrote:
> Hello Dave,
> 
> Compiling p-l with gcc-4.2 I see new warning "discards qualifiers from pointer
> target type":

Joel, this is a standard C question ... this list really isn't for
teaching people how to program.

> /SRCTREE/drivers/net/lib82596.c:388: warning: passing argument 2 of
> 'dma_cache_sync' discards qualifiers from pointer target type

You're passing a volatile pointer to a function which is expecting a
non-volatile pointer.  That's potentially dangerous, so gcc warns about
it.

The normal way to fix this would be to add a volatile attribute to the
argument in question:

dma_cache_sync(struct device *dev, volatile void *vaddr, size_t size,
               enum dma_data_direction direction)

-- 
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."

  reply	other threads:[~2008-01-15 12:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-15 10:29 Any idea why gcc "discards qualifiers from pointer target type"? rubisher
2008-01-15 12:31 ` Matthew Wilcox [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-01-15 10:30 rubisher
2008-01-15 10:30 rubisher

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=20080115123114.GX18741@parisc-linux.org \
    --to=matthew@wil.cx \
    --cc=dave@hiauly1.hia.nrc.ca \
    --cc=linux-parisc@vger.kernel.org \
    --cc=rubisher@scarlet.be \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.