Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Jan 2005 18:09:45 +0530
From:      "Tejas Sumant" <tejas.sumant@gmail.com>
To:        <freebsd-hackers@freebsd.org>
Subject:   Freeing Volatile Pointer
Message-ID:  <009e01c4f191$50433430$1500a8c0@indranet.local>

next in thread | raw e-mail | index | archive | help
Hi,

I have a volatile pointer declared in my device driver.
I am allocating memory using kernel malloc function.

host_mem_resp_ptr = (volatile unsigned long *)malloc(sizeof(volatile
unsigned long), M_DEVBUF, M_NOWAIT);

When I try to free it, I get following warning while compiling the driver.

"warning: passing arg 1 of free discards qualifiers from pointer target
type"

The statment to free the memory is

free(host_mem_resp_ptr, M_DEVBUF);

Can anybody please tell me reason and solution?

Tejas




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?009e01c4f191$50433430$1500a8c0>