- avoid variable shadowing

- add const
This commit is contained in:
christos 2005-05-30 04:30:18 +00:00
parent 097e6576ea
commit 26f4234ec5
3 changed files with 38 additions and 38 deletions

View File

@ -1,6 +1,6 @@
/* $SourceForge: bktr_card.c,v 1.3 2003/03/11 23:11:21 thomasklausner Exp $ */
/* $NetBSD: bktr_card.c,v 1.19 2004/07/24 12:52:45 mrg Exp $ */
/* $NetBSD: bktr_card.c,v 1.20 2005/05/30 04:30:18 christos Exp $ */
/* $FreeBSD: src/sys/dev/bktr/bktr_card.c,v 1.16 2000/10/31 13:09:56 roger Exp$ */
/*
@ -51,7 +51,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: bktr_card.c,v 1.19 2004/07/24 12:52:45 mrg Exp $");
__KERNEL_RCSID(0, "$NetBSD: bktr_card.c,v 1.20 2005/05/30 04:30:18 christos Exp $");
#include "opt_bktr.h" /* Include any kernel config options */
@ -379,7 +379,7 @@ readEEProm(bktr_ptr_t bktr, int offset, int count, u_char *data)
{
int x;
int addr;
int max;
int xmax;
int byte;
/* get the address of the EEProm */
@ -387,8 +387,8 @@ readEEProm(bktr_ptr_t bktr, int offset, int count, u_char *data)
if (addr == 0)
return(-1);
max = (int)(bktr->card.eepromSize * EEPROMBLOCKSIZE);
if ((offset + count) > max)
xmax = (int)(bktr->card.eepromSize * EEPROMBLOCKSIZE);
if ((offset + count) > xmax)
return(-1);
/* set the start address */
@ -1225,8 +1225,8 @@ checkMSPEnd:
}
/* If a remote control is found, poll it 5 times to turn off the LED */
if (bktr->remote_control) {
int i;
for (i=0; i<5; i++)
int ii;
for (ii=0; ii<5; ii++)
i2cRead(bktr, bktr->remote_control_addr);
}
/* End of Check Remote */

View File

@ -1,6 +1,6 @@
/* $SourceForge: bktr_core.c,v 1.6 2003/03/11 23:11:22 thomasklausner Exp $ */
/* $NetBSD: bktr_core.c,v 1.33 2003/06/29 22:30:29 fvdl Exp $ */
/* $NetBSD: bktr_core.c,v 1.34 2005/05/30 04:30:18 christos Exp $ */
/* $FreeBSD: src/sys/dev/bktr/bktr_core.c,v 1.114 2000/10/31 13:09:56 roger Exp$ */
/*
@ -98,7 +98,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: bktr_core.c,v 1.33 2003/06/29 22:30:29 fvdl Exp $");
__KERNEL_RCSID(0, "$NetBSD: bktr_core.c,v 1.34 2005/05/30 04:30:18 christos Exp $");
#include "opt_bktr.h" /* Include any kernel config options */
@ -475,9 +475,9 @@ void
common_bktr_attach(bktr_ptr_t bktr, int unit, u_long pci_id, u_int rev)
{
#if defined(__NetBSD__)
vaddr_t buf = 0;
vaddr_t sbuf = 0;
#else
vm_offset_t buf = 0;
vm_offset_t sbuf = 0;
#endif
/***************************************/
@ -498,9 +498,9 @@ common_bktr_attach(bktr_ptr_t bktr, int unit, u_long pci_id, u_int rev)
/* allocate space for pixel buffer */
if (BROOKTREE_ALLOC)
buf = get_bktr_mem(bktr, &bktr->dm_mem, BROOKTREE_ALLOC);
sbuf = get_bktr_mem(bktr, &bktr->dm_mem, BROOKTREE_ALLOC);
else
buf = 0;
sbuf = 0;
#endif
#if defined(__FreeBSD__) || defined(__bsdi__)
@ -514,7 +514,7 @@ common_bktr_attach(bktr_ptr_t bktr, int unit, u_long pci_id, u_int rev)
bktr->odd_dma_prog = bktr_retrieve_address(unit, BKTR_MEM_ODD_DMA_PROG);
bktr->vbidata = bktr_retrieve_address(unit, BKTR_MEM_VBIDATA);
bktr->vbibuffer = bktr_retrieve_address(unit, BKTR_MEM_VBIBUFFER);
buf = bktr_retrieve_address(unit, BKTR_MEM_BUF);
sbuf = bktr_retrieve_address(unit, BKTR_MEM_BUF);
need_to_allocate_memory = 0;
}
#endif
@ -530,9 +530,9 @@ common_bktr_attach(bktr_ptr_t bktr, int unit, u_long pci_id, u_int rev)
/* allocate space for pixel buffer */
if (BROOKTREE_ALLOC)
buf = get_bktr_mem(unit, BROOKTREE_ALLOC);
sbuf = get_bktr_mem(unit, BROOKTREE_ALLOC);
else
buf = 0;
sbuf = 0;
}
#endif /* FreeBSD or BSDi */
@ -543,18 +543,18 @@ bktr_store_address(unit, BKTR_MEM_DMA_PROG, bktr->dma_prog);
bktr_store_address(unit, BKTR_MEM_ODD_DMA_PROG, bktr->odd_dma_prog);
bktr_store_address(unit, BKTR_MEM_VBIDATA, bktr->vbidata);
bktr_store_address(unit, BKTR_MEM_VBIBUFFER, bktr->vbibuffer);
bktr_store_address(unit, BKTR_MEM_BUF, buf);
bktr_store_address(unit, BKTR_MEM_BUF, sbuf);
#endif
if (bootverbose) {
printf("%s: buffer size %d, addr %p\n",
bktr_name(bktr), BROOKTREE_ALLOC,
(void *)(uintptr_t)vtophys(buf));
(void *)(uintptr_t)vtophys(sbuf));
}
if (buf != 0) {
bktr->bigbuf = buf;
if (sbuf != 0) {
bktr->bigbuf = sbuf;
bktr->alloc_pages = BROOKTREE_ALLOC_PAGES;
bzero((caddr_t) bktr->bigbuf, BROOKTREE_ALLOC);
} else {
@ -1293,9 +1293,9 @@ video_ioctl(bktr_ptr_t bktr, int unit, ioctl_cmd_t cmd, caddr_t arg, struct proc
struct meteor_video *video;
struct bktr_capture_area *cap_area;
#if defined(__NetBSD__)
vaddr_t buf;
vaddr_t sbuf;
#else
vm_offset_t buf;
vm_offset_t sbuf;
#endif
int i;
char char_temp;
@ -1756,21 +1756,21 @@ video_ioctl(bktr_ptr_t bktr, int unit, ioctl_cmd_t cmd, caddr_t arg, struct proc
#if defined(__NetBSD__) || defined(__OpenBSD__)
bus_dmamap_t dmamap;
buf = get_bktr_mem(bktr, &dmamap,
sbuf = get_bktr_mem(bktr, &dmamap,
temp * PAGE_SIZE);
if (buf != 0) {
if (sbuf != 0) {
free_bktr_mem(bktr, bktr->dm_mem,
bktr->bigbuf);
bktr->dm_mem = dmamap;
#else
buf = get_bktr_mem(unit, temp*PAGE_SIZE);
if (buf != 0) {
sbuf = get_bktr_mem(unit, temp*PAGE_SIZE);
if (sbuf != 0) {
kmem_free(kernel_map, bktr->bigbuf,
(bktr->alloc_pages * PAGE_SIZE));
#endif
bktr->bigbuf = buf;
bktr->bigbuf = sbuf;
bktr->alloc_pages = temp;
if (bootverbose)
printf(
@ -1910,7 +1910,7 @@ tuner_ioctl(bktr_ptr_t bktr, int unit, ioctl_cmd_t cmd, caddr_t arg, struct proc
unsigned int temp, temp1;
int offset;
int count;
u_char *buf;
u_char *sbuf;
u_long par;
u_char write;
int i2c_addr;
@ -2184,24 +2184,24 @@ tuner_ioctl(bktr_ptr_t bktr, int unit, ioctl_cmd_t cmd, caddr_t arg, struct proc
case BT848_WEEPROM: /* write eeprom */
offset = (((struct eeProm *)arg)->offset);
count = (((struct eeProm *)arg)->count);
buf = &(((struct eeProm *)arg)->bytes[0]);
if (writeEEProm(bktr, offset, count, buf) < 0)
sbuf = &(((struct eeProm *)arg)->bytes[0]);
if (writeEEProm(bktr, offset, count, sbuf) < 0)
return(EIO);
break;
case BT848_REEPROM: /* read eeprom */
offset = (((struct eeProm *)arg)->offset);
count = (((struct eeProm *)arg)->count);
buf = &(((struct eeProm *)arg)->bytes[0]);
if (readEEProm(bktr, offset, count, buf) < 0)
sbuf = &(((struct eeProm *)arg)->bytes[0]);
if (readEEProm(bktr, offset, count, sbuf) < 0)
return(EIO);
break;
case BT848_SIGNATURE:
offset = (((struct eeProm *)arg)->offset);
count = (((struct eeProm *)arg)->count);
buf = &(((struct eeProm *)arg)->bytes[0]);
if (signCard(bktr, offset, count, buf) < 0)
sbuf = &(((struct eeProm *)arg)->bytes[0]);
if (signCard(bktr, offset, count, sbuf) < 0)
return(EIO);
break;
@ -3626,7 +3626,7 @@ start_capture(bktr_ptr_t bktr, unsigned type)
fp = &format_params[bktr->format_params];
/* If requested, clear out capture buf first */
/* If requested, clear out capture sbuf first */
if (bktr->clr_on_start && (bktr->video.addr == 0)) {
bzero((caddr_t)bktr->bigbuf,
(size_t)bktr->rows * bktr->cols * bktr->frames *

View File

@ -1,6 +1,6 @@
/* $SourceForge: bktr_reg.h,v 1.3 2003/03/11 23:11:27 thomasklausner Exp $ */
/* $NetBSD: bktr_reg.h,v 1.13 2003/03/12 00:14:41 wiz Exp $ */
/* $NetBSD: bktr_reg.h,v 1.14 2005/05/30 04:30:18 christos Exp $ */
/*
* $FreeBSD: src/sys/dev/bktr/bktr_reg.h,v 1.42 2000/10/31 13:09:56 roger Exp$
*
@ -408,7 +408,7 @@ struct TVTUNER {
/* description of the PHYSICAL tuner */
struct TUNER {
char* name;
const char* name;
u_char type;
u_char pllControl[4];
u_char bandLimits[2];
@ -423,7 +423,7 @@ struct TUNER {
#define EEPROMBLOCKSIZE 32
struct CARDTYPE {
unsigned int card_id; /* card id (from #define's) */
char* name;
const char* name;
const struct TUNER* tuner; /* Tuner details */
u_char tuner_pllAddr; /* Tuner i2c address */
u_char dbx; /* Has DBX chip? */