Mercurial > illumos > illumos-gate
changeset 13404:4a1868d4ae91
1200 various modules declare static functions within function bodies
Reviewed by: Jason King <jason.brian.king@gmail.com>
Reviewed by: Gordon Ross <gwr@nexenta.com>
Approved by: Eric Schrock <eric.schrock@delphix.com>
author | Richard Lowe <richlowe@richlowe.net> |
---|---|
date | Wed, 22 Jun 2011 10:37:21 -0700 |
parents | ed8234f32fb8 |
children | fee421268ea6 |
files | usr/src/cmd/picl/plugins/sun4u/snowbird/frutree/piclkstat.c usr/src/lib/libbc/libc/gen/common/usleep.c usr/src/uts/i86pc/io/acpi/drmach_acpi/drmach_acpi.c usr/src/uts/i86pc/io/dr/dr.c usr/src/uts/sun4u/cpu/opl_kdi.c usr/src/uts/sun4u/ngdr/io/dr.c usr/src/uts/sun4u/opl/io/drmach.c usr/src/uts/sun4u/os/fillsysinfo.c usr/src/uts/sun4u/serengeti/io/sbdp_cpu.c usr/src/uts/sun4u/starcat/io/drmach.c usr/src/uts/sun4u/starfire/io/drmach.c usr/src/uts/sun4u/sunfire/io/fhc.c |
diffstat | 12 files changed, 84 insertions(+), 96 deletions(-) [+] |
line wrap: on
line diff
--- a/usr/src/cmd/picl/plugins/sun4u/snowbird/frutree/piclkstat.c Mon May 16 01:24:15 2011 +0100 +++ b/usr/src/cmd/picl/plugins/sun4u/snowbird/frutree/piclkstat.c Wed Jun 22 10:37:21 2011 -0700 @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * Implementation to get PORT nodes state and condition information */ @@ -70,6 +68,7 @@ static int serial_port_cond(kstat_ctl_t *kc, char *, int); static int parallel_port_state(kstat_ctl_t *, char *, int); static int parallel_port_cond(kstat_ctl_t *kc, char *, int); +static void sig_alarm_handler(int); static funcp port_state[] = { kstat_network_port_state, @@ -144,13 +143,13 @@ for (ksp = kc->kc_chain; ksp; ksp = ksp->ks_next) { if (strcmp(ksp->ks_module, ks_module) == 0 && - ksp->ks_instance == ks_instance && - ksp->ks_type == KSTAT_TYPE_NAMED && - kstat_read(kc, ksp, NULL) != -1 && - kstat_data_lookup(ksp, name)) { + ksp->ks_instance == ks_instance && + ksp->ks_type == KSTAT_TYPE_NAMED && + kstat_read(kc, ksp, NULL) != -1 && + kstat_data_lookup(ksp, name)) { ksp = kstat_lookup(kc, ks_module, ks_instance, - ksp->ks_name); + ksp->ks_name); if (!ksp) return (NULL); if (kstat_read(kc, ksp, NULL) == -1) @@ -171,7 +170,7 @@ kstat_named_t *port_datap = NULL; if ((port_datap = kstat_name_lookup(kc, ks_module, ks_instance, - LINK_UP)) == NULL) { + LINK_UP)) == NULL) { return (-1); } if (port_datap == NULL) { @@ -208,7 +207,7 @@ uint64_t ifspeed, ierrors, ipackets, oerrors, opackets; if ((port_datap = kstat_name_lookup(kc, ks_module, ks_instance, - LINK_UP)) == NULL) { + LINK_UP)) == NULL) { return (-1); } @@ -222,7 +221,7 @@ } if ((port_datap = kstat_name_lookup(kc, ks_module, ks_instance, - DUPLEX)) == NULL) { + DUPLEX)) == NULL) { return (-1); } @@ -236,7 +235,7 @@ } if ((port_datap = kstat_name_lookup(kc, ks_module, ks_instance, - IF_SPEED)) == NULL) { + IF_SPEED)) == NULL) { return (-1); } if (port_datap->data_type == KSTAT_DATA_UINT32) { @@ -250,7 +249,7 @@ /* check for FAILING conditions */ if ((port_datap = kstat_name_lookup(kc, ks_module, ks_instance, - IERRORS)) == NULL) { + IERRORS)) == NULL) { return (-1); } if (port_datap->data_type == KSTAT_DATA_UINT32) { @@ -260,7 +259,7 @@ } if ((port_datap = kstat_name_lookup(kc, ks_module, ks_instance, - IPACKETS)) == NULL) { + IPACKETS)) == NULL) { return (-1); } @@ -274,7 +273,7 @@ } if ((port_datap = kstat_name_lookup(kc, ks_module, ks_instance, - OERRORS)) == NULL) { + OERRORS)) == NULL) { return (-1); } if (port_datap->data_type == KSTAT_DATA_UINT32) { @@ -284,7 +283,7 @@ } if ((port_datap = kstat_name_lookup(kc, ks_module, ks_instance, - OPACKETS)) == NULL) { + OPACKETS)) == NULL) { return (-1); } if (port_datap->data_type == KSTAT_DATA_UINT32) { @@ -297,7 +296,7 @@ } if ((port_datap = kstat_name_lookup(kc, ks_module, ks_instance, - RUNT_ERRORS)) == NULL) { + RUNT_ERRORS)) == NULL) { return (-1); } if (port_datap->data_type == KSTAT_DATA_UINT32) { @@ -310,7 +309,7 @@ } if ((port_datap = kstat_name_lookup(kc, ks_module, ks_instance, - COLLISIONS)) == NULL) { + COLLISIONS)) == NULL) { return (-1); } if (port_datap->data_type == KSTAT_DATA_UINT32) { @@ -337,7 +336,6 @@ char device[20]; struct termios flags; struct sigaction old_sa, new_sa; - static void sig_alarm_handler(int); (void) memset(&old_sa, 0, sizeof (old_sa)); (void) memset(&new_sa, 0, sizeof (new_sa)); @@ -404,7 +402,7 @@ char ks_name[20]; (void) snprintf(ks_name, sizeof (ks_name), "%s%d", ks_module, - ks_instance); + ks_instance); if ((ksp = kstat_lookup(kc, ks_module, ks_instance, ks_name)) == NULL) { return (-1); }
--- a/usr/src/lib/libbc/libc/gen/common/usleep.c Mon May 16 01:24:15 2011 +0100 +++ b/usr/src/lib/libbc/libc/gen/common/usleep.c Wed Jun 22 10:37:21 2011 -0700 @@ -9,8 +9,6 @@ * specifies the terms and conditions for redistribution. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <unistd.h> #include <sys/time.h> #include <signal.h> @@ -23,10 +21,16 @@ static int ringring; +static void +sleepx(void) +{ + + ringring = 1; +} + void usleep(unsigned n) { - static void sleepx(); int omask; struct itimerval itv, oitv; struct itimerval *itp = &itv; @@ -65,10 +69,3 @@ (void) sigsetmask(omask); (void) setitimer(ITIMER_REAL, &oitv, (struct itimerval *)0); } - -static void -sleepx(void) -{ - - ringring = 1; -}
--- a/usr/src/uts/i86pc/io/acpi/drmach_acpi/drmach_acpi.c Mon May 16 01:24:15 2011 +0100 +++ b/usr/src/uts/i86pc/io/acpi/drmach_acpi/drmach_acpi.c Wed Jun 22 10:37:21 2011 -0700 @@ -82,6 +82,22 @@ static int drmach_name2type_idx(char *); static sbd_error_t *drmach_mem_update_lgrp(drmachid_t); +static void drmach_board_dispose(drmachid_t id); +static sbd_error_t *drmach_board_release(drmachid_t); +static sbd_error_t *drmach_board_status(drmachid_t, drmach_status_t *); + +static void drmach_io_dispose(drmachid_t); +static sbd_error_t *drmach_io_release(drmachid_t); +static sbd_error_t *drmach_io_status(drmachid_t, drmach_status_t *); + +static void drmach_cpu_dispose(drmachid_t); +static sbd_error_t *drmach_cpu_release(drmachid_t); +static sbd_error_t *drmach_cpu_status(drmachid_t, drmach_status_t *); + +static void drmach_mem_dispose(drmachid_t); +static sbd_error_t *drmach_mem_release(drmachid_t); +static sbd_error_t *drmach_mem_status(drmachid_t, drmach_status_t *); + #ifdef DEBUG int drmach_debug = 1; /* set to non-zero to enable debug messages */ #endif /* DEBUG */ @@ -523,10 +539,6 @@ drmach_board_t * drmach_board_new(uint_t bnum, int boot_board) { - static void drmach_board_dispose(drmachid_t id); - static sbd_error_t *drmach_board_release(drmachid_t); - static sbd_error_t *drmach_board_status(drmachid_t, drmach_status_t *); - sbd_error_t *err; drmach_board_t *bp; dev_info_t *dip = NULL; @@ -961,10 +973,6 @@ sbd_error_t * drmach_io_new(drmach_device_t *proto, drmachid_t *idp) { - static void drmach_io_dispose(drmachid_t); - static sbd_error_t *drmach_io_release(drmachid_t); - static sbd_error_t *drmach_io_status(drmachid_t, drmach_status_t *); - drmach_io_t *ip; int portid; @@ -1037,10 +1045,6 @@ sbd_error_t * drmach_cpu_new(drmach_device_t *proto, drmachid_t *idp) { - static void drmach_cpu_dispose(drmachid_t); - static sbd_error_t *drmach_cpu_release(drmachid_t); - static sbd_error_t *drmach_cpu_status(drmachid_t, drmach_status_t *); - int portid; processorid_t cpuid; drmach_cpu_t *cp = NULL; @@ -1250,10 +1254,6 @@ sbd_error_t * drmach_mem_new(drmach_device_t *proto, drmachid_t *idp) { - static void drmach_mem_dispose(drmachid_t); - static sbd_error_t *drmach_mem_release(drmachid_t); - static sbd_error_t *drmach_mem_status(drmachid_t, drmach_status_t *); - DRMACH_HANDLE hdl; drmach_mem_t *mp; int portid;
--- a/usr/src/uts/i86pc/io/dr/dr.c Mon May 16 01:24:15 2011 +0100 +++ b/usr/src/uts/i86pc/io/dr/dr.c Wed Jun 22 10:37:21 2011 -0700 @@ -71,6 +71,8 @@ uint_t dr_debug = 0; /* dr.h for bit values */ #endif /* DEBUG */ +static int dr_dev_type_to_nt(char *); + /* * NOTE: state_str, nt_str and SBD_CMD_STR are only used in a debug * kernel. They are, however, referenced during both debug and non-debug @@ -554,8 +556,6 @@ dr_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *cred_p, int *rval_p) { - static int dr_dev_type_to_nt(char *); - int rv = 0; int instance; int bd;
--- a/usr/src/uts/sun4u/cpu/opl_kdi.c Mon May 16 01:24:15 2011 +0100 +++ b/usr/src/uts/sun4u/cpu/opl_kdi.c Wed Jun 22 10:37:21 2011 -0700 @@ -23,8 +23,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * CPU-specific functions needed by the Kernel-Debugger Interface (KDI). These * functions are invoked directly by the kernel debugger (kmdb) while the system @@ -65,6 +63,8 @@ extern void kdi_flush_idcache(int, int, int, int); extern int kdi_get_stick(uint64_t *); +static void kdi_tickwait(clock_t); + static int kdi_cpu_ready_iter(int (*cb)(int, void *), void *arg) { @@ -88,7 +88,6 @@ uintptr_t arg2) { uint64_t idsr; - static void kdi_tickwait(clock_t); uint64_t endtick, tick; init_mondo_nocheck((xcfunc_t *)func, arg1, arg2); @@ -123,7 +122,8 @@ { clock_t endtick = gettick() + nticks; - while (gettick() < endtick); + while (gettick() < endtick) + ; } static void
--- a/usr/src/uts/sun4u/ngdr/io/dr.c Mon May 16 01:24:15 2011 +0100 +++ b/usr/src/uts/sun4u/ngdr/io/dr.c Wed Jun 22 10:37:21 2011 -0700 @@ -156,6 +156,8 @@ int dr_modunload_okay = 0; /* set to non-zero to allow unload */ +static int dr_dev_type_to_nt(char *); + /* * State transition table. States valid transitions for "board" state. * Recall that non-zero return value terminates operation, however @@ -556,8 +558,6 @@ dr_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *cred_p, int *rval_p) { - static int dr_dev_type_to_nt(char *); - int rv = 0; int instance; int bd;
--- a/usr/src/uts/sun4u/opl/io/drmach.c Mon May 16 01:24:15 2011 +0100 +++ b/usr/src/uts/sun4u/opl/io/drmach.c Wed Jun 22 10:37:21 2011 -0700 @@ -229,6 +229,15 @@ static void drmach_swap_pa(drmach_mem_t *, drmach_mem_t *); static drmach_board_t *drmach_get_board_by_bnum(int); +static sbd_error_t *drmach_board_release(drmachid_t); +static sbd_error_t *drmach_board_status(drmachid_t, drmach_status_t *); +static void drmach_cpu_dispose(drmachid_t); +static sbd_error_t *drmach_cpu_release(drmachid_t); +static sbd_error_t *drmach_cpu_status(drmachid_t, drmach_status_t *); +static void drmach_mem_dispose(drmachid_t); +static sbd_error_t *drmach_mem_release(drmachid_t); +static sbd_error_t *drmach_mem_status(drmachid_t, drmach_status_t *); + /* options for the second argument in drmach_add_remove_cpu() */ #define HOTADD_CPU 1 #define HOTREMOVE_CPU 2 @@ -1021,9 +1030,6 @@ static drmach_board_t * drmach_board_new(int bnum, int boot_board) { - static sbd_error_t *drmach_board_release(drmachid_t); - static sbd_error_t *drmach_board_status(drmachid_t, drmach_status_t *); - drmach_board_t *bp; bp = kmem_zalloc(sizeof (drmach_board_t), KM_SLEEP); @@ -1811,10 +1817,6 @@ static sbd_error_t * drmach_cpu_new(drmach_device_t *proto, drmachid_t *idp) { - static void drmach_cpu_dispose(drmachid_t); - static sbd_error_t *drmach_cpu_release(drmachid_t); - static sbd_error_t *drmach_cpu_status(drmachid_t, drmach_status_t *); - int portid; drmach_cpu_t *cp = NULL; @@ -2208,9 +2210,6 @@ static sbd_error_t * drmach_mem_new(drmach_device_t *proto, drmachid_t *idp) { - static void drmach_mem_dispose(drmachid_t); - static sbd_error_t *drmach_mem_release(drmachid_t); - static sbd_error_t *drmach_mem_status(drmachid_t, drmach_status_t *); dev_info_t *dip; int rv;
--- a/usr/src/uts/sun4u/os/fillsysinfo.c Mon May 16 01:24:15 2011 +0100 +++ b/usr/src/uts/sun4u/os/fillsysinfo.c Wed Jun 22 10:37:21 2011 -0700 @@ -23,8 +23,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/errno.h> #include <sys/types.h> #include <sys/param.h> @@ -103,6 +101,7 @@ static void check_cpus_ver(void); static void check_cpus_set(void); +static void fill_address(pnode_t, char *); void fill_cpu(pnode_t); void fill_cpu_ddi(dev_info_t *); void empty_cpu(int); @@ -243,7 +242,6 @@ { extern int status_okay(int, char *, int); char tmp_name[MAXSYSNAME]; - static void fill_address(pnode_t, char *); int sok; #ifdef VPRINTF
--- a/usr/src/uts/sun4u/serengeti/io/sbdp_cpu.c Mon May 16 01:24:15 2011 +0100 +++ b/usr/src/uts/sun4u/serengeti/io/sbdp_cpu.c Wed Jun 22 10:37:21 2011 -0700 @@ -96,7 +96,7 @@ extern sbdp_wnode_t *sbdp_get_wnodep(int); extern caddr_t sbdp_shutdown_va; static int sbdp_prom_get_cpu(void *arg, int changed); - +static void sbdp_cpu_shutdown_self(void); int sbdp_disconnect_cpu(sbdp_handle_t *hp, dev_info_t *dip, processorid_t cpuid) @@ -360,7 +360,6 @@ sbdp_cpu_poweroff(struct cpu *cp) { processorid_t cpuid; - static void sbdp_cpu_shutdown_self(void); pnode_t nodeid; sbdp_cpu_sram_map_t map; static fn_t f = "sbdp_cpu_poweroff";
--- a/usr/src/uts/sun4u/starcat/io/drmach.c Mon May 16 01:24:15 2011 +0100 +++ b/usr/src/uts/sun4u/starcat/io/drmach.c Wed Jun 22 10:37:21 2011 -0700 @@ -378,6 +378,8 @@ uint64_t drmach_bus_sync_list[18 * 4 * 4 + 1]; static kmutex_t drmach_bus_sync_lock; +static void drmach_fini(void); + static sbd_error_t *drmach_device_new(drmach_node_t *, drmach_board_t *, int, drmachid_t *); static sbd_error_t *drmach_cpu_new(drmach_device_t *, drmachid_t *); @@ -385,6 +387,17 @@ static sbd_error_t *drmach_pci_new(drmach_device_t *, drmachid_t *); static sbd_error_t *drmach_io_new(drmach_device_t *, drmachid_t *); +static sbd_error_t *drmach_board_release(drmachid_t); +static sbd_error_t *drmach_board_status(drmachid_t, drmach_status_t *); + +static void drmach_cpu_dispose(drmachid_t); +static sbd_error_t *drmach_cpu_release(drmachid_t); +static sbd_error_t *drmach_cpu_status(drmachid_t, drmach_status_t *); + +static void drmach_mem_dispose(drmachid_t); +static sbd_error_t *drmach_mem_release(drmachid_t); +static sbd_error_t *drmach_mem_status(drmachid_t, drmach_status_t *); + static dev_info_t *drmach_node_ddi_get_dip(drmach_node_t *np); static int drmach_node_ddi_get_prop(drmach_node_t *np, char *name, void *buf, int len); @@ -546,7 +559,6 @@ int _fini(void) { - static void drmach_fini(void); int err; if ((err = mod_remove(&modlinkage)) == 0) @@ -1181,9 +1193,6 @@ static drmach_board_t * drmach_board_new(int bnum) { - static sbd_error_t *drmach_board_release(drmachid_t); - static sbd_error_t *drmach_board_status(drmachid_t, drmach_status_t *); - drmach_board_t *bp; bp = kmem_zalloc(sizeof (drmach_board_t), KM_SLEEP); @@ -5226,10 +5235,6 @@ static sbd_error_t * drmach_cpu_new(drmach_device_t *proto, drmachid_t *idp) { - static void drmach_cpu_dispose(drmachid_t); - static sbd_error_t *drmach_cpu_release(drmachid_t); - static sbd_error_t *drmach_cpu_status(drmachid_t, drmach_status_t *); - sbd_error_t *err; uint64_t scr_pa; drmach_cpu_t *cp = NULL; @@ -6257,10 +6262,6 @@ static sbd_error_t * drmach_mem_new(drmach_device_t *proto, drmachid_t *idp) { - static void drmach_mem_dispose(drmachid_t); - static sbd_error_t *drmach_mem_release(drmachid_t); - static sbd_error_t *drmach_mem_status(drmachid_t, drmach_status_t *); - sbd_error_t *err; uint64_t madr_pa; drmach_mem_t *mp;
--- a/usr/src/uts/sun4u/starfire/io/drmach.c Mon May 16 01:24:15 2011 +0100 +++ b/usr/src/uts/sun4u/starfire/io/drmach.c Wed Jun 22 10:37:21 2011 -0700 @@ -211,11 +211,21 @@ uint64_t physaddr; }; struct drmach_shutdown_mbox *drmach_shutdown_asm_mbox; + +static int drmach_fini(void); static sbd_error_t *drmach_device_new(drmach_node_t *, drmach_board_t *, drmach_device_t **); static sbd_error_t *drmach_cpu_new(drmach_device_t *); static sbd_error_t *drmach_mem_new(drmach_device_t *); static sbd_error_t *drmach_io_new(drmach_device_t *); +static sbd_error_t *drmach_board_release(drmachid_t); +static sbd_error_t *drmach_board_status(drmachid_t, drmach_status_t *); +static sbd_error_t *drmach_cpu_release(drmachid_t); +static sbd_error_t *drmach_cpu_status(drmachid_t, drmach_status_t *); +static sbd_error_t *drmach_io_release(drmachid_t); +static sbd_error_t *drmach_io_status(drmachid_t, drmach_status_t *); +static sbd_error_t *drmach_mem_release(drmachid_t); +static sbd_error_t *drmach_mem_status(drmachid_t, drmach_status_t *); extern struct cpu *SIGBCPU; @@ -347,8 +357,6 @@ int _fini(void) { - static int drmach_fini(void); - if (drmach_fini()) return (DDI_FAILURE); else @@ -787,9 +795,6 @@ static drmach_board_t * drmach_board_new(int bnum) { - static sbd_error_t *drmach_board_release(drmachid_t); - static sbd_error_t *drmach_board_status(drmachid_t, drmach_status_t *); - drmach_board_t *bp; bp = kmem_zalloc(sizeof (drmach_board_t), KM_SLEEP); @@ -1730,9 +1735,6 @@ static sbd_error_t * drmach_io_new(drmach_device_t *dp) { - static sbd_error_t *drmach_io_release(drmachid_t); - static sbd_error_t *drmach_io_status(drmachid_t, drmach_status_t *); - sbd_error_t *err; int portid; @@ -2350,9 +2352,6 @@ static sbd_error_t * drmach_cpu_new(drmach_device_t *dp) { - static sbd_error_t *drmach_cpu_release(drmachid_t); - static sbd_error_t *drmach_cpu_status(drmachid_t, drmach_status_t *); - sbd_error_t *err; int portid; @@ -2930,9 +2929,6 @@ static sbd_error_t * drmach_mem_new(drmach_device_t *dp) { - static sbd_error_t *drmach_mem_release(drmachid_t); - static sbd_error_t *drmach_mem_status(drmachid_t, drmach_status_t *); - dp->unum = 0; dp->cm.isa = (void *)drmach_mem_new; dp->cm.release = drmach_mem_release;
--- a/usr/src/uts/sun4u/sunfire/io/fhc.c Mon May 16 01:24:15 2011 +0100 +++ b/usr/src/uts/sun4u/sunfire/io/fhc.c Wed Jun 22 10:37:21 2011 -0700 @@ -94,6 +94,8 @@ }; static void fhc_tod_fault(enum tod_fault_type tod_bad); +static void fhc_cpu_shutdown_self(void); +static void os_completes_shutdown(void); /* * The dont_calibrate variable is meant to be set to one in /etc/system @@ -3194,7 +3196,6 @@ fhc_bd_t *bd_list; int delays; extern void idle_stop_xcall(void); - static void fhc_cpu_shutdown_self(void); ASSERT(MUTEX_HELD(&cpu_lock)); ASSERT((cp->cpu_flags & (CPU_EXISTS | CPU_OFFLINE | CPU_QUIESCED)) == @@ -3271,7 +3272,6 @@ fhc_cpu_shutdown_self(void) { extern void flush_windows(void); - static void os_completes_shutdown(void); flush_windows();