Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev Use ANSI function decls, sprinkle static.
details: https://anonhg.NetBSD.org/src/rev/0574a6578a5b
branches: trunk
changeset: 569687:0574a6578a5b
user: thorpej <thorpej%NetBSD.org@localhost>
date: Mon Aug 30 00:34:41 2004 +0000
description:
Use ANSI function decls, sprinkle static.
diffstat:
sys/dev/ld.c | 36 ++++++------
sys/dev/md.c | 101 +++++++++++++-----------------------
sys/dev/vnd.c | 157 ++++++++++++++++++++++-----------------------------------
3 files changed, 115 insertions(+), 179 deletions(-)
diffs (truncated from 658 to 300 lines):
diff -r 4fbb5a44b0ef -r 0574a6578a5b sys/dev/ld.c
--- a/sys/dev/ld.c Sun Aug 29 20:45:18 2004 +0000
+++ b/sys/dev/ld.c Mon Aug 30 00:34:41 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ld.c,v 1.28 2004/07/20 15:44:20 dbj Exp $ */
+/* $NetBSD: ld.c,v 1.29 2004/08/30 00:34:41 thorpej Exp $ */
/*-
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ld.c,v 1.28 2004/07/20 15:44:20 dbj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ld.c,v 1.29 2004/08/30 00:34:41 thorpej Exp $");
#include "rnd.h"
@@ -78,14 +78,14 @@
extern struct cfdriver ld_cd;
-dev_type_open(ldopen);
-dev_type_close(ldclose);
-dev_type_read(ldread);
-dev_type_write(ldwrite);
-dev_type_ioctl(ldioctl);
-dev_type_strategy(ldstrategy);
-dev_type_dump(lddump);
-dev_type_size(ldsize);
+static dev_type_open(ldopen);
+static dev_type_close(ldclose);
+static dev_type_read(ldread);
+static dev_type_write(ldwrite);
+static dev_type_ioctl(ldioctl);
+static dev_type_strategy(ldstrategy);
+static dev_type_dump(lddump);
+static dev_type_size(ldsize);
const struct bdevsw ld_bdevsw = {
ldopen, ldclose, ldstrategy, ldioctl, lddump, ldsize, D_DISK
@@ -271,7 +271,7 @@
}
/* ARGSUSED */
-int
+static int
ldopen(dev_t dev, int flags, int fmt, struct proc *p)
{
struct ld_softc *sc;
@@ -315,7 +315,7 @@
}
/* ARGSUSED */
-int
+static int
ldclose(dev_t dev, int flags, int fmt, struct proc *p)
{
struct ld_softc *sc;
@@ -350,7 +350,7 @@
}
/* ARGSUSED */
-int
+static int
ldread(dev_t dev, struct uio *uio, int ioflag)
{
@@ -358,7 +358,7 @@
}
/* ARGSUSED */
-int
+static int
ldwrite(dev_t dev, struct uio *uio, int ioflag)
{
@@ -366,7 +366,7 @@
}
/* ARGSUSED */
-int
+static int
ldioctl(dev_t dev, u_long cmd, caddr_t addr, int32_t flag, struct proc *p)
{
struct ld_softc *sc;
@@ -478,7 +478,7 @@
return (error);
}
-void
+static void
ldstrategy(struct buf *bp)
{
struct ld_softc *sc;
@@ -617,7 +617,7 @@
}
}
-int
+static int
ldsize(dev_t dev)
{
struct ld_softc *sc;
@@ -734,7 +734,7 @@
/*
* Take a dump.
*/
-int
+static int
lddump(dev_t dev, daddr_t blkno, caddr_t va, size_t size)
{
struct ld_softc *sc;
diff -r 4fbb5a44b0ef -r 0574a6578a5b sys/dev/md.c
--- a/sys/dev/md.c Sun Aug 29 20:45:18 2004 +0000
+++ b/sys/dev/md.c Mon Aug 30 00:34:41 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: md.c,v 1.37 2004/04/21 18:40:37 itojun Exp $ */
+/* $NetBSD: md.c,v 1.38 2004/08/30 00:34:42 thorpej Exp $ */
/*
* Copyright (c) 1995 Gordon W. Ross, Leo Weppelman.
@@ -46,7 +46,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: md.c,v 1.37 2004/04/21 18:40:37 itojun Exp $");
+__KERNEL_RCSID(0, "$NetBSD: md.c,v 1.38 2004/08/30 00:34:42 thorpej Exp $");
#include "opt_md.h"
@@ -92,16 +92,17 @@
#define sc_size sc_md.md_size
#define sc_type sc_md.md_type
-void mdattach __P((int));
-static void md_attach __P((struct device *, struct device *, void *));
+void mdattach(int);
+
+static void md_attach(struct device *, struct device *, void *);
-dev_type_open(mdopen);
-dev_type_close(mdclose);
-dev_type_read(mdread);
-dev_type_write(mdwrite);
-dev_type_ioctl(mdioctl);
-dev_type_strategy(mdstrategy);
-dev_type_size(mdsize);
+static dev_type_open(mdopen);
+static dev_type_close(mdclose);
+static dev_type_read(mdread);
+static dev_type_write(mdwrite);
+static dev_type_ioctl(mdioctl);
+static dev_type_strategy(mdstrategy);
+static dev_type_size(mdsize);
const struct bdevsw md_bdevsw = {
mdopen, mdclose, mdstrategy, mdioctl, nodump, mdsize, D_DISK
@@ -112,7 +113,7 @@
nostop, notty, nopoll, nommap, nokqfilter, D_DISK
};
-struct dkdriver mddkdriver = { mdstrategy };
+static struct dkdriver mddkdriver = { mdstrategy };
static int ramdisk_ndevs;
static void *ramdisk_devs[MD_MAX_UNITS];
@@ -121,8 +122,7 @@
* This is called if we are configured as a pseudo-device
*/
void
-mdattach(n)
- int n;
+mdattach(int n)
{
struct md_softc *sc;
int i;
@@ -158,9 +158,7 @@
}
static void
-md_attach(parent, self, aux)
- struct device *parent, *self;
- void *aux;
+md_attach(struct device *parent, struct device *self, void *aux)
{
struct md_softc *sc = (struct md_softc *)self;
@@ -191,14 +189,14 @@
*/
#if MEMORY_DISK_SERVER
-static int md_server_loop __P((struct md_softc *sc));
-static int md_ioctl_server __P((struct md_softc *sc,
- struct md_conf *umd, struct proc *proc));
+static int md_server_loop(struct md_softc *sc);
+static int md_ioctl_server(struct md_softc *sc, struct md_conf *umd,
+ struct proc *proc);
#endif /* MEMORY_DISK_SERVER */
-static int md_ioctl_kalloc __P((struct md_softc *sc,
- struct md_conf *umd, struct proc *proc));
+static int md_ioctl_kalloc(struct md_softc *sc, struct md_conf *umd,
+ struct proc *proc);
-int
+static int
mdsize(dev_t dev)
{
int unit;
@@ -217,11 +215,8 @@
return (sc->sc_size >> DEV_BSHIFT);
}
-int
-mdopen(dev, flag, fmt, proc)
- dev_t dev;
- int flag, fmt;
- struct proc *proc;
+static int
+mdopen(dev_t dev, int flag, int fmt, struct proc *proc)
{
int unit;
struct md_softc *sc;
@@ -254,11 +249,8 @@
return 0;
}
-int
-mdclose(dev, flag, fmt, proc)
- dev_t dev;
- int flag, fmt;
- struct proc *proc;
+static int
+mdclose(dev_t dev, int flag, int fmt, struct proc *proc)
{
int unit;
@@ -270,11 +262,8 @@
return 0;
}
-int
-mdread(dev, uio, flags)
- dev_t dev;
- struct uio *uio;
- int flags;
+static int
+mdread(dev_t dev, struct uio *uio, int flags)
{
int unit;
struct md_softc *sc;
@@ -292,11 +281,8 @@
return (physio(mdstrategy, NULL, dev, B_READ, minphys, uio));
}
-int
-mdwrite(dev, uio, flags)
- dev_t dev;
- struct uio *uio;
- int flags;
+static int
+mdwrite(dev_t dev, struct uio *uio, int flags)
{
int unit;
struct md_softc *sc;
@@ -318,9 +304,8 @@
* Handle I/O requests, either directly, or
* by passing them to the server process.
*/
-void
-mdstrategy(bp)
- struct buf *bp;
+static void
+mdstrategy(struct buf *bp)
{
int unit;
struct md_softc *sc;
@@ -379,13 +364,8 @@
biodone(bp);
}
-int
-mdioctl(dev, cmd, data, flag, proc)
- dev_t dev;
- u_long cmd;
- int flag;
- caddr_t data;
- struct proc *proc;
+static int
+mdioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *proc)
{
int unit;
struct md_softc *sc;
@@ -428,10 +408,7 @@
* Just allocate some kernel memory and return.
*/
static int
-md_ioctl_kalloc(sc, umd, proc)
- struct md_softc *sc;
- struct md_conf *umd;
Home |
Main Index |
Thread Index |
Old Index