From: Kees van Reeuwijk Date: Fri, 15 Jan 2010 21:45:30 +0000 (+0000) Subject: Added a missing return statement in paired_grant(). X-Git-Tag: v3.1.6~75 X-Git-Url: http://zhaoyanbai.com/repos/readme1st.txt?a=commitdiff_plain;h=4faed703d9857ccb248656c1f034cad32af3c0b0;p=minix.git Added a missing return statement in paired_grant(). Removed lots of unused variables. --- diff --git a/drivers/at_wini/at_wini.c b/drivers/at_wini/at_wini.c index ee6a518f1..00fec44ae 100644 --- a/drivers/at_wini/at_wini.c +++ b/drivers/at_wini/at_wini.c @@ -17,7 +17,6 @@ #include "at_wini.h" #include -#include #include #include #include @@ -483,8 +482,6 @@ PRIVATE void init_params_pci(int skip) /* Any non-compat drives? */ if (raid || (interface & (ATA_IF_NOTCOMPAT1 | ATA_IF_NOTCOMPAT2))) { - int s; - if (w_next_drive >= MAX_DRIVES) { /* We can't accept more drives, but have to search for @@ -510,11 +507,11 @@ PRIVATE void init_params_pci(int skip) w_instance, devind); continue; } - if ((s=sys_irqsetpolicy(irq, 0, &irq_hook)) != OK) { + if (sys_irqsetpolicy(irq, 0, &irq_hook) != OK) { printf("atapci: couldn't set IRQ policy %d\n", irq); continue; } - if ((s=sys_irqenable(&irq_hook)) != OK) { + if (sys_irqenable(&irq_hook) != OK) { printf("atapci: couldn't enable IRQ line %d\n", irq); continue; } @@ -671,9 +668,7 @@ message *m_ptr; *===========================================================================*/ PRIVATE struct device *w_prepare(int device) { -/* Prepare for I/O on a device. */ -struct wini *prev_wn; -prev_wn = w_wn; + /* Prepare for I/O on a device. */ w_device = device; if (device < NR_MINORS) { /* d0, d0p[0-3], d1, ... */ diff --git a/drivers/audio/es1370/pci_helper.c b/drivers/audio/es1370/pci_helper.c index 4c3ff124d..8707f10eb 100644 --- a/drivers/audio/es1370/pci_helper.c +++ b/drivers/audio/es1370/pci_helper.c @@ -4,8 +4,6 @@ #include #include -#include -#include #include diff --git a/drivers/audio/es1371/AC97.c b/drivers/audio/es1371/AC97.c index c6ac88da4..9ed7d622c 100644 --- a/drivers/audio/es1371/AC97.c +++ b/drivers/audio/es1371/AC97.c @@ -430,9 +430,7 @@ PRIVATE int AC97_get_volume(struct volume_level *level) { &(level->left), &(level->right), 0x1f, 1); break; case Speaker: - cmd = AC97_PC_BEEP_VOLUME; return EINVAL; - break; case Treble: cmd = AC97_MASTER_TONE; get_volume(&left, &right, cmd); @@ -464,7 +462,6 @@ PRIVATE int AC97_set_volume(struct volume_level *level) { break; case Dac: return EINVAL; - break; case Fm: cmd = AC97_PCM_OUT_VOLUME; convert(level->left, level->right, 0x1f, &left, &right, 0x1f, 0); @@ -482,17 +479,11 @@ PRIVATE int AC97_set_volume(struct volume_level *level) { convert(level->left, level->right, 0x1f, &left, &right, 0x1f, 1); break; case Speaker: - cmd = AC97_PC_BEEP_VOLUME; return EINVAL; - break; case Treble: - cmd = AC97_MASTER_TONE; return EINVAL; - break; case Bass: - cmd = AC97_MASTER_TONE; return EINVAL; - break; default: return EINVAL; } diff --git a/drivers/audio/es1371/pci_helper.c b/drivers/audio/es1371/pci_helper.c index f462211f1..50f7dabb2 100644 --- a/drivers/audio/es1371/pci_helper.c +++ b/drivers/audio/es1371/pci_helper.c @@ -4,8 +4,6 @@ #include #include -#include -#include #include diff --git a/drivers/audio/es1371/wait.c b/drivers/audio/es1371/wait.c index afe6bda3a..7c3497e89 100644 --- a/drivers/audio/es1371/wait.c +++ b/drivers/audio/es1371/wait.c @@ -1,25 +1,24 @@ #include "../../drivers.h" #include -#include #include "pci_helper.h" int WaitBitd (int paddr, int bitno, int state, long tmout) { -unsigned long val, mask; + unsigned long mask; mask = 1UL << bitno; tmout *= 5000; if(state) { while(tmout-- > 0) { - if((val = pci_inl(paddr)) & mask) { + if(pci_inl(paddr) & mask) { return 0; } } } else { while(tmout-- > 0) { - if(!((val = pci_inl(paddr)) & mask)) { + if(!(pci_inl(paddr) & mask)) { return 0; } } diff --git a/drivers/audio/framework/audio_fw.c b/drivers/audio/framework/audio_fw.c index 50bacc235..743002cb6 100644 --- a/drivers/audio/framework/audio_fw.c +++ b/drivers/audio/framework/audio_fw.c @@ -576,7 +576,6 @@ PRIVATE void msg_read(message *m_ptr) PRIVATE void msg_hardware(void) { u32_t i; - int j = 0; dprint("%s: handling hardware message\n", drv.DriverName); @@ -659,7 +658,6 @@ PRIVATE void msg_sig_stop(void) PRIVATE void handle_int_write(int sub_dev_nr) { sub_dev_t *sub_dev_ptr; - int r; sub_dev_ptr = &sub_dev[sub_dev_nr]; @@ -710,7 +708,7 @@ PRIVATE void handle_int_write(int sub_dev_nr) drv_reenable_int(sub_dev_nr); #if 0 /* reenable irq_hook*/ - if ((r=sys_irqenable(&irq_hook_id)) != OK) { + if (sys_irqenable(&irq_hook_id != OK) { error("%s Couldn't enable IRQ\n", drv.DriverName); } #endif @@ -720,7 +718,7 @@ PRIVATE void handle_int_write(int sub_dev_nr) /* handle interrupt for specified sub device; DmaMode == DEV_READ_S */ PRIVATE void handle_int_read(int sub_dev_nr) { - sub_dev_t *sub_dev_ptr; int r,i; + sub_dev_t *sub_dev_ptr; sub_dev_ptr = &sub_dev[sub_dev_nr]; @@ -765,7 +763,7 @@ PRIVATE void handle_int_read(int sub_dev_nr) #if 0 /* reenable irq_hook*/ - if ((r=sys_irqenable(&irq_hook_id)) != OK) { + if (sys_irqenable(&irq_hook_id) != OK) { error("%s: Couldn't reenable IRQ", drv.DriverName); } #endif @@ -773,7 +771,7 @@ PRIVATE void handle_int_read(int sub_dev_nr) PRIVATE int get_started(sub_dev_t *sub_dev_ptr) { - u32_t i;char c; + u32_t i; /* enable interrupt messages from MINIX */ if ((i=sys_irqenable(&irq_hook_id)) != OK) { diff --git a/drivers/audio/sb16/sb16.c b/drivers/audio/sb16/sb16.c index 6329ad60a..0cfe34ce9 100644 --- a/drivers/audio/sb16/sb16.c +++ b/drivers/audio/sb16/sb16.c @@ -73,7 +73,7 @@ PUBLIC int drv_init(void) { PUBLIC int drv_init_hw(void) { - int i, s; + int i; int DspVersion[2]; dprint("drv_init_hw():\n"); @@ -413,7 +413,7 @@ PRIVATE int dsp_get_max_frag_size(u32_t *val, int *len) { PUBLIC int dsp_command(int value) { - int i, status; + int i; for (i = 0; i < SB_TIMEOUT; i++) { if((sb16_inb(DSP_STATUS) & 0x80) == 0) { diff --git a/drivers/bios_wini/bios_wini.c b/drivers/bios_wini/bios_wini.c index a62650e86..cbd615d86 100644 --- a/drivers/bios_wini/bios_wini.c +++ b/drivers/bios_wini/bios_wini.c @@ -523,11 +523,9 @@ struct partition *entry; /*============================================================================* * w_other * *============================================================================*/ -PRIVATE int w_other(dr, m) -struct driver *dr; -message *m; +PRIVATE int w_other(struct driver *dr, message *m) { - int r, timeout, prev; + int r; if (m->m_type != DEV_IOCTL_S ) return EINVAL; diff --git a/drivers/dp8390/dp8390.c b/drivers/dp8390/dp8390.c index bedede9c9..b9a2a8e48 100644 --- a/drivers/dp8390/dp8390.c +++ b/drivers/dp8390/dp8390.c @@ -1502,8 +1502,6 @@ size_t offset; size_t size; void *dst; { - int r; - offset = page * DP_PAGESIZE + offset; memcpy(dst, dep->de_locmem + offset, size); @@ -1636,7 +1634,7 @@ vir_bytes offset; int nic_addr; vir_bytes count; { - vir_bytes vir_hw, vir_user; + vir_bytes vir_hw; int bytes, i, r; vir_hw = (vir_bytes)dep->de_locmem + nic_addr; @@ -1684,7 +1682,7 @@ vir_bytes offset; int nic_addr; vir_bytes count; { - vir_bytes vir_hw, vir_user; + vir_bytes vir_hw; int bytes, i, r; vir_hw = (vir_bytes)dep->de_locmem + nic_addr; @@ -1735,7 +1733,6 @@ vir_bytes offset; int nic_addr; vir_bytes count; { - phys_bytes phys_user; int bytes, i; outb_reg0(dep, DP_ISR, ISR_RDC); @@ -1794,7 +1791,6 @@ vir_bytes offset; int nic_addr; vir_bytes count; { - phys_bytes phys_user; int bytes, i, r; outb_reg0(dep, DP_ISR, ISR_RDC); @@ -2084,10 +2080,9 @@ iovec_dat_t *iovp; vir_bytes offset; vir_bytes count; { - vir_bytes vir_hw, vir_user; int bytes, i, r; - vir_hw = (vir_bytes)dep->de_locmem + nic_addr; + vir_bytes vir_hw = (vir_bytes) (dep->de_locmem + nic_addr); i= 0; while (count > 0) @@ -2132,7 +2127,7 @@ iovec_dat_s_t *iovp; vir_bytes offset; vir_bytes count; { - vir_bytes vir_hw, vir_user; + vir_bytes vir_hw; int bytes, i, r; vir_hw = (vir_bytes)dep->de_locmem + nic_addr; @@ -2181,7 +2176,6 @@ iovec_dat_t *iovp; vir_bytes offset; vir_bytes count; { - phys_bytes phys_user; int bytes, i; outb_reg0(dep, DP_RBCR0, count & 0xFF); @@ -2228,7 +2222,6 @@ iovec_dat_s_t *iovp; vir_bytes offset; vir_bytes count; { - phys_bytes phys_user; int bytes, i, r; outb_reg0(dep, DP_RBCR0, count & 0xFF); diff --git a/drivers/dpeth/dp.c b/drivers/dpeth/dp.c index c8ca4ea2c..8b5be293d 100644 --- a/drivers/dpeth/dp.c +++ b/drivers/dpeth/dp.c @@ -676,7 +676,6 @@ PRIVATE void sef_local_startup() PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info) { /* Initialize the dpeth driver. */ - dpeth_t *dep; int rc, fkeys, sfkeys, tasknr; (progname=strrchr(env_argv[0],'/')) ? progname++ : (progname=env_argv[0]); diff --git a/drivers/dpeth/netbuff.c b/drivers/dpeth/netbuff.c index 91cf20f2c..5003c7ee2 100644 --- a/drivers/dpeth/netbuff.c +++ b/drivers/dpeth/netbuff.c @@ -109,7 +109,6 @@ PUBLIC void init_buff(dpeth_t *dep, buff_t **tx_buff) */ PUBLIC void mem2user(dpeth_t *dep, buff_t *rxbuff) { - phys_bytes phys_user; int bytes, ix = 0; iovec_dat_s_t *iovp = &dep->de_read_iovec; int r, pktsize = rxbuff->size; @@ -142,7 +141,6 @@ PUBLIC void mem2user(dpeth_t *dep, buff_t *rxbuff) */ PUBLIC void user2mem(dpeth_t *dep, buff_t *txbuff) { - phys_bytes phys_user; int bytes, ix = 0; iovec_dat_s_t *iovp = &dep->de_write_iovec; int r, pktsize = txbuff->size; diff --git a/drivers/e1000/e1000.c b/drivers/e1000/e1000.c index 0734461af..c85882cb4 100644 --- a/drivers/e1000/e1000.c +++ b/drivers/e1000/e1000.c @@ -31,7 +31,7 @@ PRIVATE u16_t pcitab_e1000[] = PRIVATE char *progname; PRIVATE e1000_t e1000_table[E1000_PORT_NR]; -_PROTOTYPE( PRIVATE int e1000_init, (message *mp) ); +_PROTOTYPE( PRIVATE void e1000_init, (message *mp) ); _PROTOTYPE( PRIVATE void e1000_init_pci, (void) ); _PROTOTYPE( PRIVATE int e1000_probe, (e1000_t *e) ); _PROTOTYPE( PRIVATE int e1000_init_hw, (e1000_t *e) ); @@ -177,8 +177,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info) /*===========================================================================* * e1000_init * *===========================================================================*/ -PRIVATE int e1000_init(mp) -message *mp; +PRIVATE void e1000_init(message *mp) { static int first_time = 1; message reply_mess; @@ -235,14 +234,13 @@ PRIVATE void e1000_init_pci() /*===========================================================================* * e1000_probe * *===========================================================================*/ -PRIVATE int e1000_probe(e) -e1000_t *e; +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; - char *dname, *str; + char *dname; E1000_DEBUG(3, ("%s: probe()\n", e->name)); @@ -868,7 +866,6 @@ message *mp; PRIVATE void e1000_signal(void) { sigset_t sigset; - int sig; E1000_DEBUG(3, ("e1000: signal()\n")); diff --git a/drivers/filter/driver.c b/drivers/filter/driver.c index 86c577a69..c4e9899c4 100644 --- a/drivers/filter/driver.c +++ b/drivers/filter/driver.c @@ -850,7 +850,6 @@ static int paired_grant(char *buf1, char *buf2, int request, { /* Create memory grants, either to one or to both drivers. */ - cp_grant_id_t gid; int count, access; count = 0; @@ -869,6 +868,7 @@ static int paired_grant(char *buf1, char *buf2, int request, vectors[1], &sizes[1]); } } + return count; } /*===========================================================================*