use static keyword

This commit is contained in:
Li-Ta Lo 2001-04-09 02:23:18 +00:00
parent b8bbc234a6
commit 752c710520

View file

@ -15,17 +15,18 @@ static unsigned char *nvram;
static int block_count; static int block_count;
static int firstfill = 1; static int firstfill = 1;
void memcpy_from_doc_mil(void *dest, const void *src, size_t n); static void memcpy_from_doc_mil(void *dest, const void *src, size_t n);
unsigned char *doc_mil = (unsigned char *) 0xffffe000; static unsigned char *doc_mil = (unsigned char *) 0xffffe000;
#ifdef CHECK_DOC_MIL #ifdef CHECK_DOC_MIL
unsigned char *checkbuf; static unsigned char *checkbuf;
#endif /* CHECK_DOC_MIL */ #endif /* CHECK_DOC_MIL */
static unsigned char *ram; static unsigned char *ram;
#define K64 (64 * 1024) #define K64 (64 * 1024)
int fill_inbuf(void) int
fill_inbuf(void)
{ {
if (firstfill) { if (firstfill) {
if ((ram = malloc(K64)) == NULL) { if ((ram = malloc(K64)) == NULL) {
@ -51,6 +52,7 @@ int fill_inbuf(void)
} }
memcpy_from_doc_mil(ram, nvram, K64); memcpy_from_doc_mil(ram, nvram, K64);
#ifdef CHECK_DOC_MIL #ifdef CHECK_DOC_MIL
if (checkbuf) { if (checkbuf) {
memcpy_from_doc_mil(checkbuf, nvram, K64); memcpy_from_doc_mil(checkbuf, nvram, K64);
@ -62,11 +64,12 @@ int fill_inbuf(void)
{ {
int i; int i;
printk(KERN_INFO "First 16 bytes of block: "); printk(KERN_INFO "First 16 bytes of block: ");
for(i = 0; i < 16; i++) for (i = 0; i < 16; i++)
printk("0x%x ", ram[i]); printk("0x%x ", ram[i]);
printk(KERN_INFO "\n"); printk(KERN_INFO "\n");
} }
#endif #endif
DBG("%6d:%s() - nvram:0x%p block_count:%d\n", DBG("%6d:%s() - nvram:0x%p block_count:%d\n",
__LINE__, __FUNCTION__, nvram, block_count); __LINE__, __FUNCTION__, nvram, block_count);
@ -80,7 +83,8 @@ int fill_inbuf(void)
return inbuf[0]; return inbuf[0];
} }
void memcpy_from_doc_mil(void *dest, const void *src, size_t n) static void
memcpy_from_doc_mil(void *dest, const void *src, size_t n)
{ {
int i; int i;
unsigned long address = (unsigned long) src; unsigned long address = (unsigned long) src;