Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Jan 2001 12:41:43 +0100
From:      Alexander Langer <alex@big.endian.de>
To:        Jonathon McKitrick <jcm@shellyeah.org>
Cc:        Stephen McKay <mckay@thehub.com.au>, j mckitrick <jcm@FreeBSD-uk.eu.org>, chat@freebsd.org
Subject:   Re: good example kernel code
Message-ID:  <20010124124143.A14098@cichlids.cichlids.com>
In-Reply-To: <Pine.GSO.4.21.0101240625560.14282-100000@zippy.shellyeah.org>; from jcm@shellyeah.org on Wed, Jan 24, 2001 at 06:26:46AM -0500
References:  <20010124122137.A13335@cichlids.cichlids.com> <Pine.GSO.4.21.0101240625560.14282-100000@zippy.shellyeah.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Thus spake Jonathon McKitrick (jcm@shellyeah.org):

> > > For a long time I've considered the ed network driver to be the highest
> > > quality code in FreeBSD.  It has been beaten on for 7.5 years now and
> > > still looks good.  Have a read of sys/dev/ed/if_ed.c and see if you
> > > don't agree.
> > To be honest:  Defenitely not :-)
> Ah, well, then.  Can you suggest an alternative?

Well, most of the kernel code.
I'd love sys/kern/subr_bus.c, if it didn't use four spaces for second
level indents for functions, but indent the args to the opening
paranthesis (as the ed drivers does, btw).

The good thing with the kernel code is: It's well strucured and easy
to read, even if you don't like the style.

Do you really tell the following well readable code?

static void     ed_get_packet   __P((struct ed_softc *, char *, /* u_short */ int));

static __inline void    ed_rint __P((struct ed_softc *));
static __inline void    ed_xmit __P((struct ed_softc *));
static __inline char *  ed_ring_copy __P((struct ed_softc *, char *, char *,
                                          /* u_short */ int));
static void     ed_hpp_set_physical_link __P((struct ed_softc *));
static void     ed_hpp_readmem  __P((struct ed_softc *, int, unsigned char *,
                                    /* u_short */ int));
static void     ed_hpp_writemem __P((struct ed_softc *, unsigned char *,
                                    /* u_short */ int, /* u_short */ int));
static u_short  ed_hpp_write_mbufs __P((struct ed_softc *, struct mbuf *,
                                        int));

static u_short  ed_pio_write_mbufs __P((struct ed_softc *, struct mbuf *,
                                        int));

static void     ed_setrcr       __P((struct ed_softc *));

static u_int32_t ds_crc         __P((u_char *ep));

I worked with the ed driver lately.  It's just not what _I_ call high
quality code :-)

Alex
-- 
cat: /home/alex/.sig: No such file or directory


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-chat" in the body of the message




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