mtd/drivers/mtd/nand nandsim.c,1.1,1.2

Artem Bityuckiy dedekind at infradead.org
Fri Nov 26 07:54:14 EST 2004


Update of /home/cvs/mtd/drivers/mtd/nand
In directory phoenix.infradead.org:/tmp/cvs-serv7120/drivers/mtd/nand

Modified Files:
	nandsim.c 
Log Message:
Use C99 types instead of non-standard u32 and u16.


Index: nandsim.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/nand/nandsim.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- nandsim.c	26 Nov 2004 12:26:48 -0000	1.1
+++ nandsim.c	26 Nov 2004 12:54:12 -0000	1.2
@@ -245,34 +245,34 @@
 
 	uint busw;          /* flash chip bus width (8 or 16) */
 	u_char ids[4];      /* chip's ID bytes */
-	u32 options;        /* chip's characteristic bits */
-	u32 state;          /* current chip state */
-	u32 nxstate;        /* next expected state */
-	
-	u32  *op;           /* current operation, NULL operations isn't known yet  */
-	u32  pstates[NS_MAX_PREVSTATES]; /* previous states */
-	u16  npstates;      /* number of previous states saved */
-	u16  stateidx;      /* current state index */
+	uint32_t options;        /* chip's characteristic bits */
+	uint32_t state;          /* current chip state */
+	uint32_t nxstate;        /* next expected state */
+	
+	uint32_t  *op;           /* current operation, NULL operations isn't known yet  */
+	uint32_t  pstates[NS_MAX_PREVSTATES]; /* previous states */
+	uint16_t  npstates;      /* number of previous states saved */
+	uint16_t  stateidx;      /* current state index */
 
 	/* The simulated NAND flash image */
 	union flash_media {
 		u_char *byte;
-		u16    *word;
+		uint16_t    *word;
 	} mem;
 
 	/* Internal buffer of page + OOB size bytes */
 	union internal_buffer {
 		u_char *byte;  /* for byte access */
-		u16    *word;  /* for 16-bit word access */
+		uint16_t    *word;  /* for 16-bit word access */
 	} buf;
 
 	/* NAND flash "geometry" */
 	struct nandsin_geometry {
-		u32  totsz;        /* total flash size, bytes */
-		u32  secsz;        /* flash sector (erase block) size, bytes */
+		uint32_t  totsz;        /* total flash size, bytes */
+		uint32_t  secsz;        /* flash sector (erase block) size, bytes */
 		uint pgsz;         /* NAND flash page size, bytes */
 		uint oobsz;        /* page OOB area size, bytes */
-		u32  totszoob;     /* total flash size including OOB, bytes */
+		uint32_t  totszoob;     /* total flash size including OOB, bytes */
 		uint pgszoob;      /* page size including OOB , bytes*/
 		uint secszoob;     /* sector size including OOB, bytes */
 		uint pgnum;        /* total number of pages */
@@ -310,8 +310,8 @@
  * through the correspondent states chain.
  */
 static struct nandsim_operations {
-	u32 reqopts;  /* options which are required to perform the operation */
-	u32 states[NS_OPER_STATES]; /* operation's states */
+	uint32_t reqopts;  /* options which are required to perform the operation */
+	uint32_t states[NS_OPER_STATES]; /* operation's states */
 } ops[NS_OPER_NUM] = {
 	/* Read page + OOB from the beginning */
 	{OPT_SMALLPAGE, {STATE_CMD_READ0 | ACTION_ZEROOFF, STATE_ADDR_PAGE | ACTION_CPY,
@@ -511,7 +511,7 @@
  * Returns the string representation of 'state' state.
  */
 static char *
-get_state_name(u32 state)
+get_state_name(uint32_t state)
 {
 	switch (NS_STATE(state)) {
 		case STATE_CMD_READ0:
@@ -596,7 +596,7 @@
 /*
  * Returns state after command is accepted by command number.
  */
-static u32
+static uint32_t
 get_state_by_command(unsigned command)
 {
 	switch (command) {
@@ -713,7 +713,7 @@
  *           0 - operation is found.
  */
 static int
-find_operation(struct nandsim *ns, u32 flag)
+find_operation(struct nandsim *ns, uint32_t flag)
 {
 	int opsfound = 0;
 	int i, j, idx = 0;
@@ -803,7 +803,7 @@
  * RETURNS: 0 if success, -1 if error.
  */
 static int
-do_state_action(struct nandsim *ns, u32 action)
+do_state_action(struct nandsim *ns, uint32_t action)
 {
 	int i, num;
 	int busdiv = ns->busw == 8 ? 1 : 2;
@@ -1357,7 +1357,7 @@
 			ns->buf.byte[ns->regs.count] = byte;
 			ns->regs.count += 1;
 		} else {
-			ns->buf.word[ns->regs.count >> 1] = cpu_to_le16((u16)byte);
+			ns->buf.word[ns->regs.count >> 1] = cpu_to_le16((uint16_t)byte);
 			ns->regs.count += 2;
 		}
 	}
@@ -1372,7 +1372,7 @@
 	return 1;
 }
 
-static u16
+static uint16_t
 ns_nand_read_word(struct mtd_info *mtd)
 {
 	struct nand_chip *chip = (struct nand_chip *)mtd->priv;
@@ -1383,7 +1383,7 @@
 }
 
 static void
-ns_nand_write_word(struct mtd_info *mtd, u16 word)
+ns_nand_write_word(struct mtd_info *mtd, uint16_t word)
 {
 	struct nand_chip *chip = (struct nand_chip *)mtd->priv;
 	





More information about the linux-mtd-cvs mailing list