From owner-freebsd-current Sun Mar 2 13: 3:17 2003 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A583737B401 for ; Sun, 2 Mar 2003 13:03:15 -0800 (PST) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id A779D43FDD for ; Sun, 2 Mar 2003 13:03:14 -0800 (PST) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.6/8.12.6) with ESMTP id h22L3DA6010349; Sun, 2 Mar 2003 22:03:13 +0100 (CET) (envelope-from phk@phk.freebsd.dk) To: Marcel Moolenaar Cc: current@FreeBSD.ORG Subject: Re: HEADSUP: Driver mega-commit ahead. From: "Poul-Henning Kamp" In-Reply-To: Your message of "Sun, 02 Mar 2003 12:38:39 PST." <20030302203839.GB546@athlon.pn.xcllnt.net> Date: Sun, 02 Mar 2003 22:03:13 +0100 Message-ID: <10348.1046638993@critter.freebsd.dk> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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. > >> 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