With the new efforts in getting rid of all the warnings in the kernel
compiles I have a problem with the following warning:

../../dev/usb/ukbd.c: In function `ukbd_detach':
../../dev/usb/ukbd.c:373: warning: cast discards `const' from pointer
target type

produced by the following two lines in the USB code:

(dev/usb/ukbd.c)
ukbd_detach(device_t self)
{
...
        const char *devinfo = device_get_desc(self);
...
                free((void *)devinfo, M_USB);


It is a consequence of the following type definition:

(sys/bus_private.h)
struct device {
...
    const char*         desc;   /* driver specific description */
...
}

One problem I have is that a string like that might be produced by
concatenating a few strings together.  In the case of USB the desc is
the string returned by the device. At attach the string is created and
malloc()-ed, at detach free()-ed. 

Anyone savvy enough to tell me what I need to change in the USB code to
get rid of the warning? 

Cheers,

Nick

FreeBSD USB Driver Development
-- 
      e-mail: n_hi...@freebsd.org
   home page: http://www.etla.net/~n_hibma/usb/usb.pl
mailing list: usb-...@egroups.com




To Unsubscribe: send mail to majord...@freebsd.org
with "unsubscribe freebsd-current" in the body of the message

Reply via email to