Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 02 Mar 2003 22:03:13 +0100
From:      "Poul-Henning Kamp" <phk@phk.freebsd.dk>
To:        Marcel Moolenaar <marcel@xcllnt.net>
Cc:        current@FreeBSD.ORG
Subject:   Re: HEADSUP: Driver mega-commit ahead. 
Message-ID:  <10348.1046638993@critter.freebsd.dk>
In-Reply-To: Your message of "Sun, 02 Mar 2003 12:38:39 PST." <20030302203839.GB546@athlon.pn.xcllnt.net> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <20030302203839.GB546@athlon.pn.xcllnt.net>, Marcel Moolenaar writes
:
>On Sun, Mar 02, 2003 at 09:26:31PM +0100, Poul-Henning Kamp wrote:
>> In message <20030302202015.GA546@athlon.pn.xcllnt.net>, Marcel Moolenaar writes
>> :
>> >On Sun, Mar 02, 2003 at 09:14:13PM +0100, Poul-Henning Kamp wrote:
>> >> 
>> >> I plan to commit
>> >> 	http://phk.freebsd.dk/patch/cdevsw.patch
>> >> one of the first days of the week.
>> >> 
>> >> Basically, it changes cdevsw initializations to use C99 sparse
>> >> format, and thereby eliminates 859 lines of redundant defaultvalue
>> >> initializations.
><snip>
>> This particular sweep gives os much better cross-branch source
>> portability and therefore I think it is exactly the kind of thing
>> we want before the RELENG_5 branch.
>
>I thought this was just syntactic sugaring and that doing it now
>reduces diffs between 5-stable and 6-current (by increasing diffs
>between 5-release and 5-stable) but otherwise does not change a bit? 
>
>Do I misunderstand the effect of the patch?

The intention is that we can add, delete or redefine elements
without having to modify all source files.

Say for instance we want to add a filedescriptor argument to d_open.

Without this patch, we will have to append it at the end of cdevsw to
avoid modifying all drivers sources, but since that trick was already
used with kqfilter, even that doesn' save us.

With this patch we simply add the field, drivers which don't know about
this new option will not initialize it, and we can do the necessary
compat magic in make_dev().

That would make any MFC's much more manageable, since they will only
entail the actually affected files, not 145 otherwise unaffected driver
source files.

So call it syntactic sugar if you want, but remember that emergency
rations are high on carbohydrates for a reason :-)

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.

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




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