Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/nand No longer use size_t in the chip structure.



details:   https://anonhg.NetBSD.org/src/rev/25c8316335af
branches:  trunk
changeset: 782426:25c8316335af
user:      ahoka <ahoka%NetBSD.org@localhost>
date:      Fri Nov 02 17:14:41 2012 +0000

description:
No longer use size_t in the chip structure.

diffstat:

 sys/dev/nand/nand.c        |  30 +++++++++++++++---------------
 sys/dev/nand/nand.h        |  22 +++++++++++-----------
 sys/dev/nand/nand_micron.c |   6 +++---
 3 files changed, 29 insertions(+), 29 deletions(-)

diffs (175 lines):

diff -r 42bd75a83339 -r 25c8316335af sys/dev/nand/nand.c
--- a/sys/dev/nand/nand.c       Fri Nov 02 17:03:16 2012 +0000
+++ b/sys/dev/nand/nand.c       Fri Nov 02 17:14:41 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nand.c,v 1.18 2012/10/31 18:58:08 riz Exp $    */
+/*     $NetBSD: nand.c,v 1.19 2012/11/02 17:14:41 ahoka Exp $  */
 
 /*-
  * Copyright (c) 2010 Department of Software Engineering,
@@ -34,7 +34,7 @@
 /* Common driver for NAND chips implementing the ONFI 2.2 specification */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nand.c,v 1.18 2012/10/31 18:58:08 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nand.c,v 1.19 2012/11/02 17:14:41 ahoka Exp $");
 
 #include "locators.h"
 
@@ -402,13 +402,13 @@
 #endif
 
        aprint_normal_dev(self,
-           "page size: %zu bytes, spare size: %zu bytes, "
-           "block size: %zu bytes\n",
+           "page size: %" PRIu32 " bytes, spare size: %" PRIu32 " bytes, "
+           "block size: %" PRIu32 " bytes\n",
            chip->nc_page_size, chip->nc_spare_size, chip->nc_block_size);
 
        aprint_normal_dev(self,
            "LUN size: %" PRIu32 " blocks, LUNs: %" PRIu8
-           ", total storage size: %zu MB\n",
+           ", total storage size: %" PRIu64 " MB\n",
            chip->nc_lun_blocks, chip->nc_num_luns,
            chip->nc_size / 1024 / 1024);
 
@@ -441,7 +441,7 @@
                ecc->necc_offset = 80;
                break;
        default:
-               panic("OOB size %zu is unexpected", chip->nc_spare_size);
+               panic("OOB size %" PRIu32 " is unexpected", chip->nc_spare_size);
        }
 
        ecc->necc_steps = chip->nc_page_size / ecc->necc_block_size;
@@ -597,7 +597,7 @@
        struct nand_chip *chip = &sc->sc_chip;
        uint8_t i;
 
-       DPRINTF(("addressing row: 0x%jx column: %zu\n",
+       DPRINTF(("addressing row: 0x%jx column: %" PRIu32 "\n",
                (uintmax_t )row, column));
 
        /* XXX TODO */
@@ -727,18 +727,18 @@
                case NAND_ECC_CORRECTED:
                        aprint_error_dev(self,
                            "data corrected with ECC at page offset 0x%jx "
-                           "block %zu\n", (uintmax_t)offset, b);
+                           "block %" PRIu32 "\n", (uintmax_t)offset, b);
                        break;
                case NAND_ECC_TWOBIT:
                        aprint_error_dev(self,
                            "uncorrectable ECC error at page offset 0x%jx "
-                           "block %zu\n", (uintmax_t)offset, b);
+                           "block %" PRIu32 "\n", (uintmax_t)offset, b);
                        return EIO;
                        break;
                case NAND_ECC_INVALID:
                        aprint_error_dev(self,
                            "invalid ECC in oob at page offset 0x%jx "
-                           "block %zu\n", (uintmax_t)offset, b);
+                           "block %" PRIu32 "\n", (uintmax_t)offset, b);
                        return EIO;
                        break;
                default:
@@ -1153,8 +1153,8 @@
                } else {
                        /* XXX debug */
                        if (left > chip->nc_page_size) {
-                               printf("left: %zu, i: %d, count: %zu\n",
-                                   (size_t )left, i, count);
+                               printf("left: %" PRIu32 ", i: %d, count: %" PRIu32 "\n",
+                                   left, i, count);
                        }
                        KASSERT(left > chip->nc_page_size);
 
@@ -1232,7 +1232,7 @@
        }
 out:
        mutex_exit(&sc->sc_device_lock);
-       DPRINTF(("page programming: retlen: %zu, len: %zu\n", *retlen, len));
+       DPRINTF(("page programming: retlen: %" PRIu32 ", len: %" PRIu32 "\n", *retlen, len));
 
        return error;
 }
@@ -1324,11 +1324,11 @@
 
        *retlen = 0;
 
-       DPRINTF(("nand_flash_read: off: 0x%jx, len: %zu\n",
+       DPRINTF(("nand_flash_read: off: 0x%jx, len: %" PRIu32 "\n",
                (uintmax_t)offset, len));
 
        if (__predict_false((offset + len) > chip->nc_size)) {
-               DPRINTF(("nand_flash_read: read (off: 0x%jx, len: %zu),"
+               DPRINTF(("nand_flash_read: read (off: 0x%jx, len: %" PRIu32 "),"
                        " is over device size (%ju)\n", (uintmax_t)offset,
                        len, (uintmax_t)chip->nc_size));
                return EINVAL;
diff -r 42bd75a83339 -r 25c8316335af sys/dev/nand/nand.h
--- a/sys/dev/nand/nand.h       Fri Nov 02 17:03:16 2012 +0000
+++ b/sys/dev/nand/nand.h       Fri Nov 02 17:14:41 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nand.h,v 1.14 2012/10/31 18:58:08 riz Exp $    */
+/*     $NetBSD: nand.h,v 1.15 2012/11/02 17:14:41 ahoka Exp $  */
 
 /*-
  * Copyright (c) 2010 Department of Software Engineering,
@@ -110,19 +110,19 @@
        struct nand_ecc *nc_ecc;        /* ecc information */
        uint8_t *nc_oob_cache;          /* buffer for oob cache */
        uint8_t *nc_page_cache;         /* buffer for page cache */
-       uint8_t *nc_ecc_cache;
-       size_t nc_size;                 /* storage size in bytes */
-       size_t nc_page_size;            /* page size in bytes */
-       size_t nc_block_pages;          /* block size in pages */
-       size_t nc_block_size;           /* block size in bytes */
-       size_t nc_spare_size;           /* spare (oob) size in bytes */
+       uint8_t *nc_ecc_cache;          /* buffer for ecc */
+       uint64_t nc_size;               /* storage size in bytes */
+       uint32_t nc_page_size;          /* page size in bytes */
+       uint32_t nc_block_pages;        /* block size in pages */
+       uint32_t nc_block_size;         /* block size in bytes */
+       uint32_t nc_spare_size;         /* spare (oob) size in bytes */
        uint32_t nc_lun_blocks;         /* LUN size in blocks */
        uint32_t nc_flags;              /* bitfield flags */
        uint32_t nc_quirks;             /* bitfield quirks */
-       unsigned int nc_page_shift;     /* page shift for page alignment */
-       unsigned int nc_page_mask;      /* page mask for page alignment */
-       unsigned int nc_block_shift;    /* write shift */
-       unsigned int nc_block_mask;     /* write mask */
+       uint32_t nc_page_shift;         /* page shift for page alignment */
+       uint32_t nc_page_mask;          /* page mask for page alignment */
+       uint32_t nc_block_shift;        /* write shift */
+       uint32_t nc_block_mask;         /* write mask */
        uint8_t nc_num_luns;            /* number of LUNs */
        uint8_t nc_manf_id;             /* manufacturer id */
        uint8_t nc_dev_id;              /* device id  */
diff -r 42bd75a83339 -r 25c8316335af sys/dev/nand/nand_micron.c
--- a/sys/dev/nand/nand_micron.c        Fri Nov 02 17:03:16 2012 +0000
+++ b/sys/dev/nand/nand_micron.c        Fri Nov 02 17:14:41 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nand_micron.c,v 1.6 2011/07/15 19:19:57 cliff Exp $    */
+/*     $NetBSD: nand_micron.c,v 1.7 2012/11/02 17:14:41 ahoka Exp $    */
 
 /*-
  * Copyright (c) 2011 Department of Software Engineering,
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nand_micron.c,v 1.6 2011/07/15 19:19:57 cliff Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nand_micron.c,v 1.7 2012/11/02 17:14:41 ahoka Exp $");
 
 #include "nand.h"
 #include "onfi.h"
@@ -159,7 +159,7 @@
        chip->nc_size = MT29FxG_PAGESIZE * MT29FxG_BLOCK_PAGES *
                dp->lun_blocks * dp->num_luns;
 
-       aprint_normal_dev(self, "%s %s, size %zuMB\n",
+       aprint_normal_dev(self, "%s %s, size %" PRIu64 "MB\n",
                vendor, dp->name, chip->nc_size >> 20);
 
        return 0;



Home | Main Index | Thread Index | Old Index