cvs commit: src/sys/dev/ep if_ep.c

M. Warner Losh imp at bsdimp.com
Thu Oct 23 01:08:50 PDT 2003


In message: <xzp8yncgz3v.fsf at dwp.des.no>
            des at des.no (Dag-Erling Smørgrav) writes:
: "M. Warner Losh" <imp at bsdimp.com> writes:
: > des at des.no (Dag-Erling Smørgrav) writes:
: > > caddr_t is never right.  If it's a character pointer, use char *.
: > Why not?  The rest of the driver uses it heavily, and the data type of
: > the underlying mbufs is caddr_t:
: 
: Because the intention behind caddr_t was to be a "poor man's void *".
: When used as "void *" it is patently wrong, and when used as "char *"
: it is simply needless, unportable, obfuscating baggage.  If you mean
: "char *", you should write "char *".

I'll keep that in mind.  caddr_t stays for now because I have lots of
other changes to ep I don't want to pollute with a change like that.
There are two fewer caddr_t in ep than there were a few weeks ago,
instead of 4 after the partial reversion.

So caddr_t is right here because the rest of the driver uses it.
Until someone goes through and converts the driver and the network, it
will be the least wrong type to use.  Long term you are right, but
short term it's not going to change.

Warner


More information about the cvs-src mailing list