Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Oct 2003 01:34:23 -0600 (MDT)
From:      "M. Warner Losh" <imp@bsdimp.com>
To:        des@des.no
Cc:        nate@root.org
Subject:   Re: cvs commit: src/sys/dev/ep if_ep.c
Message-ID:  <20031023.013423.02875687.imp@bsdimp.com>
In-Reply-To: <xzpfzhkh10t.fsf@dwp.des.no>
References:  <20031022213712.S60963@root.org> <20031022.235525.122825408.imp@bsdimp.com> <xzpfzhkh10t.fsf@dwp.des.no>

next in thread | previous in thread | raw e-mail | index | archive | help
In message: <xzpfzhkh10t.fsf@dwp.des.no>
            des@des.no (Dag-Erling Sm=F8rgrav) writes:
: "M. Warner Losh" <imp@bsdimp.com> writes:
: > caddr_t is right: it is a character pointer.  uintptr_t is somethin=
g
: > else.  caddr_t is what was used before.
: =

: 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:

#define	mtod(m, t)	((t)((m)->m_data))

struct m_hdr {
	struct	mbuf *mh_next;		/* next buffer in chain */
	struct	mbuf *mh_nextpkt;	/* next chain in queue/record */
	caddr_t	mh_data;		/* location of data */
	int	mh_len;			/* amount of data in this mbuf */
	int	mh_flags;		/* flags; see below */
	short	mh_type;		/* type of data in this mbuf */
};
struct mbuf {
	struct	m_hdr m_hdr;
...
#define	m_data		m_hdr.mh_data
...

Warner



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031023.013423.02875687.imp>