mtd: FSMC NAND replace all use of uintNN_t with uN
Subsystems (2)
PATCH 2/4 mtd: FSMC NAND replace all use of uintNN_t with uN
The short kernel versions of the basic types makes the world more readable.
--- drivers/mtd/nand/fsmc_nand.c | 84 +++++++++++++++++++++--------------------- include/linux/mtd/fsmc.h | 50 ++++++++++++------------ 2 files changed, 67 insertions(+), 67 deletions(-)
drivers/mtd/nand/fsmc_nand.c +42 -42
@@ -220,7 +220,7 @@ struct fsmc_nand_data {void __iomem *addr_va;void __iomem *regs_va; -void (*select_chip)(uint32_t bank,uint32_t busw); +void (*select_chip)(u32 bank,u32 busw); };/* Assert CS signal based on chipnr */
@@ -294,10 +294,10 @@ static void fsmc_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl)* This routine initializes timing parameters related to NAND memory access in * FSMC registers */ -static void __init fsmc_nand_setup (struct fsmc_regs *regs,uint32_t bank, -uint32_t busw) +static void __init fsmc_nand_setup (struct fsmc_regs *regs,u32 bank, +u32 busw) { -uint32_t value =FSMC_DEVTYPE_NAND |FSMC_ENABLE |FSMC_WAITON ; +u32 value =FSMC_DEVTYPE_NAND |FSMC_ENABLE |FSMC_WAITON ;if (busw)writel (value |FSMC_DEVWID_16 , ®s->bank_regs[bank].pc);
@@ -320,7 +320,7 @@ static void fsmc_enable_hwecc(struct mtd_info *mtd, int mode)struct fsmc_nand_data *host =container_of (mtd, struct fsmc_nand_data, mtd);struct fsmc_regs *regs = host->regs_va; -uint32_t bank = host->bank; +u32 bank = host->bank;writel (readl (®s->bank_regs[bank].pc) & ~FSMC_ECCPLEN_256 , ®s->bank_regs[bank].pc);
@@ -335,14 +335,14 @@ static void fsmc_enable_hwecc(struct mtd_info *mtd, int mode)* FSMC. ECC is 13 bytes for 512 bytes of data (supports error correction upto * max of 8-bits) */ -static int fsmc_read_hwecc_ecc4 (struct mtd_info *mtd,const uint8_t *data, -uint8_t *ecc) +static int fsmc_read_hwecc_ecc4 (struct mtd_info *mtd,const u8 *data, +u8 *ecc) {struct fsmc_nand_data *host =container_of (mtd, struct fsmc_nand_data, mtd);struct fsmc_regs *regs = host->regs_va; -uint32_t bank = host->bank; -uint32_t ecc_tmp; +u32 bank = host->bank; +u32 ecc_tmp;unsigned long deadline = jiffies +FSMC_BUSY_WAIT_TIMEOUT ; do {
@@ -353,25 +353,25 @@ static int fsmc_read_hwecc_ecc4(struct mtd_info *mtd, const uint8_t *data, }while (!time_after_eq (jiffies, deadline)); ecc_tmp =readl (®s->bank_regs[bank].ecc1); - ecc[0 ] = (uint8_t ) (ecc_tmp >>0 ); - ecc[1 ] = (uint8_t ) (ecc_tmp >>8 ); - ecc[2 ] = (uint8_t ) (ecc_tmp >>16 ); - ecc[3 ] = (uint8_t ) (ecc_tmp >>24 ); + ecc[0 ] = (u8) (ecc_tmp >>0 ); + ecc[1 ] = (u8) (ecc_tmp >>8 ); + ecc[2 ] = (u8) (ecc_tmp >>16 ); + ecc[3 ] = (u8) (ecc_tmp >>24 ); ecc_tmp =readl (®s->bank_regs[bank].ecc2); - ecc[4 ] = (uint8_t ) (ecc_tmp >>0 ); - ecc[5 ] = (uint8_t ) (ecc_tmp >>8 ); - ecc[6 ] = (uint8_t ) (ecc_tmp >>16 ); - ecc[7 ] = (uint8_t ) (ecc_tmp >>24 ); + ecc[4 ] = (u8) (ecc_tmp >>0 ); + ecc[5 ] = (u8) (ecc_tmp >>8 ); + ecc[6 ] = (u8) (ecc_tmp >>16 ); + ecc[7 ] = (u8) (ecc_tmp >>24 ); ecc_tmp =readl (®s->bank_regs[bank].ecc3); - ecc[8 ] = (uint8_t ) (ecc_tmp >>0 ); - ecc[9 ] = (uint8_t ) (ecc_tmp >>8 ); - ecc[10 ] = (uint8_t ) (ecc_tmp >>16 ); - ecc[11 ] = (uint8_t ) (ecc_tmp >>24 ); + ecc[8 ] = (u8) (ecc_tmp >>0 ); + ecc[9 ] = (u8) (ecc_tmp >>8 ); + ecc[10 ] = (u8) (ecc_tmp >>16 ); + ecc[11 ] = (u8) (ecc_tmp >>24 ); ecc_tmp =readl (®s->bank_regs[bank].sts); - ecc[12 ] = (uint8_t ) (ecc_tmp >>16 ); + ecc[12 ] = (u8) (ecc_tmp >>16 );return 0 ; }
@@ -381,19 +381,19 @@ static int fsmc_read_hwecc_ecc4(struct mtd_info *mtd, const uint8_t *data,* FSMC. ECC is 3 bytes for 512 bytes of data (supports error correction upto * max of 1-bit) */ -static int fsmc_read_hwecc_ecc1 (struct mtd_info *mtd,const uint8_t *data, -uint8_t *ecc) +static int fsmc_read_hwecc_ecc1 (struct mtd_info *mtd,const u8 *data, +u8 *ecc) {struct fsmc_nand_data *host =container_of (mtd, struct fsmc_nand_data, mtd);struct fsmc_regs *regs = host->regs_va; -uint32_t bank = host->bank; -uint32_t ecc_tmp; +u32 bank = host->bank; +u32 ecc_tmp; ecc_tmp =readl (®s->bank_regs[bank].ecc1); - ecc[0 ] = (uint8_t ) (ecc_tmp >>0 ); - ecc[1 ] = (uint8_t ) (ecc_tmp >>8 ); - ecc[2 ] = (uint8_t ) (ecc_tmp >>16 ); + ecc[0 ] = (u8) (ecc_tmp >>0 ); + ecc[1 ] = (u8) (ecc_tmp >>8 ); + ecc[2 ] = (u8) (ecc_tmp >>16 );return 0 ; }
@@ -412,7 +412,7 @@ static int fsmc_read_hwecc_ecc1(struct mtd_info *mtd, const uint8_t *data,* max of 8 bits) */ static int fsmc_read_page_hwecc (struct mtd_info *mtd,struct nand_chip *chip, -uint8_t *buf,int page) +u8 *buf,int page) {struct fsmc_nand_data *host =container_of (mtd, struct fsmc_nand_data, mtd);
@@ -420,17 +420,17 @@ static int fsmc_read_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip,int i, j, s, stat, eccsize = chip->ecc.size;int eccbytes = chip->ecc.bytes;int eccsteps = chip->ecc.steps; -uint8_t *p = buf; -uint8_t *ecc_calc = chip->buffers->ecccalc; -uint8_t *ecc_code = chip->buffers->ecccode; +u8 *p = buf; +u8 *ecc_calc = chip->buffers->ecccalc; +u8 *ecc_code = chip->buffers->ecccode;int off, len, group =0 ;/* -* ecc_oob is intentionally taken as uint16_t. In 16bit devices, we +* ecc_oob is intentionally taken as u16. In 16bit devices, we * end up reading 14 bytes (7 words) from oob. The local array is * to maintain word alignment */ -uint16_t ecc_oob[7 ]; -uint8_t *oob = (uint8_t *)&ecc_oob[0 ]; +u16 ecc_oob[7 ]; +u8 *oob = (u8 *)&ecc_oob[0 ];for (i =0 , s =0 ; s < eccsteps; s++, i += eccbytes, p += eccsize) {
@@ -477,16 +477,16 @@ static int fsmc_read_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip,* calc_ecc is a 104 bit information containing maximum of 8 error * offset informations of 13 bits each in 512 bytes of read data. */ -static int fsmc_correct_data (struct mtd_info *mtd,uint8_t *dat, -uint8_t *read_ecc,uint8_t *calc_ecc) +static int fsmc_correct_data (struct mtd_info *mtd,u8 *dat, +u8 *read_ecc,u8 *calc_ecc) {struct fsmc_nand_data *host =container_of (mtd, struct fsmc_nand_data, mtd);struct fsmc_regs *regs = host->regs_va;unsigned int bank = host->bank; -uint16_t err_idx[8 ]; -uint64_t ecc_data[2 ]; -uint32_t num_err, i; +u16 err_idx[8 ]; +u64 ecc_data[2 ]; +u32 num_err, i;/* The calculated ecc is actually the correction index in data */ memcpy (ecc_data, calc_ecc,13 );
@@ -497,7 +497,7 @@ static int fsmc_correct_data(struct mtd_info *mtd, uint8_t *dat,* * calc_ecc is a 104 bit information containing maximum of 8 error * offset informations of 13 bits each. calc_ecc is copied into a -* uint64_t array and error offset indexes are populated in err_idx +* u64 array and error offset indexes are populated in err_idx * array */ for (i =0 ; i <8 ; i++) {
include/linux/mtd/fsmc.h +25 -25
90 lines not on this page · raw message
Signature · 1 line
1.7.3.2
PATCH 2/4 mtd: FSMC NAND replace all use of uintNN_t with uN
Quoted 4 lines · Linus Walleij
The short kernel versions of the basic types makes the world more readable.
Signed-off-by Linus Walleij <[email protected]>
I do not think dwmw2 will merge this one because he often claimed that u32 cannot be better than uint32_t, because the latter is C99 standard, but the former is not. So I'd not do this, at least not at the area he looks after.
:-)
Signature · 2 lines
Best Regards, Artem Bityutskiy (????? ????????)
PATCH 2/4 mtd: FSMC NAND replace all use of uintNN_t with uN
2010/11/26 Artem Bityutskiy <[email protected]>:
Quoted 10 lines · Linus Walleij
Quoted 4 lines
The short kernel versions of the basic types makes the world more readable.
Signed-off-by Linus Walleij <[email protected]>I do not think dwmw2 will merge this one because he often claimed that u32 cannot be better than
uint32_t, because the latter is C99 standard, but the former is not. So I'd not do this, at least not at the area he looks after.
Oh man. Whatever, David shall I respin the patch series without this one? The latter patches will surely clash so an early indication is appreciated.
Yours,
Linus Walleij
PATCH 2/4 mtd: FSMC NAND replace all use of uintNN_t with uN
Quoted 8 lines · Linus Walleij
2010/11/26 Artem Bityutskiy <[email protected]>:
Quoted 6 lines · Linus Walleij
Quoted 4 lines
The short kernel versions of the basic types makes the world more readable.
Signed-off-by Linus Walleij <[email protected]>
Quoted 8 lines
Quoted 4 lines
I do not think dwmw2 will merge this one because he often claimed that u32 cannot be better than
uint32_t, because the latter is C99 standard, but the former is not. So I'd not do this, at least not at the area he looks after.Oh man. Whatever, David shall I respin the patch series without this one? The latter patches will surely clash so an early indication is appreciated.
I do not know if David will respond, but I recommend to respin without that path, then I'll take the series to my l2-mtd-2.6 tree, and will take care of them.
Signature · 2 lines
Best Regards, Artem Bityutskiy (???????? ?????)