k9f1g08r0a: fix various warnings
authorGrazvydas Ignotas <notasas@gmail.com>
Tue, 22 Nov 2011 16:54:44 +0000 (18:54 +0200)
committerGrazvydas Ignotas <notasas@gmail.com>
Tue, 27 Dec 2011 11:21:17 +0000 (13:21 +0200)
incompatible pointer types and unused variables

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
drivers/k9f1g08r0a.c

index 988533c..b039b50 100644 (file)
@@ -82,7 +82,6 @@ static u_char ecc_pos[] =
                {40, 41, 42, 43, 44, 45, 46, 47,
                48, 49, 50, 51, 52, 53, 54, 55,
                56, 57, 58, 59, 60, 61, 62, 63};
-static u_char eccvalid_pos = 4;
 
 static unsigned long chipsize = (256 << 20);
 
@@ -235,7 +234,7 @@ int nand_read_block(unsigned char *buf, ulong block_addr)
        
        /* check bad block */
        /* 0th word in spare area needs be 0xff */
-       if (nand_read_oob(oob_buf, block_addr) || (oob_buf[0] & 0xff) != 0xff){
+       if (nand_read_oob((u_char *)oob_buf, block_addr) || (oob_buf[0] & 0xff) != 0xff){
                printf("Skipped bad block at 0x%x\n", block_addr);
                return 1;    /* skip bad block */
        }
@@ -249,7 +248,7 @@ int nand_read_block(unsigned char *buf, ulong block_addr)
 
        return 0;
 }
-static count = 0;
+
 /* read a page with ECC */
 static int nand_read_page(u_char *buf, ulong page_addr)
 {
@@ -257,6 +256,7 @@ static int nand_read_page(u_char *buf, ulong page_addr)
        u_char ecc_code[ECC_SIZE];
        u_char ecc_calc[ECC_STEPS];
        u_char oob_buf[OOB_SIZE];
+       int count;
 #endif
        u16 val;
        int cntr;
@@ -277,20 +277,19 @@ static int nand_read_page(u_char *buf, ulong page_addr)
        /* A delay seems to be helping here. needs more investigation */
        delay(10000);
        len = (bus_width == 16) ? PAGE_SIZE >> 1 : PAGE_SIZE;
-       p = buf;
+       p = (void *)buf;
        for (cntr = 0; cntr < len; cntr++){
                *p++ = READ_NAND(NAND_ADDR);
                delay(10);
        }
        
 #ifdef ECC_CHECK_ENABLE
-       p = oob_buf;
+       p = (void *)oob_buf;
         len = (bus_width == 16) ? OOB_SIZE >> 1 : OOB_SIZE;
        for (cntr = 0; cntr < len; cntr++){
                *p++ = READ_NAND(NAND_ADDR);
                delay(10);
        }
-       count = 0;
        NAND_DISABLE_CE();  /* set pin high */
 
        /* Pick the ECC bytes out of the oob data */
@@ -318,7 +317,6 @@ static int nand_read_page(u_char *buf, ulong page_addr)
  */
 static int nand_read_oob(u_char *buf, ulong page_addr)
 {
-       u16 val;
        int cntr;
        int len;
 
@@ -327,7 +325,7 @@ static int nand_read_oob(u_char *buf, ulong page_addr)
 #else
        u_char *p;
 #endif
-       p = buf;
+       p = (void *)buf;
         len = (bus_width == 16) ? OOB_SIZE >> 1 : OOB_SIZE;
 
        NAND_ENABLE_CE();  /* set pin low */