From: Kees van Reeuwijk Date: Thu, 1 Apr 2010 12:51:31 +0000 (+0000) Subject: Lots of const correctness, other cleanup. X-Git-Tag: v3.1.7~184 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/rndc.conf.html?a=commitdiff_plain;h=c3f649557e8a5786cad70763c28c3a079c112f7c;p=minix.git Lots of const correctness, other cleanup. --- diff --git a/drivers/amddev/amddev.c b/drivers/amddev/amddev.c index d95e4c043..97e7a3fec 100644 --- a/drivers/amddev/amddev.c +++ b/drivers/amddev/amddev.c @@ -55,7 +55,7 @@ static u32_t read_reg(int function, int index); static void write_reg(int function, int index, u32_t value); static void init_domain(int index); static void init_map(unsigned int ix); -static int do_add4pci(message *m); +static int do_add4pci(const message *m); static void add_range(phys_bytes busaddr, phys_bytes size); static void del_range(phys_bytes busaddr, phys_bytes size); static void report_exceptions(void); @@ -114,7 +114,7 @@ PRIVATE void sef_local_startup() /*===========================================================================* * sef_cb_init_fresh * *===========================================================================*/ -PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info) +PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info)) { /* Initialize the amddev driver. */ int r, n_maps, n_domains, revision; @@ -369,7 +369,7 @@ static int do_add(message *m) -static int do_add4pci(message *m) +static int do_add4pci(const message *m) { int r, pci_bus, pci_dev, pci_func; endpoint_t proc; diff --git a/drivers/at_wini/at_wini.c b/drivers/at_wini/at_wini.c index a92206cf9..5c4195cde 100644 --- a/drivers/at_wini/at_wini.c +++ b/drivers/at_wini/at_wini.c @@ -253,7 +253,7 @@ PRIVATE void sef_local_startup() /*===========================================================================* * sef_cb_init_fresh * *===========================================================================*/ -PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info) +PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) { /* Initialize the at_wini driver. */ system_hz = sys_hz(); @@ -1017,7 +1017,7 @@ PRIVATE int w_specify() /*===========================================================================* * do_transfer * *===========================================================================*/ -PRIVATE int do_transfer(struct wini *wn, unsigned int precomp, +PRIVATE int do_transfer(const struct wini *wn, unsigned int precomp, unsigned int count, unsigned int sector, unsigned int opcode, int do_dma) { @@ -1090,7 +1090,7 @@ PRIVATE int do_transfer(struct wini *wn, unsigned int precomp, return com_out(&cmd); } -PRIVATE void stop_dma(struct wini *wn) +PRIVATE void stop_dma(const struct wini *wn) { int r; @@ -1099,7 +1099,7 @@ PRIVATE void stop_dma(struct wini *wn) if (r != 0) panic("stop_dma: sys_outb failed: %d", r); } -PRIVATE void start_dma(struct wini *wn, int do_write) +PRIVATE void start_dma(const struct wini *wn, int do_write) { u32_t v; int r; @@ -1115,7 +1115,7 @@ PRIVATE void start_dma(struct wini *wn, int do_write) if (r != 0) panic("start_dma: sys_outb failed: %d", r); } -PRIVATE int error_dma(struct wini *wn) +PRIVATE int error_dma(const struct wini *wn) { int r; u32_t v; diff --git a/drivers/atl2/atl2.c b/drivers/atl2/atl2.c index b20d47949..0941b8d64 100644 --- a/drivers/atl2/atl2.c +++ b/drivers/atl2/atl2.c @@ -754,7 +754,7 @@ PRIVATE void atl2_reply(void) /*===========================================================================* * atl2_readv * *===========================================================================*/ -PRIVATE void atl2_readv(message *m, int from_int) +PRIVATE void atl2_readv(const message *m, int from_int) { /* Read packet data. */ @@ -860,7 +860,7 @@ suspend: /*===========================================================================* * atl2_writev * *===========================================================================*/ -PRIVATE void atl2_writev(message *m, int from_int) +PRIVATE void atl2_writev(const message *m, int from_int) { /* Write packet data. */ @@ -988,7 +988,7 @@ suspend: /*===========================================================================* * atl2_intr * *===========================================================================*/ -PRIVATE void atl2_intr(message *m) +PRIVATE void atl2_intr(const message *m) { /* Interrupt received. */ @@ -1206,7 +1206,7 @@ PRIVATE void atl2_dump(void) /*===========================================================================* * sef_cb_init_fresh * *===========================================================================*/ -PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info) +PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info)) { /* Initialize the atl2 driver. */ diff --git a/drivers/audio/common/audio_fw.c b/drivers/audio/common/audio_fw.c index e4d83e71e..c5daec183 100644 --- a/drivers/audio/common/audio_fw.c +++ b/drivers/audio/common/audio_fw.c @@ -49,8 +49,8 @@ FORWARD _PROTOTYPE( int msg_open, (int minor_dev_nr) ); FORWARD _PROTOTYPE( int msg_close, (int minor_dev_nr) ); -FORWARD _PROTOTYPE( int msg_ioctl, (message *m_ptr) ); -FORWARD _PROTOTYPE( void msg_write, (message *m_ptr) ); +FORWARD _PROTOTYPE( int msg_ioctl, (const message *m_ptr) ); +FORWARD _PROTOTYPE( void msg_write, (const message *m_ptr) ); FORWARD _PROTOTYPE( void msg_read, (message *m_ptr) ); FORWARD _PROTOTYPE( void msg_hardware, (void) ); FORWARD _PROTOTYPE( void msg_status, (message *m_ptr) ); @@ -229,16 +229,16 @@ PRIVATE int init_driver(void) { /* initialize hardware*/ if (drv_init_hw() != OK) { - error("%s: Could not initialize hardware\n", drv.DriverName, 0); + error("%s: Could not initialize hardware\n", drv.DriverName); return EIO; } /* get irq from device driver...*/ if (drv_get_irq(&irq) != OK) { - error("%s: init driver couldn't get IRQ", drv.DriverName, i); + error("%s: init driver couldn't get IRQ", drv.DriverName); return EIO; } - /* todo: execute the rest of this function only once + /* TODO: execute the rest of this function only once we don't want to set irq policy twice */ if (executed) return OK; executed = TRUE; @@ -432,7 +432,7 @@ PRIVATE int close_sub_dev(int sub_dev_nr) { } -PRIVATE int msg_ioctl(message *m_ptr) +PRIVATE int msg_ioctl(const message *m_ptr) { int status, len, chan; sub_dev_t *sub_dev_ptr; @@ -495,7 +495,7 @@ PRIVATE int msg_ioctl(message *m_ptr) } -PRIVATE void msg_write(message *m_ptr) +PRIVATE void msg_write(const message *m_ptr) { int chan; sub_dev_t *sub_dev_ptr; special_file_t* special_file_ptr; diff --git a/drivers/audio/es1370/es1370.c b/drivers/audio/es1370/es1370.c index bcef008e2..3832f6662 100644 --- a/drivers/audio/es1370/es1370.c +++ b/drivers/audio/es1370/es1370.c @@ -24,7 +24,7 @@ /* reg(n) will be the device specific addresses */ -#define reg(n) dev.base + n +#define reg(n) (dev.base + (n)) /* prototypes of private functions */ diff --git a/drivers/audio/es1371/AC97.c b/drivers/audio/es1371/AC97.c index 9ed7d622c..276476d6f 100644 --- a/drivers/audio/es1371/AC97.c +++ b/drivers/audio/es1371/AC97.c @@ -9,15 +9,15 @@ FORWARD _PROTOTYPE( int AC97_read, (DEV_STRUCT * pCC, u16_t wAddr, u16_t *data) ); FORWARD _PROTOTYPE( int AC97_write, - (DEV_STRUCT * pCC, u16_t wAddr, u16_t wData) ); + (const DEV_STRUCT * pCC, u16_t wAddr, u16_t wData) ); FORWARD _PROTOTYPE( void set_src_sync_state, (int state) ); FORWARD _PROTOTYPE( int AC97_write_unsynced, - (DEV_STRUCT * pCC, u16_t wAddr, u16_t wData) ); + (const DEV_STRUCT * pCC, u16_t wAddr, u16_t wData) ); FORWARD _PROTOTYPE( int AC97_read_unsynced, - (DEV_STRUCT * pCC, u16_t wAddr, u16_t *data) ); + (const DEV_STRUCT * pCC, u16_t wAddr, u16_t *data) ); FORWARD _PROTOTYPE( void set_nice_volume, (void) ); FORWARD _PROTOTYPE( int AC97_get_volume, (struct volume_level *level) ); -FORWARD _PROTOTYPE( int AC97_set_volume, (struct volume_level *level) ); +FORWARD _PROTOTYPE( int AC97_set_volume, (const struct volume_level *level) ); @@ -69,7 +69,7 @@ PRIVATE void set_src_sync_state (int state) } -PRIVATE int AC97_write (DEV_STRUCT * pCC, u16_t wAddr, u16_t wData) +PRIVATE int AC97_write (const DEV_STRUCT * pCC, u16_t wAddr, u16_t wData) { u32_t dtemp, i; u16_t wBaseAddr = pCC->base; @@ -206,7 +206,8 @@ u16_t base = pCC->base; } -PRIVATE int AC97_write_unsynced (DEV_STRUCT * pCC, u16_t wAddr, u16_t wData) +PRIVATE int AC97_write_unsynced (const DEV_STRUCT * pCC, u16_t wAddr, + u16_t wData) { /* wait for WIP to go away */ if (WaitBitd (pCC->base + CODEC_READ, 30, 0, WIP_TIMEOUT)) @@ -218,7 +219,8 @@ PRIVATE int AC97_write_unsynced (DEV_STRUCT * pCC, u16_t wAddr, u16_t wData) } -PRIVATE int AC97_read_unsynced (DEV_STRUCT * pCC, u16_t wAddr, u16_t *data) +PRIVATE int AC97_read_unsynced (const DEV_STRUCT * pCC, u16_t wAddr, + u16_t *data) { u32_t dtemp; @@ -450,7 +452,7 @@ PRIVATE int AC97_get_volume(struct volume_level *level) { } -PRIVATE int AC97_set_volume(struct volume_level *level) { +PRIVATE int AC97_set_volume(const struct volume_level *level) { int cmd; int left; int right; diff --git a/drivers/audio/es1371/sample_rate_converter.c b/drivers/audio/es1371/sample_rate_converter.c index 8622983c9..1d74df510 100644 --- a/drivers/audio/es1371/sample_rate_converter.c +++ b/drivers/audio/es1371/sample_rate_converter.c @@ -34,9 +34,9 @@ -FORWARD _PROTOTYPE( int src_reg_read, (DEV_STRUCT * DSP, +FORWARD _PROTOTYPE( int src_reg_read, (const DEV_STRUCT * DSP, u16_t reg, u16_t *data) ); -FORWARD _PROTOTYPE( int src_reg_write, (DEV_STRUCT * DSP, +FORWARD _PROTOTYPE( int src_reg_write, (const DEV_STRUCT * DSP, u16_t reg, u16_t val) ); @@ -104,7 +104,7 @@ int src_init ( DEV_STRUCT * DSP ) { } -PRIVATE int src_reg_read(DEV_STRUCT * DSP, u16_t reg, u16_t *data) { +PRIVATE int src_reg_read(const DEV_STRUCT * DSP, u16_t reg, u16_t *data) { u32_t dtemp; /* wait for ready */ @@ -130,7 +130,7 @@ PRIVATE int src_reg_read(DEV_STRUCT * DSP, u16_t reg, u16_t *data) { } -PRIVATE int src_reg_write(DEV_STRUCT * DSP, u16_t reg, u16_t val) { +PRIVATE int src_reg_write(const DEV_STRUCT * DSP, u16_t reg, u16_t val) { u32_t dtemp; /* wait for ready */ diff --git a/drivers/audio/sb16/sb16.c b/drivers/audio/sb16/sb16.c index e1bcce4c7..0e6f49463 100644 --- a/drivers/audio/sb16/sb16.c +++ b/drivers/audio/sb16/sb16.c @@ -429,12 +429,13 @@ PUBLIC int dsp_command(int value) { PUBLIC int sb16_inb(int port) { - int s, value = -1; + int s; + unsigned long value; if ((s=sys_inb(port, &value)) != OK) panic("sys_inb() failed: %d", s); - return value; + return (int) value; } diff --git a/drivers/bios_wini/bios_wini.c b/drivers/bios_wini/bios_wini.c index dde0e9372..2ac72d9be 100644 --- a/drivers/bios_wini/bios_wini.c +++ b/drivers/bios_wini/bios_wini.c @@ -126,7 +126,7 @@ PRIVATE void sef_local_startup() /*===========================================================================* * sef_cb_init_fresh * *===========================================================================*/ -PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info) +PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info)) { /* Initialize the bios_wini driver. */ long v; diff --git a/drivers/dec21140A/dec21140A.c b/drivers/dec21140A/dec21140A.c index a0c16b6aa..1feccf415 100644 --- a/drivers/dec21140A/dec21140A.c +++ b/drivers/dec21140A/dec21140A.c @@ -27,26 +27,26 @@ _PROTOTYPE( PRIVATE u32_t io_inl, (u16_t); ); _PROTOTYPE( PRIVATE void io_outl, (u16_t, u32_t); ); -_PROTOTYPE( PRIVATE void do_conf, (message *); ); +_PROTOTYPE( PRIVATE void do_conf, (const message *); ); _PROTOTYPE( PRIVATE void do_get_name, (message *); ); _PROTOTYPE( PRIVATE void do_get_stat_s, (message *); ); _PROTOTYPE( PRIVATE void do_interrupt, (dpeth_t *); ); _PROTOTYPE( PRIVATE void do_reply, (dpeth_t *, int, int); ); -_PROTOTYPE( PRIVATE void do_vread_s, (message *, int); ); +_PROTOTYPE( PRIVATE void do_vread_s, (const message *, int); ); _PROTOTYPE( PRIVATE void do_watchdog, (void *); ); _PROTOTYPE( PRIVATE void de_update_conf, (dpeth_t *); ); _PROTOTYPE( PRIVATE int de_probe, (dpeth_t *); ); _PROTOTYPE( PRIVATE void de_conf_addr, (dpeth_t *); ); _PROTOTYPE( PRIVATE void de_first_init, (dpeth_t *); ); -_PROTOTYPE( PRIVATE void de_reset, (dpeth_t *); ); -_PROTOTYPE( PRIVATE void de_hw_conf, (dpeth_t *); ); -_PROTOTYPE( PRIVATE void de_start, (dpeth_t *); ); +_PROTOTYPE( PRIVATE void de_reset, (const dpeth_t *); ); +_PROTOTYPE( PRIVATE void de_hw_conf, (const dpeth_t *); ); +_PROTOTYPE( PRIVATE void de_start, (const dpeth_t *); ); _PROTOTYPE( PRIVATE void de_setup_frame, (dpeth_t *); ); _PROTOTYPE( PRIVATE u16_t de_read_rom, (dpeth_t *, u8_t, u8_t); ); _PROTOTYPE( PRIVATE int de_calc_iov_size, (iovec_dat_s_t *); ); _PROTOTYPE( PRIVATE void de_next_iov, (iovec_dat_s_t *); ); -_PROTOTYPE( PRIVATE void do_vwrite_s, (message *, int); ); +_PROTOTYPE( PRIVATE void do_vwrite_s, (const message *, int); ); _PROTOTYPE( PRIVATE void de_get_userdata_s, (int, cp_grant_id_t, vir_bytes, int, void *); ); @@ -151,7 +151,7 @@ PRIVATE void sef_local_startup() /*===========================================================================* * sef_cb_init_fresh * *===========================================================================*/ -PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info) +PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info)) { /* Initialize the DEC 21140A driver. */ int r; @@ -161,7 +161,8 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info) (progname=strrchr(env_argv[0],'/')) ? progname++ : (progname=env_argv[0]); /* Request function key for debug dumps */ - fkeys = sfkeys = 0; bit_set(sfkeys, DE_FKEY); + fkeys = sfkeys = 0; + bit_set(sfkeys, DE_FKEY); if ((fkey_map(&fkeys, &sfkeys)) != OK) printf("%s: error using Shift+F%d key(%d)\n", str_DevName, DE_FKEY, errno); @@ -187,9 +188,9 @@ PRIVATE void do_get_stat_s(message * mp) dep = &de_table[port]; dep->de_client = mp->DL_PROC; - if ((rc = sys_safecopyto(mp->DL_PROC, mp->DL_GRANT, 0, + if ((rc = sys_safecopyto(mp->DL_PROC, mp->DL_GRANT, 0UL, (vir_bytes)&dep->de_stat, - (vir_bytes) sizeof(dep->de_stat), 0)) != OK) + sizeof(dep->de_stat), 0)) != OK) panic(str_CopyErrMsg, rc); mp->m_type = DL_STAT_REPLY; @@ -201,13 +202,12 @@ PRIVATE void do_get_stat_s(message * mp) return; } -PRIVATE void do_conf(message * mp) +PRIVATE void do_conf(const message * mp) { - int port; + int port = mp->DL_PORT; dpeth_t *dep; message reply_mess; - port = mp->DL_PORT; if (port >= 0 && port < DE_PORT_NR) { dep = &de_table[port]; @@ -258,13 +258,17 @@ PRIVATE void do_conf(message * mp) default: break; } - } else /* Port number is out of range */ + } else { /* Port number is out of range */ port = ENXIO; + } reply_mess.m_type = DL_CONF_REPLY; reply_mess.m3_i1 = port; reply_mess.m3_i2 = DE_PORT_NR; - *(ether_addr_t *) reply_mess.m3_ca1 = dep->de_address; + /* FIXME: if port number is out of range, this uses + * uninitialized variable 'dep'. + */ + *(ether_addr_t *) reply_mess.m3_ca1 = dep->de_address; if (send(mp->m_source, &reply_mess) != OK) panic(str_SendErrMsg, mp->m_source); @@ -314,7 +318,7 @@ PRIVATE void do_reply(dpeth_t * dep, int err, int may_block) return; } -PRIVATE void do_watchdog(void *message) +PRIVATE void do_watchdog(void *UNUSED(message)) { /* nothing here yet */ return; @@ -383,7 +387,7 @@ PRIVATE int de_probe(dpeth_t *dep){ return TRUE; } -PRIVATE u16_t de_read_rom(dpeth_t *dep, u8_t addr, u8_t nbAddrBits){ +PRIVATE u16_t de_read_rom(const dpeth_t *dep, u8_t addr, u8_t nbAddrBits){ u16_t retVal = 0; int i; u32_t csr = 0; @@ -455,7 +459,7 @@ static void de_update_conf(dpeth_t * dep) return; } -PRIVATE void do_vread_s(message * mp, int from_int) +PRIVATE void do_vread_s(const message * mp, int from_int) { char *buffer; u32_t size; @@ -725,11 +729,11 @@ PRIVATE void do_interrupt(dpeth_t *dep){ return; } -PRIVATE void de_reset(dpeth_t *dep){ +PRIVATE void de_reset(const dpeth_t *dep){ io_outl(CSR_ADDR(dep, CSR0), CSR0_SWR); } -PRIVATE void de_hw_conf(dpeth_t *dep){ +PRIVATE void de_hw_conf(const dpeth_t *dep){ u32_t val; /* CSR0 - global host bus prop */ @@ -754,7 +758,7 @@ PRIVATE void de_hw_conf(dpeth_t *dep){ io_outl(CSR_ADDR(dep, CSR6), val); } -PRIVATE void de_start(dpeth_t *dep){ +PRIVATE void de_start(const dpeth_t *dep){ u32_t val; val = io_inl(CSR_ADDR(dep, CSR6)) | CSR6_ST | CSR6_SR; io_outl(CSR_ADDR(dep, CSR6), val); @@ -829,10 +833,10 @@ PRIVATE void de_next_iov(iovec_dat_s_t * iovp){ return; } -PRIVATE void do_vwrite_s(message * mp, int from_int){ +PRIVATE void do_vwrite_s(const message * mp, int from_int){ static u8_t setupDone = 0; int size, r, bytes, ix, totalsize; - dpeth_t *dep = NULL; + dpeth_t *dep; iovec_dat_s_t *iovp = NULL; de_loc_descr_t *descr = NULL; char *buffer = NULL; diff --git a/drivers/dp8390/dp8390.c b/drivers/dp8390/dp8390.c index 0413133b1..ab2f419eb 100644 --- a/drivers/dp8390/dp8390.c +++ b/drivers/dp8390/dp8390.c @@ -309,7 +309,7 @@ PRIVATE void sef_local_startup() /*===========================================================================* * sef_cb_init_fresh * *===========================================================================*/ -PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info) +PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info)) { /* Initialize the dp8390 driver. */ int i, r, tasknr; diff --git a/drivers/dpeth/3c501.c b/drivers/dpeth/3c501.c index e5556fefb..e81c4d542 100644 --- a/drivers/dpeth/3c501.c +++ b/drivers/dpeth/3c501.c @@ -70,7 +70,7 @@ static void el1_reset(dpeth_t * dep) ** Name: void el1_dumpstats(dpeth_t *dep, int port, vir_bytes size) ** Function: Dumps counter on screen (support for console display). */ -static void el1_dumpstats(dpeth_t * dep) +static void el1_dumpstats(dpeth_t * UNUSED(dep)) { return; diff --git a/drivers/dpeth/3c509.c b/drivers/dpeth/3c509.c index 9811537ba..1b6d947c9 100644 --- a/drivers/dpeth/3c509.c +++ b/drivers/dpeth/3c509.c @@ -105,7 +105,7 @@ static void el3_rx_mode(dpeth_t * dep) ** Name: void el3_reset(dpeth_t *dep) ** Function: Reset function specific for Etherlink hardware. */ -static void el3_reset(dpeth_t * dep) +static void el3_reset(dpeth_t * UNUSED(dep)) { return; /* Done */ diff --git a/drivers/dpeth/8390.c b/drivers/dpeth/8390.c index d5e292627..51a200466 100644 --- a/drivers/dpeth/8390.c +++ b/drivers/dpeth/8390.c @@ -42,7 +42,7 @@ static char RdmaErrMsg[] = "remote dma failed to complete"; ** Name: void ns_rw_setup(dpeth_t *dep, int mode, int size, u16_t offset); ** Function: Sets the board for reading/writing. */ -static void ns_rw_setup(dpeth_t *dep, int mode, int size, u16_t offset) +static void ns_rw_setup(const dpeth_t *dep, int mode, int size, u16_t offset) { if (mode == CR_DM_RW) outb_reg0(dep, DP_ISR, ISR_RDC); @@ -59,7 +59,7 @@ static void ns_rw_setup(dpeth_t *dep, int mode, int size, u16_t offset) ** Name: void ns_start_xmit(dpeth_t *dep, int size, int pageno); ** Function: Sets the board for for transmitting and fires it. */ -static void ns_start_xmit(dpeth_t * dep, int size, int pageno) +static void ns_start_xmit(const dpeth_t * dep, int size, int pageno) { outb_reg0(dep, DP_TPSR, pageno); diff --git a/drivers/sb16/dsp/sb16_dsp.c b/drivers/sb16/dsp/sb16_dsp.c index 7e9a1bf41..f71bf51b6 100644 --- a/drivers/sb16/dsp/sb16_dsp.c +++ b/drivers/sb16/dsp/sb16_dsp.c @@ -31,8 +31,8 @@ _PROTOTYPE(void main, (void)); FORWARD _PROTOTYPE( int dsp_open, (void) ); FORWARD _PROTOTYPE( int dsp_close, (void) ); -FORWARD _PROTOTYPE( int dsp_ioctl, (message *m_ptr) ); -FORWARD _PROTOTYPE( void dsp_write, (message *m_ptr) ); +FORWARD _PROTOTYPE( int dsp_ioctl, (const message *m_ptr) ); +FORWARD _PROTOTYPE( void dsp_write, (const message *m_ptr) ); FORWARD _PROTOTYPE( void dsp_hardware_msg, (void) ); FORWARD _PROTOTYPE( void dsp_status, (message *m_ptr) ); @@ -90,7 +90,9 @@ PUBLIC int is_status_msg_expected = FALSE; *===========================================================================*/ PUBLIC void main() { - int r, caller, proc_nr; + int r; + endpoint_t caller; + int proc_nr; message mess; /* SEF local startup. */ @@ -143,7 +145,7 @@ send_reply: /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup() +PRIVATE void sef_local_startup(void) { /* Register init callbacks. */ sef_setcb_init_fresh(sef_cb_init_fresh); @@ -162,7 +164,7 @@ PRIVATE void sef_local_startup() /*===========================================================================* * sef_cb_init_fresh * *===========================================================================*/ -PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info) +PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) { /* Initialize the rtl8169 driver. */ unsigned left; @@ -172,7 +174,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info) */ #if (CHIP == INTEL) DmaPtr = DmaBuffer; - sys_umap(SELF, D, (vir_bytes)DmaBuffer, (phys_bytes)sizeof(DmaBuffer), &DmaPhys); + sys_umap(SELF, D, (vir_bytes)DmaBuffer, sizeof(DmaBuffer), &DmaPhys); if((left = dma_bytes_left(DmaPhys)) < DMA_SIZE) { /* First half of buffer crosses a 64K boundary, can't DMA into that */ @@ -189,7 +191,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info) /*===========================================================================* * dsp_open *===========================================================================*/ -PRIVATE int dsp_open() +PRIVATE int dsp_open(void) { dprint("sb16_dsp.c: dsp_open()\n"); @@ -218,7 +220,7 @@ PRIVATE int dsp_open() /*===========================================================================* * dsp_close *===========================================================================*/ -PRIVATE int dsp_close() +PRIVATE int dsp_close(void) { dprint("sb16_dsp.c: dsp_close()\n"); @@ -231,10 +233,9 @@ PRIVATE int dsp_close() /*===========================================================================* * dsp_ioctl *===========================================================================*/ -PRIVATE int dsp_ioctl(message *m_ptr) +PRIVATE int dsp_ioctl(const message *m_ptr) { int status; - phys_bytes user_phys; unsigned int val; dprint("sb16_dsp.c: dsp_ioctl()\n"); @@ -271,9 +272,8 @@ PRIVATE int dsp_ioctl(message *m_ptr) /*===========================================================================* * dsp_write *===========================================================================*/ -PRIVATE void dsp_write(message *m_ptr) +PRIVATE void dsp_write(const message *m_ptr) { - int s; message mess; dprint("sb16_dsp.c: dsp_write()\n"); @@ -485,7 +485,7 @@ PRIVATE int dsp_reset() *===========================================================================*/ PRIVATE 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/sb16/mixer/sb16_mixer.c b/drivers/sb16/mixer/sb16_mixer.c index c3724c828..e64d1bf36 100644 --- a/drivers/sb16/mixer/sb16_mixer.c +++ b/drivers/sb16/mixer/sb16_mixer.c @@ -26,13 +26,13 @@ _PROTOTYPE(void main, (void)); FORWARD _PROTOTYPE( int mixer_init, (void)); -FORWARD _PROTOTYPE( int mixer_open, (message *m_ptr)); -FORWARD _PROTOTYPE( int mixer_close, (message *m_ptr)); -FORWARD _PROTOTYPE( int mixer_ioctl, (message *m_ptr)); +FORWARD _PROTOTYPE( int mixer_open, (const message *m_ptr)); +FORWARD _PROTOTYPE( int mixer_close, (const message *m_ptr)); +FORWARD _PROTOTYPE( int mixer_ioctl, (const message *m_ptr)); FORWARD _PROTOTYPE( int mixer_get, (int reg)); -FORWARD _PROTOTYPE( int get_set_volume, (message *m_ptr, int flag)); -FORWARD _PROTOTYPE( int get_set_input, (message *m_ptr, int flag, int channel)); -FORWARD _PROTOTYPE( int get_set_output, (message *m_ptr, int flag)); +FORWARD _PROTOTYPE( int get_set_volume, (const message *m_ptr, int flag)); +FORWARD _PROTOTYPE( int get_set_input, (const message *m_ptr, int flag, int channel)); +FORWARD _PROTOTYPE( int get_set_output, (const message *m_ptr, int flag)); PRIVATE int mixer_avail = 0; /* Mixer exists? */ @@ -109,7 +109,7 @@ PRIVATE void sef_local_startup() /*=========================================================================* * mixer_open *=========================================================================*/ -PRIVATE int mixer_open(message *m_ptr) +PRIVATE int mixer_open(const message *m_ptr) { dprint("mixer_open\n"); @@ -123,7 +123,7 @@ PRIVATE int mixer_open(message *m_ptr) /*=========================================================================* * mixer_close *=========================================================================*/ -PRIVATE int mixer_close(message *m_ptr) +PRIVATE int mixer_close(const message *m_ptr) { dprint("mixer_close\n"); @@ -134,7 +134,7 @@ PRIVATE int mixer_close(message *m_ptr) /*=========================================================================* * mixer_ioctl *=========================================================================*/ -PRIVATE int mixer_ioctl(message *m_ptr) +PRIVATE int mixer_ioctl(const message *m_ptr) { int status; @@ -198,10 +198,9 @@ PRIVATE int mixer_get(int reg) /*=========================================================================* * get_set_volume * *=========================================================================*/ -PRIVATE int get_set_volume(message *m_ptr, int flag) +PRIVATE int get_set_volume(const message *m_ptr, int flag) /* flag 0 = get, 1 = set */ { - phys_bytes user_phys; struct volume_level level; int cmd_left, cmd_right, shift, max_level; @@ -281,13 +280,12 @@ PRIVATE int get_set_volume(message *m_ptr, int flag) /*=========================================================================* * get_set_input * *=========================================================================*/ -PRIVATE int get_set_input(message *m_ptr, int flag, int channel) +PRIVATE int get_set_input(const message *m_ptr, int flag, int channel) /* * flag 0 = get, 1 = set * channel 0 = left, 1 = right */ { - phys_bytes user_phys; struct inout_ctrl input; int input_cmd, input_mask, mask, del_mask, shift; @@ -347,10 +345,9 @@ PRIVATE int get_set_input(message *m_ptr, int flag, int channel) /*=========================================================================* * get_set_output * *=========================================================================*/ -PRIVATE int get_set_output(message *m_ptr, int flag) +PRIVATE int get_set_output(const message *m_ptr, int flag) /* flag 0 = get, 1 = set */ { - phys_bytes user_phys; struct inout_ctrl output; int output_mask, mask, del_mask, shift; diff --git a/servers/inet/mnx_eth.c b/servers/inet/mnx_eth.c index 3d969532f..e1cb788bc 100644 --- a/servers/inet/mnx_eth.c +++ b/servers/inet/mnx_eth.c @@ -37,7 +37,7 @@ FORWARD _PROTOTYPE( void send_getstat, (eth_port_t *eth_port) ); PUBLIC void osdep_eth_init() { int i, j, r, rport; - endpoint_t tasknr; + u32_t tasknr; struct eth_conf *ecp; eth_port_t *eth_port, *rep; message mess;