Hello.

David Brownell wrote:

Passing "void *" is generally considered worse
   That didn't stop you from using 'void *context' as an argument. ;-)
The void* that's "worse" is one that must only point to a
specific type of object.  When the type has that kind of
restriction, using void* is nothing but bug-bait.
It's OK when the point is explicitly to pass around a handle
of arbitrary type, for interpretation by whatever provided it
in the first place -- the role of caller "context" in this and
many other interfaces.
You have yourself said that you'd like to use this approach uniformly in several drivers -- which would naturally have different device instance objects hiding behind 'void *'.

What I said was I wanted "struct at24_iface *" to
not be specific to the at24 driver.  Maybe a
"struct persistent_memory *" or "struct blob *".

I don't know how you can turn that into "void *".

  Sigh, I never suggested that. :-/
What I suggested is using 'void *' to pass a pointer to device data which 'struct at24_iface *' (or whatever the name will be) certainly is not.
  I wonder how many lines you were skipping reading my mails...

WBR, Sergei



_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to