Re: Any idea why gcc "discards qualifiers from pointer target type"?

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

 



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."
-
To unsubscribe from this list: send the line "unsubscribe linux-parisc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux SoC]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux