mtd: Delete commented printk and add some space for required
PATCH 1/1 mtd: Delete commented printk and add some space for required
Delete commented printk for NFTL_findwriteunit and
NFTL_makefreeblock. Add required space for the variable blockofs
--- drivers/mtd/nftlcore.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)
drivers/mtd/nftlcore.c +1 -8
@@ -486,7 +486,6 @@ static u16 NFTL_makefreeblock( struct NFTLrecord *nftl , unsigned pendingblock)while (EUN <= nftl->lastEUN) { thislen++; -//printk("VUC %d reaches len %d with EUN %d\n", chain, thislen, EUN); EUN = nftl->ReplUnitTable[EUN ] &0x7fff ;if (thislen >0xff00 ) { printk("Endless loop in Virtual Chain %d: Unit %x\n",
@@ -501,7 +500,6 @@ static u16 NFTL_makefreeblock( struct NFTLrecord *nftl , unsigned pendingblock) }if (thislen > ChainLength) { -//printk("New longest chain is %d with length %d\n", chain, thislen); ChainLength = thislen; LongestChain = chain; }
@@ -525,7 +523,7 @@ static inline u16 NFTL_findwriteunit(struct NFTLrecord *nftl, unsigned block)u16 thisVUC = block / (nftl->EraseSize /512 );struct mtd_info *mtd = nftl->mbd.mtd;unsigned int writeEUN; -unsigned long blockofs = (block *512 ) & (nftl->EraseSize -1 ); +unsigned long blockofs = (block *512 ) & (nftl->EraseSize -1 );size_t retlen;int silly, silly2 =3 ;struct nftl_oob oob;
@@ -592,10 +590,6 @@ static inline u16 NFTL_findwriteunit(struct NFTLrecord *nftl, unsigned block)a chain to make room. */ -/* First remember the start of this chain */ -//u16 startEUN = nftl->EUNtable[thisVUC]; - -//printk("Write to VirtualUnitChain %d, calling makefreeblock()\n", thisVUC); writeEUN =NFTL_makefreeblock (nftl,BLOCK_NIL );if (writeEUN ==BLOCK_NIL ) {
@@ -618,7 +612,6 @@ static inline u16 NFTL_findwriteunit(struct NFTLrecord *nftl, unsigned block)printk (KERN_WARNING "Cannot make free space.\n" );return BLOCK_NIL ; } -//printk("Restarting scan\n"); continue ; }
Signature · 1 line
2.27.0
Miquel Raynal
maintainerHi Deming,
[email protected] wrote on Thu, 6 Oct 2022 05:04:19 -0400:
Quoted 3 lines
Delete commented printk for
NFTL_findwriteunitand
NFTL_makefreeblock. Add required space for the variable blockofs
I would rather not delete these comments because they are very old and I believe were debugging lines in the past. I hope we will never have to dig into this driver anymore but if we have to, I would suggest to use debug printk's instead.
Also, if you want to clean up a bit the driver, you can go a little bit further and address eg. all whitespace issues.
Quoted 46 lines
Signed-off-by Deming Wang <[email protected]>--- drivers/mtd/nftlcore.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)drivers/mtd/nftlcore.c +1
-7@@ -486,7 +486,6 @@ static u16 NFTL_makefreeblock( struct NFTLrecord *nftl , unsigned pendingblock)while (EUN <= nftl->lastEUN) { thislen++; -//printk("VUC %d reaches len %d with EUN %d\n", chain, thislen, EUN); EUN = nftl->ReplUnitTable[EUN ] &0x7fff ;if (thislen >0xff00 ) { printk("Endless loop in Virtual Chain %d: Unit %x\n",@@ -501,7 +500,6 @@ static u16 NFTL_makefreeblock( struct NFTLrecord *nftl , unsigned pendingblock) }if (thislen > ChainLength) { -//printk("New longest chain is %d with length %d\n", chain, thislen); ChainLength = thislen; LongestChain = chain; }@@ -525,7 +523,7 @@ static inline u16 NFTL_findwriteunit(struct NFTLrecord *nftl, unsigned block)u16 thisVUC = block / (nftl->EraseSize /512 );struct mtd_info *mtd = nftl->mbd.mtd;unsigned int writeEUN; -unsigned long blockofs = (block *512 ) & (nftl->EraseSize -1 ); +unsigned long blockofs = (block *512 ) & (nftl->EraseSize -1 );size_t retlen;int silly, silly2 =3 ;struct nftl_oob oob;@@ -592,10 +590,6 @@ static inline u16 NFTL_findwriteunit(struct NFTLrecord *nftl, unsigned block)a chain to make room. */ -/* First remember the start of this chain */ -//u16 startEUN = nftl->EUNtable[thisVUC]; - -//printk("Write to VirtualUnitChain %d, calling makefreeblock()\n", thisVUC); writeEUN =NFTL_makefreeblock (nftl,BLOCK_NIL );if (writeEUN ==BLOCK_NIL ) {
drivers/mtd/nftlcore.c static inline u16 NFTL_findwriteunit(struct NFTLrecord *nftl, unsigned block) · line 617
Quoted 7 lines
drivers/mtd/nftlcore.c +0
-1@@ -618,7 +612,6 @@ static inline u16 NFTL_findwriteunit(struct NFTLrecord *nftl, unsigned block)printk (KERN_WARNING "Cannot make free space.\n" );return BLOCK_NIL ; } -//printk("Restarting scan\n"); continue ; }
Thanks,
Miquèl
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/