Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 07 Jul 2004 21:15:12 -0600 (MDT)
From:      "M. Warner Losh" <imp@bsdimp.com>
To:        nate@root.org
Cc:        cvs-all@freebsd.org
Subject:   Re: [src] cvs commit: src/sys/dev/fdc fdc.c fdc_isa.c fdc_pccard.c fdcvar.h src/sys/modules/fdc Makefile
Message-ID:  <20040707.211512.109983259.imp@bsdimp.com>
In-Reply-To: <20040707175502.M94870@root.org>
References:  <20040707.183145.79073073.imp@bsdimp.com> <40EC9698.4050201@root.org> <20040707175502.M94870@root.org>

next in thread | previous in thread | raw e-mail | index | archive | help
In message: <20040707175502.M94870@root.org>
            Nate Lawson <nate@root.org> writes:
: On Wed, 7 Jul 2004, Nate Lawson wrote:
: > M. Warner Losh wrote:
: > > I went the route of 'exposing' the softc, because that's how newbus
: > > works: it manages the softc, and in order to manage the softc you have
: > > to expose its size.  I treid to express that in the reviews, but I
: > > guess that got lost in the shuffle.  Bruce doesn't like it, but we do
: > > it all over the place and the world hasn't come to the end.  Anyway,
: > > after the set of mail that was sent out, I thought that I was supposed
: > > to commit the simple split, then you were going to specialize things
: > > for acpi.  That's why I went ahead and committed this.  phk's recent
: > > changes to fdc reminded me to merge this stuff....
: >
: > What about instead exposing the size through a extern const int and used
: > that to set the softc size in the device initialization?  The internals
: > of the softc aren't really needed.
: >
: > My code uses a softc size of zero and has a function in fdc.c that is
: > called by bus attachments that allocates it and does a
: > device_set_softc().  This mostly works.
: 
: Actually, I forgot to ask -- are you ok with me committing my code which
: hides the softc and uses device_set_softc() privately within fdc.c to
: manage it?  We'll still need fdcvar.h to hold function definitions.

What does the hiding gain us?  Is it worth the extra code size?  In
the case of struct resource, it makes sense to hid it from the drivers
so that we can change it.  But it seems like there's little to gain
from doing that in the case of the floppy controller.

Warner



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