Module Name: src
Committed By: joerg
Date: Tue Aug 30 18:28:59 UTC 2011
Modified Files:
src/usr.sbin/eshconfig: eshconfig.c
Log Message:
ANSIfy + static + __dead
To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/eshconfig/eshconfig.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.sbin/eshconfig/eshconfig.c
diff -u src/usr.sbin/eshconfig/eshconfig.c:1.9 src/usr.sbin/eshconfig/eshconfig.c:1.10
--- src/usr.sbin/eshconfig/eshconfig.c:1.9 Wed Apr 15 05:50:20 2009
+++ src/usr.sbin/eshconfig/eshconfig.c Tue Aug 30 18:28:59 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: eshconfig.c,v 1.9 2009/04/15 05:50:20 lukem Exp $ */
+/* $NetBSD: eshconfig.c,v 1.10 2011/08/30 18:28:59 joerg Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: eshconfig.c,v 1.9 2009/04/15 05:50:20 lukem Exp $");
+__RCSID("$NetBSD: eshconfig.c,v 1.10 2011/08/30 18:28:59 joerg Exp $");
#endif /* not lint */
#include <sys/param.h>
@@ -68,7 +68,7 @@
u_int32_t rr_value;
};
-struct map_dma read_dma_map[] = {{0, RR_PS_READ_DISABLE},
+static struct map_dma read_dma_map[] = {{0, RR_PS_READ_DISABLE},
{4, RR_PS_READ_4},
{16, RR_PS_READ_16},
{32, RR_PS_READ_32},
@@ -78,7 +78,7 @@
{1024, RR_PS_READ_1024},
{-1, 0}};
-struct map_dma write_dma_map[] = {{0, RR_PS_WRITE_DISABLE},
+static struct map_dma write_dma_map[] = {{0, RR_PS_WRITE_DISABLE},
{4, RR_PS_WRITE_4},
{16, RR_PS_WRITE_16},
{32, RR_PS_WRITE_32},
@@ -101,29 +101,26 @@
u_int32_t ee_addr;
};
-static u_int32_t do_map __P((int, struct map_dma *));
-static void eeprom_upload __P((const char *));
-static void eeprom_download __P((const char *));
-static u_int32_t rr_checksum __P((const u_int32_t *, int));
-static void esh_tune __P((void));
-static void esh_tune_eeprom __P((void));
-static void esh_tuning_stats __P((void));
-static void esh_stats __P((int));
-static void esh_reset __P((void));
-static int drvspec_ioctl __P((char *, int, int, int, caddr_t));
-static void usage __P((void));
-int main __P((int, char *[]));
-
-
-struct ifreq ifr;
-char name[30] = "esh0";
-int s;
+static u_int32_t do_map(int, struct map_dma *);
+static void eeprom_upload(const char *);
+static void eeprom_download(const char *);
+static u_int32_t rr_checksum(const u_int32_t *, int);
+static void esh_tune(void);
+static void esh_tune_eeprom(void);
+static void esh_tuning_stats(void);
+static void esh_stats(int);
+static void esh_reset(void);
+static int drvspec_ioctl(char *, int, int, int, caddr_t);
+__dead static void usage(void);
+
+static char name[30] = "esh0";
+static int s;
#define RR_EE_SIZE 8192
-u_int32_t eeprom[RR_EE_SIZE];
-u_int32_t runcode[RR_EE_SIZE];
+static u_int32_t eeprom[RR_EE_SIZE];
+static u_int32_t runcode[RR_EE_SIZE];
-struct ifdrv ifd;
+static struct ifdrv ifd;
/* drvspec_ioctl
*
@@ -145,7 +142,7 @@
}
static void
-usage()
+usage(void)
{
fprintf(stderr, "eshconfig -- configure Essential Communications "
"HIPPI driver\n");
@@ -201,29 +198,27 @@
}
-int dma_thresh_read = -1;
-int dma_thresh_write = -1;
-int dma_min_grab = -1;
-int dma_max_read = -1;
-int dma_max_write = -1;
-
-int interrupt_delay = -1;
-
-int get_stats = 0;
-int get_tuning_stats = 0;
-int eeprom_write = 0;
-char *eeprom_download_filename = NULL;
-char *eeprom_upload_filename = NULL;
-int reset = 0;
+static int dma_thresh_read = -1;
+static int dma_thresh_write = -1;
+static int dma_min_grab = -1;
+static int dma_max_read = -1;
+static int dma_max_write = -1;
+
+static int interrupt_delay = -1;
+
+static int get_stats = 0;
+static int get_tuning_stats = 0;
+static int eeprom_write = 0;
+static char *eeprom_download_filename = NULL;
+static char *eeprom_upload_filename = NULL;
+static int reset = 0;
-struct rr_tuning rr_tune;
+static struct rr_tuning rr_tune;
struct rr_eeprom rr_eeprom;
struct rr_stats rr_stats;
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
int ch;
@@ -326,7 +321,7 @@
}
static void
-esh_tune()
+esh_tune(void)
{
dma_max_read = do_map(dma_max_read, read_dma_map);
if (dma_max_read != -1) {
@@ -381,7 +376,7 @@
*/
static void
-esh_tune_eeprom()
+esh_tune_eeprom(void)
{
#define LAST (RR_EE_HEADER_CHECKSUM / RR_EE_WORD_LEN)
#define FIRST (RR_EE_HEADER_CHECKSUM / RR_EE_WORD_LEN)
@@ -632,12 +627,10 @@
return checksum;
}
-struct stats_values {
+static struct stats_values {
int offset;
const char *name;
-};
-
-struct stats_values stats_values[] = {
+} stats_values[] = {
{0x04, "receive rings created"},
{0x08, "receive rings deleted"},
{0x0c, "interrupts"},
@@ -693,7 +686,7 @@
};
static void
-esh_reset()
+esh_reset(void)
{
if (drvspec_ioctl(name, s, EIOCRESET, 0, 0) < 0)
err(1, "ioctl(EIOCRESET)");
@@ -728,7 +721,7 @@
static void
-esh_tuning_stats()
+esh_tuning_stats(void)
{
printf("rt_mode_and_status = %x\n",
rr_tune.rt_mode_and_status);