Module Name: src Committed By: jakllsch Date: Thu Apr 15 03:09:12 UTC 2010
Modified Files: src/sys/arch/alpha/pci: tsc.c tsvar.h Log Message: Give tsc(4)/tsp(4) some attention. - Convert to CFATTACH_DECL_NEW(). - Sprinkle static on functions. - Improve KNF conformance. - Use C99 integer types. - Recycle now-empty-and/or-unused softc structures. To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/sys/arch/alpha/pci/tsc.c cvs rdiff -u -r1.7 -r1.8 src/sys/arch/alpha/pci/tsvar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/alpha/pci/tsc.c diff -u src/sys/arch/alpha/pci/tsc.c:1.16 src/sys/arch/alpha/pci/tsc.c:1.17 --- src/sys/arch/alpha/pci/tsc.c:1.16 Sat Mar 14 21:04:02 2009 +++ src/sys/arch/alpha/pci/tsc.c Thu Apr 15 03:09:12 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: tsc.c,v 1.16 2009/03/14 21:04:02 dsl Exp $ */ +/* $NetBSD: tsc.c,v 1.17 2010/04/15 03:09:12 jakllsch Exp $ */ /*- * Copyright (c) 1999 by Ross Harvey. All rights reserved. @@ -35,7 +35,7 @@ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: tsc.c,v 1.16 2009/03/14 21:04:02 dsl Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tsc.c,v 1.17 2010/04/15 03:09:12 jakllsch Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -59,11 +59,10 @@ #define tsc() { Generate ctags(1) key. } -int tscmatch(struct device *, struct cfdata *, void *); -void tscattach(struct device *, struct device *, void *); +static int tscmatch(device_t, cfdata_t, void *); +static void tscattach(device_t, device_t, void *); -CFATTACH_DECL(tsc, sizeof(struct tsc_softc), - tscmatch, tscattach, NULL, NULL); +CFATTACH_DECL_NEW(tsc, 0, tscmatch, tscattach, NULL, NULL); extern struct cfdriver tsc_cd; @@ -71,11 +70,10 @@ static int tscprint(void *, const char *pnp); -int tspmatch(struct device *, struct cfdata *, void *); -void tspattach(struct device *, struct device *, void *); +static int tspmatch(device_t, cfdata_t, void *); +static void tspattach(device_t, device_t, void *); -CFATTACH_DECL(tsp, sizeof(struct tsp_softc), - tspmatch, tspattach, NULL, NULL); +CFATTACH_DECL_NEW(tsp, 0, tspmatch, tspattach, NULL, NULL); extern struct cfdriver tsp_cd; @@ -88,8 +86,8 @@ /* Which hose is the display console connected to? */ int tsp_console_hose; -int -tscmatch(struct device *parent, struct cfdata *match, void *aux) +static int +tscmatch(device_t parent, cfdata_t match, void *aux) { struct mainbus_attach_args *ma = aux; @@ -98,13 +96,12 @@ && !tscfound; } -void tscattach(parent, self, aux) - struct device *parent, *self; - void *aux; +static void +tscattach(device_t parent, device_t self, void * aux) { int i; int nbus; - u_int64_t csc, aar; + uint64_t csc, aar; struct tsp_attach_args tsp; struct mainbus_attach_args *ma = aux; @@ -148,8 +145,8 @@ #define tsp() { Generate ctags(1) key. } -int -tspmatch(struct device *parent, struct cfdata *match, void *aux) +static int +tspmatch(device_t parent, cfdata_t match, void *aux) { struct tsp_attach_args *t = aux; @@ -157,8 +154,8 @@ && strcmp(t->tsp_name, tsp_cd.cd_name) == 0; } -void -tspattach(struct device *parent, struct device *self, void *aux) +static void +tspattach(device_t parent, device_t self, void *aux) { struct pcibus_attach_args pba; struct tsp_attach_args *t = aux; @@ -218,7 +215,8 @@ } static int -tsp_bus_get_window(int type, int window, struct alpha_bus_space_translation *abst) +tsp_bus_get_window(int type, int window, + struct alpha_bus_space_translation *abst) { struct tsp_config *tsp = &tsp_configuration[tsp_console_hose]; bus_space_tag_t st; Index: src/sys/arch/alpha/pci/tsvar.h diff -u src/sys/arch/alpha/pci/tsvar.h:1.7 src/sys/arch/alpha/pci/tsvar.h:1.8 --- src/sys/arch/alpha/pci/tsvar.h:1.7 Fri Oct 30 18:55:45 2009 +++ src/sys/arch/alpha/pci/tsvar.h Thu Apr 15 03:09:12 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: tsvar.h,v 1.7 2009/10/30 18:55:45 mhitch Exp $ */ +/* $NetBSD: tsvar.h,v 1.8 2010/04/15 03:09:12 jakllsch Exp $ */ /*- * Copyright (c) 1999 by Ross Harvey. All rights reserved. @@ -39,10 +39,6 @@ #define tsvar() { Generate ctags(1) key. } -struct tsc_softc { - struct device tsc_dev; -}; - struct tsp_config { int pc_pslot; /* Pchip 0 or 1 */ int pc_initted; /* Initialized */ @@ -66,11 +62,6 @@ int pc_mallocsafe; }; -struct tsp_softc { - struct device sc_dev; - struct tsp_config *sc_ccp; -}; - struct tsp_attach_args { const char *tsp_name; int tsp_slot;