From 3bd86dc17dbd9e769afd253d0ef3870fcab7ca9e Mon Sep 17 00:00:00 2001 From: xtraeme Date: Tue, 20 Feb 2007 00:09:57 +0000 Subject: [PATCH] ANSI, KNF, use __arraycount. --- sys/arch/i386/bios/vesa_text.c | 17 ++++++--------- sys/arch/i386/bios/vesabios.c | 39 +++++++++++++++------------------- 2 files changed, 23 insertions(+), 33 deletions(-) diff --git a/sys/arch/i386/bios/vesa_text.c b/sys/arch/i386/bios/vesa_text.c index 4a96a957296f..140f7e4e5db7 100644 --- a/sys/arch/i386/bios/vesa_text.c +++ b/sys/arch/i386/bios/vesa_text.c @@ -1,7 +1,7 @@ -/* $NetBSD: vesa_text.c,v 1.7 2006/02/19 14:59:22 thorpej Exp $ */ +/* $NetBSD: vesa_text.c,v 1.8 2007/02/20 00:09:57 xtraeme Exp $ */ #include -__KERNEL_RCSID(0, "$NetBSD: vesa_text.c,v 1.7 2006/02/19 14:59:22 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vesa_text.c,v 1.8 2007/02/20 00:09:57 xtraeme Exp $"); #include #include @@ -27,23 +27,18 @@ CFATTACH_DECL(vesatext, sizeof(struct vesatextsc), vesatext_match, vesatext_attach, NULL, NULL); static int -vesatext_match(parent, match, aux) - struct device *parent; - struct cfdata *match; - void *aux; +vesatext_match(struct device *parent, struct cfdata *match, void *aux) { struct vesabiosdev_attach_args *vaa = aux; if (strcmp(vaa->vbaa_type, "text")) - return (0); + return 0; - return (1); + return 1; } static void -vesatext_attach(parent, dev, aux) - struct device *parent, *dev; - void *aux; +vesatext_attach(struct device *parent, struct device *dev, void *aux) { struct vesatextsc *sc = (struct vesatextsc *)dev; struct vesabiosdev_attach_args *vaa = aux; diff --git a/sys/arch/i386/bios/vesabios.c b/sys/arch/i386/bios/vesabios.c index d47f6232ad03..fd9ed74fbfbd 100644 --- a/sys/arch/i386/bios/vesabios.c +++ b/sys/arch/i386/bios/vesabios.c @@ -1,4 +1,4 @@ -/* $NetBSD: vesabios.c,v 1.22 2006/11/16 01:32:38 christos Exp $ */ +/* $NetBSD: vesabios.c,v 1.23 2007/02/20 00:09:57 xtraeme Exp $ */ /* * Copyright (c) 2002, 2004 @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: vesabios.c,v 1.22 2006/11/16 01:32:38 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vesabios.c,v 1.23 2007/02/20 00:09:57 xtraeme Exp $"); #include #include @@ -74,12 +74,11 @@ vesabios_match( struct device *parent, struct cfdata *match, void *aux) { - return (1); + return 1; } static int -vbegetinfo(vip) - struct vbeinfoblock **vip; +vbegetinfo(struct vbeinfoblock **vip) { unsigned char *buf; struct trapframe tf; @@ -88,7 +87,7 @@ vbegetinfo(vip) buf = kvm86_bios_addpage(0x2000); if (!buf) { printf("vbegetinfo: kvm86_bios_addpage(0x2000) failed\n"); - return (ENOMEM); + return ENOMEM; } memcpy(buf, "VBE2", 4); @@ -112,36 +111,34 @@ vbegetinfo(vip) if (vip) *vip = (struct vbeinfoblock *)buf; - return (0); + return 0; out: kvm86_bios_delpage(0x2000, buf); - return (error); + return error; } static void -vbefreeinfo(vip) - struct vbeinfoblock *vip; +vbefreeinfo(struct vbeinfoblock *vip) { kvm86_bios_delpage(0x2000, vip); } int -vbeprobe() +vbeprobe(void) { struct vbeinfoblock *vi; if (vbegetinfo(&vi)) - return (0); + return 0; vbefreeinfo(vi); - return (1); + return 1; } #ifdef VESABIOSVERBOSE static const char * -mm2txt(mm) - unsigned int mm; +mm2txt(unsigned int mm) { static char buf[30]; static const char *names[] = { @@ -155,10 +152,10 @@ mm2txt(mm) "YUV" }; - if (mm < sizeof(names)/sizeof(names[0])) - return (names[mm]); + if (mm < __arraycount(names)) + return names[mm]; snprintf(buf, sizeof(buf), "unknown memory model %d", mm); - return (buf); + return buf; } #endif @@ -292,13 +289,11 @@ vesabios_attach(struct device *parent, struct device *dev, } static int -vesabios_print(aux, pnp) - void *aux; - const char *pnp; +vesabios_print(void *aux, const char *pnp) { struct vesabiosdev_attach_args *vbaa = aux; if (pnp) aprint_normal("%s at %s", vbaa->vbaa_type, pnp); - return (UNCONF); + return UNCONF; }