diff options
author | Brian Norris <computersforpeace@gmail.com> | 2011-07-19 13:06:09 -0400 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@intel.com> | 2011-09-11 08:02:16 -0400 |
commit | 289c05222172b51401dbbb017115655f241d94ab (patch) | |
tree | 1fd2c801102a8c4a085f75a08c766d3250491962 /drivers/mtd/inftlcore.c | |
parent | d037021953922ebdbc34b98b8c4648017b1c6e89 (diff) |
mtd: replace DEBUG() with pr_debug()
Start moving away from the MTD_DEBUG_LEVEL messages. The dynamic
debugging feature is a generic kernel feature that provides more
flexibility.
(See Documentation/dynamic-debug-howto.txt)
Also fix some punctuation, indentation, and capitalization that went
along with the affected lines.
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
Diffstat (limited to 'drivers/mtd/inftlcore.c')
-rw-r--r-- | drivers/mtd/inftlcore.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/drivers/mtd/inftlcore.c b/drivers/mtd/inftlcore.c index c9a31e6faab2..232e11b1526c 100644 --- a/drivers/mtd/inftlcore.c +++ b/drivers/mtd/inftlcore.c | |||
@@ -63,7 +63,7 @@ static void inftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) | |||
63 | return; | 63 | return; |
64 | } | 64 | } |
65 | 65 | ||
66 | DEBUG(MTD_DEBUG_LEVEL3, "INFTL: add_mtd for %s\n", mtd->name); | 66 | pr_debug("INFTL: add_mtd for %s\n", mtd->name); |
67 | 67 | ||
68 | inftl = kzalloc(sizeof(*inftl), GFP_KERNEL); | 68 | inftl = kzalloc(sizeof(*inftl), GFP_KERNEL); |
69 | 69 | ||
@@ -131,7 +131,7 @@ static void inftl_remove_dev(struct mtd_blktrans_dev *dev) | |||
131 | { | 131 | { |
132 | struct INFTLrecord *inftl = (void *)dev; | 132 | struct INFTLrecord *inftl = (void *)dev; |
133 | 133 | ||
134 | DEBUG(MTD_DEBUG_LEVEL3, "INFTL: remove_dev (i=%d)\n", dev->devnum); | 134 | pr_debug("INFTL: remove_dev (i=%d)\n", dev->devnum); |
135 | 135 | ||
136 | del_mtd_blktrans_dev(dev); | 136 | del_mtd_blktrans_dev(dev); |
137 | 137 | ||
@@ -213,7 +213,7 @@ static u16 INFTL_findfreeblock(struct INFTLrecord *inftl, int desperate) | |||
213 | u16 pot = inftl->LastFreeEUN; | 213 | u16 pot = inftl->LastFreeEUN; |
214 | int silly = inftl->nb_blocks; | 214 | int silly = inftl->nb_blocks; |
215 | 215 | ||
216 | DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_findfreeblock(inftl=%p," | 216 | pr_debug("INFTL: INFTL_findfreeblock(inftl=%p," |
217 | "desperate=%d)\n", inftl, desperate); | 217 | "desperate=%d)\n", inftl, desperate); |
218 | 218 | ||
219 | /* | 219 | /* |
@@ -221,7 +221,7 @@ static u16 INFTL_findfreeblock(struct INFTLrecord *inftl, int desperate) | |||
221 | * blocks completely. | 221 | * blocks completely. |
222 | */ | 222 | */ |
223 | if (!desperate && inftl->numfreeEUNs < 2) { | 223 | if (!desperate && inftl->numfreeEUNs < 2) { |
224 | DEBUG(MTD_DEBUG_LEVEL1, "INFTL: there are too few free " | 224 | pr_debug("INFTL: there are too few free " |
225 | "EUNs (%d)\n", inftl->numfreeEUNs); | 225 | "EUNs (%d)\n", inftl->numfreeEUNs); |
226 | return BLOCK_NIL; | 226 | return BLOCK_NIL; |
227 | } | 227 | } |
@@ -257,7 +257,7 @@ static u16 INFTL_foldchain(struct INFTLrecord *inftl, unsigned thisVUC, unsigned | |||
257 | struct inftl_oob oob; | 257 | struct inftl_oob oob; |
258 | size_t retlen; | 258 | size_t retlen; |
259 | 259 | ||
260 | DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_foldchain(inftl=%p,thisVUC=%d," | 260 | pr_debug("INFTL: INFTL_foldchain(inftl=%p,thisVUC=%d," |
261 | "pending=%d)\n", inftl, thisVUC, pendingblock); | 261 | "pending=%d)\n", inftl, thisVUC, pendingblock); |
262 | 262 | ||
263 | memset(BlockMap, 0xff, sizeof(BlockMap)); | 263 | memset(BlockMap, 0xff, sizeof(BlockMap)); |
@@ -321,7 +321,7 @@ static u16 INFTL_foldchain(struct INFTLrecord *inftl, unsigned thisVUC, unsigned | |||
321 | * Chain, and the Erase Unit into which we are supposed to be copying. | 321 | * Chain, and the Erase Unit into which we are supposed to be copying. |
322 | * Go for it. | 322 | * Go for it. |
323 | */ | 323 | */ |
324 | DEBUG(MTD_DEBUG_LEVEL1, "INFTL: folding chain %d into unit %d\n", | 324 | pr_debug("INFTL: folding chain %d into unit %d\n", |
325 | thisVUC, targetEUN); | 325 | thisVUC, targetEUN); |
326 | 326 | ||
327 | for (block = 0; block < inftl->EraseSize/SECTORSIZE ; block++) { | 327 | for (block = 0; block < inftl->EraseSize/SECTORSIZE ; block++) { |
@@ -353,7 +353,7 @@ static u16 INFTL_foldchain(struct INFTLrecord *inftl, unsigned thisVUC, unsigned | |||
353 | (block * SECTORSIZE), SECTORSIZE, | 353 | (block * SECTORSIZE), SECTORSIZE, |
354 | &retlen, movebuf); | 354 | &retlen, movebuf); |
355 | if (ret != -EIO) | 355 | if (ret != -EIO) |
356 | DEBUG(MTD_DEBUG_LEVEL1, "INFTL: error went " | 356 | pr_debug("INFTL: error went " |
357 | "away on retry?\n"); | 357 | "away on retry?\n"); |
358 | } | 358 | } |
359 | memset(&oob, 0xff, sizeof(struct inftl_oob)); | 359 | memset(&oob, 0xff, sizeof(struct inftl_oob)); |
@@ -370,7 +370,7 @@ static u16 INFTL_foldchain(struct INFTLrecord *inftl, unsigned thisVUC, unsigned | |||
370 | * is important, by doing oldest first if we crash/reboot then it | 370 | * is important, by doing oldest first if we crash/reboot then it |
371 | * it is relatively simple to clean up the mess). | 371 | * it is relatively simple to clean up the mess). |
372 | */ | 372 | */ |
373 | DEBUG(MTD_DEBUG_LEVEL1, "INFTL: want to erase virtual chain %d\n", | 373 | pr_debug("INFTL: want to erase virtual chain %d\n", |
374 | thisVUC); | 374 | thisVUC); |
375 | 375 | ||
376 | for (;;) { | 376 | for (;;) { |
@@ -419,7 +419,7 @@ static u16 INFTL_makefreeblock(struct INFTLrecord *inftl, unsigned pendingblock) | |||
419 | u16 ChainLength = 0, thislen; | 419 | u16 ChainLength = 0, thislen; |
420 | u16 chain, EUN; | 420 | u16 chain, EUN; |
421 | 421 | ||
422 | DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_makefreeblock(inftl=%p," | 422 | pr_debug("INFTL: INFTL_makefreeblock(inftl=%p," |
423 | "pending=%d)\n", inftl, pendingblock); | 423 | "pending=%d)\n", inftl, pendingblock); |
424 | 424 | ||
425 | for (chain = 0; chain < inftl->nb_blocks; chain++) { | 425 | for (chain = 0; chain < inftl->nb_blocks; chain++) { |
@@ -482,7 +482,7 @@ static inline u16 INFTL_findwriteunit(struct INFTLrecord *inftl, unsigned block) | |||
482 | size_t retlen; | 482 | size_t retlen; |
483 | int silly, silly2 = 3; | 483 | int silly, silly2 = 3; |
484 | 484 | ||
485 | DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_findwriteunit(inftl=%p," | 485 | pr_debug("INFTL: INFTL_findwriteunit(inftl=%p," |
486 | "block=%d)\n", inftl, block); | 486 | "block=%d)\n", inftl, block); |
487 | 487 | ||
488 | do { | 488 | do { |
@@ -499,7 +499,7 @@ static inline u16 INFTL_findwriteunit(struct INFTLrecord *inftl, unsigned block) | |||
499 | blockofs, 8, &retlen, (char *)&bci); | 499 | blockofs, 8, &retlen, (char *)&bci); |
500 | 500 | ||
501 | status = bci.Status | bci.Status1; | 501 | status = bci.Status | bci.Status1; |
502 | DEBUG(MTD_DEBUG_LEVEL3, "INFTL: status of block %d in " | 502 | pr_debug("INFTL: status of block %d in " |
503 | "EUN %d is %x\n", block , writeEUN, status); | 503 | "EUN %d is %x\n", block , writeEUN, status); |
504 | 504 | ||
505 | switch(status) { | 505 | switch(status) { |
@@ -553,7 +553,7 @@ hitused: | |||
553 | * Hopefully we free something, lets try again. | 553 | * Hopefully we free something, lets try again. |
554 | * This time we are desperate... | 554 | * This time we are desperate... |
555 | */ | 555 | */ |
556 | DEBUG(MTD_DEBUG_LEVEL1, "INFTL: using desperate==1 " | 556 | pr_debug("INFTL: using desperate==1 " |
557 | "to find free EUN to accommodate write to " | 557 | "to find free EUN to accommodate write to " |
558 | "VUC %d\n", thisVUC); | 558 | "VUC %d\n", thisVUC); |
559 | writeEUN = INFTL_findfreeblock(inftl, 1); | 559 | writeEUN = INFTL_findfreeblock(inftl, 1); |
@@ -645,7 +645,7 @@ static void INFTL_trydeletechain(struct INFTLrecord *inftl, unsigned thisVUC) | |||
645 | struct inftl_bci bci; | 645 | struct inftl_bci bci; |
646 | size_t retlen; | 646 | size_t retlen; |
647 | 647 | ||
648 | DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_trydeletechain(inftl=%p," | 648 | pr_debug("INFTL: INFTL_trydeletechain(inftl=%p," |
649 | "thisVUC=%d)\n", inftl, thisVUC); | 649 | "thisVUC=%d)\n", inftl, thisVUC); |
650 | 650 | ||
651 | memset(BlockUsed, 0, sizeof(BlockUsed)); | 651 | memset(BlockUsed, 0, sizeof(BlockUsed)); |
@@ -709,7 +709,7 @@ static void INFTL_trydeletechain(struct INFTLrecord *inftl, unsigned thisVUC) | |||
709 | * For each block in the chain free it and make it available | 709 | * For each block in the chain free it and make it available |
710 | * for future use. Erase from the oldest unit first. | 710 | * for future use. Erase from the oldest unit first. |
711 | */ | 711 | */ |
712 | DEBUG(MTD_DEBUG_LEVEL1, "INFTL: deleting empty VUC %d\n", thisVUC); | 712 | pr_debug("INFTL: deleting empty VUC %d\n", thisVUC); |
713 | 713 | ||
714 | for (;;) { | 714 | for (;;) { |
715 | u16 *prevEUN = &inftl->VUtable[thisVUC]; | 715 | u16 *prevEUN = &inftl->VUtable[thisVUC]; |
@@ -717,7 +717,7 @@ static void INFTL_trydeletechain(struct INFTLrecord *inftl, unsigned thisVUC) | |||
717 | 717 | ||
718 | /* If the chain is all gone already, we're done */ | 718 | /* If the chain is all gone already, we're done */ |
719 | if (thisEUN == BLOCK_NIL) { | 719 | if (thisEUN == BLOCK_NIL) { |
720 | DEBUG(MTD_DEBUG_LEVEL2, "INFTL: Empty VUC %d for deletion was already absent\n", thisEUN); | 720 | pr_debug("INFTL: Empty VUC %d for deletion was already absent\n", thisEUN); |
721 | return; | 721 | return; |
722 | } | 722 | } |
723 | 723 | ||
@@ -729,7 +729,7 @@ static void INFTL_trydeletechain(struct INFTLrecord *inftl, unsigned thisVUC) | |||
729 | thisEUN = *prevEUN; | 729 | thisEUN = *prevEUN; |
730 | } | 730 | } |
731 | 731 | ||
732 | DEBUG(MTD_DEBUG_LEVEL3, "Deleting EUN %d from VUC %d\n", | 732 | pr_debug("Deleting EUN %d from VUC %d\n", |
733 | thisEUN, thisVUC); | 733 | thisEUN, thisVUC); |
734 | 734 | ||
735 | if (INFTL_formatblock(inftl, thisEUN) < 0) { | 735 | if (INFTL_formatblock(inftl, thisEUN) < 0) { |
@@ -765,7 +765,7 @@ static int INFTL_deleteblock(struct INFTLrecord *inftl, unsigned block) | |||
765 | size_t retlen; | 765 | size_t retlen; |
766 | struct inftl_bci bci; | 766 | struct inftl_bci bci; |
767 | 767 | ||
768 | DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_deleteblock(inftl=%p," | 768 | pr_debug("INFTL: INFTL_deleteblock(inftl=%p," |
769 | "block=%d)\n", inftl, block); | 769 | "block=%d)\n", inftl, block); |
770 | 770 | ||
771 | while (thisEUN < inftl->nb_blocks) { | 771 | while (thisEUN < inftl->nb_blocks) { |
@@ -824,7 +824,7 @@ static int inftl_writeblock(struct mtd_blktrans_dev *mbd, unsigned long block, | |||
824 | struct inftl_oob oob; | 824 | struct inftl_oob oob; |
825 | char *p, *pend; | 825 | char *p, *pend; |
826 | 826 | ||
827 | DEBUG(MTD_DEBUG_LEVEL3, "INFTL: inftl_writeblock(inftl=%p,block=%ld," | 827 | pr_debug("INFTL: inftl_writeblock(inftl=%p,block=%ld," |
828 | "buffer=%p)\n", inftl, block, buffer); | 828 | "buffer=%p)\n", inftl, block, buffer); |
829 | 829 | ||
830 | /* Is block all zero? */ | 830 | /* Is block all zero? */ |
@@ -874,7 +874,7 @@ static int inftl_readblock(struct mtd_blktrans_dev *mbd, unsigned long block, | |||
874 | struct inftl_bci bci; | 874 | struct inftl_bci bci; |
875 | size_t retlen; | 875 | size_t retlen; |
876 | 876 | ||
877 | DEBUG(MTD_DEBUG_LEVEL3, "INFTL: inftl_readblock(inftl=%p,block=%ld," | 877 | pr_debug("INFTL: inftl_readblock(inftl=%p,block=%ld," |
878 | "buffer=%p)\n", inftl, block, buffer); | 878 | "buffer=%p)\n", inftl, block, buffer); |
879 | 879 | ||
880 | while (thisEUN < inftl->nb_blocks) { | 880 | while (thisEUN < inftl->nb_blocks) { |