Code cleanup: remove unused #include, variables and code,

This commit is contained in:
Kees van Reeuwijk 2010-04-15 18:49:36 +00:00
parent cfb108afc7
commit b412fb7ad5
21 changed files with 24 additions and 52 deletions

View file

@ -1494,7 +1494,7 @@ static void ls(char *dir)
}
(void) r_readdir(name); /* Skip ".." too. */
while ((ino= r_readdir(name)) != 0) printf("%s/%s\n", dir, name);
while (r_readdir(name) != 0) printf("%s/%s\n", dir, name);
}
static u32_t milli_time(void)

View file

@ -49,13 +49,10 @@ __FBSDID("$FreeBSD: src/bin/sh/error.c,v 1.25 2004/04/06 20:06:51 markm Exp $");
#include "options.h"
#include "output.h"
#include "error.h"
#include "nodes.h" /* show.h needs nodes.h */
#include "show.h"
#include "trap.h"
#include <signal.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <sys/types.h>

View file

@ -620,7 +620,8 @@ PRIVATE int get_samples_in_buf (u32_t *samples_in_buf, int *len, int chan) {
default: return EINVAL;
}
samp_ct = pci_inw(reg(samp_ct_reg));
/* TODO: is this inw useful? */
(void) pci_inw(reg(samp_ct_reg));
curr_samp_ct = pci_inw(reg(curr_samp_ct_reg));
*samples_in_buf = (u32_t) (sub_dev[chan].BufLength * 8192) +

View file

@ -622,7 +622,8 @@ PRIVATE int get_samples_in_buf (u32_t *samples_in_buf, int *len, int chan) {
default: return EINVAL;
}
samp_ct = pci_inw(reg(samp_ct_reg));
/* TODO: is this statement useful? */
(void) pci_inw(reg(samp_ct_reg));
curr_samp_ct = pci_inw(reg(curr_samp_ct_reg));
*samples_in_buf = (u32_t) (sub_dev[chan].BufLength * 8192) +

View file

@ -156,7 +156,6 @@ PRIVATE void sef_local_startup()
PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info))
{
/* Initialize the DEC 21140A driver. */
int r;
int fkeys, sfkeys;
(progname=strrchr(env_argv[0],'/')) ? progname++ : (progname=env_argv[0]);

View file

@ -318,7 +318,7 @@ PRIVATE void sef_local_startup()
PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info))
{
/* Initialize the dp8390 driver. */
int i, r;
int i;
dpeth_t *dep;
long v;
@ -879,8 +879,7 @@ dpeth_t *dep;
/*===========================================================================*
* do_getstat *
*===========================================================================*/
static void do_getstat(mp)
message *mp;
static void do_getstat(message *mp)
{
int port, r;
dpeth_t *dep;

View file

@ -89,12 +89,12 @@ static void mem_getblock(dpeth_t *dep, u16_t offset, int size, void *dst)
*/
static void mem_nic2user(dpeth_t * dep, int pageno, int pktsize)
{
panic("mem_nic2user: not converted to safecopies");
#if 0
phys_bytes offset;
iovec_dat_s_t *iovp = &dep->de_read_iovec;
int bytes, ix = 0;
panic("mem_nic2user: not converted to safecopies");
#if 0
/* Computes shared memory address (skipping receive header) */
offset = pageno * DP_PAGESIZE + sizeof(dp_rcvhdr_t);

View file

@ -283,7 +283,6 @@ static void do_init(const message * mp)
dpeth_t *dep;
dp_conf_t *dcp;
message reply_mess;
const char *portname;
port = mp->DL_PORT;
if (port >= 0 && port < DE_PORT_NR) {
@ -292,7 +291,6 @@ static void do_init(const message * mp)
dcp = &dp_conf[port];
strcpy(dep->de_name, DevName);
dep->de_name[4] = '0' + port;
portname = dep->de_name;
if (dep->de_mode == DEM_DISABLED) {
@ -345,7 +343,6 @@ static void do_init(const message * mp)
} else { /* Port number is out of range */
port = ENXIO;
portname = "(illegal dpeth port)";
}
reply_mess.m_type = DL_CONF_REPLY;
@ -667,7 +664,7 @@ PRIVATE void sef_local_startup()
PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info))
{
/* Initialize the dpeth driver. */
int r, rc, fkeys, sfkeys;
int fkeys, sfkeys;
(progname=strrchr(env_argv[0],'/')) ? progname++ : (progname=env_argv[0]);

View file

@ -279,7 +279,7 @@ int wdeth_probe(dpeth_t * dep);
#endif
#define lock() (++dep->de_int_pending,sys_irqdisable(&dep->de_hook))
#define unlock() do{int i=(--dep->de_int_pending)?0:sys_irqenable(&dep->de_hook);}while(0)
#define unlock() do{int i=(--dep->de_int_pending)?0:sys_irqenable(&dep->de_hook);(void) i;}while(0)
#define milli_delay(t) tickdelay(1)
/** dp.h **/

View file

@ -248,7 +248,7 @@ PRIVATE int e1000_probe(e1000_t *e)
int i, r, devind;
u16_t vid, did;
u32_t status[2];
u32_t gfpreg, sector_base_addr, sector_end_addr;
u32_t gfpreg, sector_base_addr;
char *dname;
E1000_DEBUG(3, ("%s: probe()\n", e->name));
@ -338,12 +338,9 @@ PRIVATE int e1000_probe(e1000_t *e)
gfpreg = E1000_READ_FLASH_REG(e, ICH_FLASH_GFPREG);
/*
* sector_X_addr is a "sector"-aligned address (4096 bytes)
* Add 1 to sector_end_addr since this sector is included in
* the overall size.
* sector_base_addr is a "sector"-aligned address (4096 bytes)
*/
sector_base_addr = gfpreg & FLASH_GFPREG_BASE_MASK;
sector_end_addr = ((gfpreg >> 16) & FLASH_GFPREG_BASE_MASK) + 1;
/* flash_base_addr is byte-aligned */
e->flash_base_addr = sector_base_addr << FLASH_SECTOR_ADDR_SHIFT;

View file

@ -419,8 +419,7 @@ static void restart_driver(int which, int tell_rs)
*/
message msg;
int ipc_status;
endpoint_t endpt;
int r, w = 0;
int r;
if (tell_rs) {
/* Tell RS to refresh or restart the driver */

View file

@ -722,8 +722,7 @@ static int fxp_probe(fxp_t *fp)
/*===========================================================================*
* fxp_conf_hw *
*===========================================================================*/
static void fxp_conf_hw(fp)
fxp_t *fp;
static void fxp_conf_hw(fxp_t *fp)
{
int i;
int mwi, ext_stat1, ext_stat2, lim_fifo, i82503, fc;

View file

@ -1472,7 +1472,6 @@ ether_card_t *ec;
int devind, just_one, i, r;
u16_t vid, did;
char *dname;
if ((ec->ec_pcibus | ec->ec_pcidev | ec->ec_pcifunc) != 0)
{
@ -1528,10 +1527,6 @@ ether_card_t *ec;
return 0;
}
dname= pci_dev_name(vid, did);
if (!dname)
dname= "unknown device";
pci_reserve(devind);
getAddressing(devind, ec);

View file

@ -299,7 +299,6 @@ unsigned nr_req; /* length of request vector */
/* Read or write one the driver's minor devices. */
unsigned count;
vir_bytes user_vir;
struct device *dv;
int accumulated_read = 0;
struct logdevice *log;
size_t vir_offset = 0;
@ -308,7 +307,6 @@ unsigned nr_req; /* length of request vector */
return EIO;
/* Get minor device number and check for /dev/null. */
dv = &log_geom[log_device];
log = &logdevices[log_device];
while (nr_req > 0) {

View file

@ -1507,18 +1507,15 @@ suspend_write:
* Write data which is denoted by the message to the card and send it. *
*****************************************************************************/
static void or_writev_s (message * mp, int from_int) {
int port, or_client, count, size, err, data_len, data_off, tx_head;
int port, or_client, count, size, err, data_len, data_off;
int o, j, n, i, s, p, cps ;
struct ethhdr *eh;
t_or *orp;
clock_t timebefore, t0;
phys_bytes phys_user;
hermes_t *hw;
struct hermes_tx_descriptor desc;
int iov_offset = 0;
struct header_struct hdr;
iovec_s_t *iovp;
phys_bytes phys_databuf;
u16_t txfid;
/* We need space for the max packet size itself, plus an ethernet

View file

@ -150,8 +150,7 @@ message *mp;
}
}
PRIVATE void do_next_dev(mp)
message *mp;
PRIVATE void do_next_dev(message *mp)
{
int r, devind;
u16_t vid, did;

View file

@ -295,7 +295,7 @@ PUBLIC int pci_first_dev_a(
u16_t *didp
)
{
int i, devind;
int devind;
for (devind= 0; devind < nr_pcidev; devind++)
{
@ -2279,12 +2279,8 @@ PRIVATE void pcibr_cb_wsts(int busind, u16_t value)
/*===========================================================================*
* pcibr_via_rsts *
*===========================================================================*/
PRIVATE u16_t pcibr_via_rsts(busind)
int busind;
PRIVATE u16_t pcibr_via_rsts(int busind)
{
int devind;
devind= pcibus[busind].pb_devind;
return 0;
}

View file

@ -2407,8 +2407,7 @@ static void do_hard_int(void)
/*===========================================================================*
* rl_handler *
*===========================================================================*/
static int rl_handler(rep)
re_t *rep;
static int rl_handler(re_t *rep)
{
int i, port, tx_head, tx_tail, link_up;
u16_t isr, tsad;

View file

@ -368,7 +368,6 @@ PRIVATE void sef_local_startup()
PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info))
{
/* Initialize the rtl8169 driver. */
int r;
re_t *rep;
long v;

View file

@ -965,7 +965,7 @@ tty_t *tp;
/* Get the BIOS parameters that describe the VDU. */
if (! vdu_initialized++) {
/* How about error checking? What to do on failure??? */
/* FIXME: How about error checking? What to do on failure??? */
s=sys_readbios(VDU_SCREEN_COLS_ADDR, &bios_columns,
VDU_SCREEN_COLS_SIZE);
s=sys_readbios(VDU_CRT_BASE_ADDR, &bios_crtbase,

View file

@ -47,7 +47,7 @@ endpoint_t *e_granter; /* new granter (magic grants) */
static cp_grant_t g;
static int proc_nr;
static const struct proc *granter_proc;
int r, depth = 0;
int depth = 0;
do {
/* Get granter process slot (if valid), and check range of
@ -86,9 +86,9 @@ endpoint_t *e_granter; /* new granter (magic grants) */
* (presumably) set an invalid grant table entry by returning
* EPERM, just like with an invalid grant id.
*/
if((r=data_copy(granter,
if(data_copy(granter,
priv(granter_proc)->s_grant_table + sizeof(g)*grant,
KERNEL, (vir_bytes) &g, sizeof(g))) != OK) {
KERNEL, (vir_bytes) &g, sizeof(g)) != OK) {
printf(
"verify_grant: grant verify: data_copy failed\n");
return EPERM;