Re: [patch] staging: comedi: cleanup comedi_recognize()

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

 



On 2012-06-05 12:01, Dan Carpenter wrote:
On Tue, Jun 05, 2012 at 12:06:10PM +0200, walter harms wrote:
Hi all,
the patch is fine with me but i have a few basic questions:

Why the (void  *) at all ? it returns a name what is a const char *.


We're really returning a pointer to a private struct, it's just that
the first element on the struct always has to be a pointer to char *.

To be pedantic, it's really returning a pointer to some member of type 'const char *' within a private struct. To make life easier for themselves, those drivers make that the first member of the private struct so a void pointer to the member is also a void pointer to the struct.

--
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@xxxxxxxxx>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux