aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/inftlcore.c
diff options
context:
space:
mode:
authorBrian Norris <computersforpeace@gmail.com>2011-07-19 13:06:10 -0400
committerArtem Bityutskiy <artem.bityutskiy@intel.com>2011-09-11 08:02:16 -0400
commit0a32a10264d151bc2d1616d69edaf915aa728698 (patch)
treeb31eeb9c6c177fc58c848c6a993f961ea2506858 /drivers/mtd/inftlcore.c
parent289c05222172b51401dbbb017115655f241d94ab (diff)
mtd: cleanup style on pr_debug messages
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.c35
1 files changed, 16 insertions, 19 deletions
diff --git a/drivers/mtd/inftlcore.c b/drivers/mtd/inftlcore.c
index 232e11b1526c..21aa981e42cd 100644
--- a/drivers/mtd/inftlcore.c
+++ b/drivers/mtd/inftlcore.c
@@ -213,16 +213,16 @@ 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 pr_debug("INFTL: INFTL_findfreeblock(inftl=%p," 216 pr_debug("INFTL: INFTL_findfreeblock(inftl=%p,desperate=%d)\n",
217 "desperate=%d)\n", inftl, desperate); 217 inftl, desperate);
218 218
219 /* 219 /*
220 * Normally, we force a fold to happen before we run out of free 220 * Normally, we force a fold to happen before we run out of free
221 * blocks completely. 221 * blocks completely.
222 */ 222 */
223 if (!desperate && inftl->numfreeEUNs < 2) { 223 if (!desperate && inftl->numfreeEUNs < 2) {
224 pr_debug("INFTL: there are too few free " 224 pr_debug("INFTL: there are too few free EUNs (%d)\n",
225 "EUNs (%d)\n", inftl->numfreeEUNs); 225 inftl->numfreeEUNs);
226 return BLOCK_NIL; 226 return BLOCK_NIL;
227 } 227 }
228 228
@@ -257,8 +257,8 @@ 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 pr_debug("INFTL: INFTL_foldchain(inftl=%p,thisVUC=%d," 260 pr_debug("INFTL: INFTL_foldchain(inftl=%p,thisVUC=%d,pending=%d)\n",
261 "pending=%d)\n", inftl, thisVUC, pendingblock); 261 inftl, thisVUC, pendingblock);
262 262
263 memset(BlockMap, 0xff, sizeof(BlockMap)); 263 memset(BlockMap, 0xff, sizeof(BlockMap));
264 memset(BlockDeleted, 0, sizeof(BlockDeleted)); 264 memset(BlockDeleted, 0, sizeof(BlockDeleted));
@@ -321,8 +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 pr_debug("INFTL: folding chain %d into unit %d\n", 324 pr_debug("INFTL: folding chain %d into unit %d\n", thisVUC, targetEUN);
325 thisVUC, targetEUN);
326 325
327 for (block = 0; block < inftl->EraseSize/SECTORSIZE ; block++) { 326 for (block = 0; block < inftl->EraseSize/SECTORSIZE ; block++) {
328 unsigned char movebuf[SECTORSIZE]; 327 unsigned char movebuf[SECTORSIZE];
@@ -353,8 +352,7 @@ static u16 INFTL_foldchain(struct INFTLrecord *inftl, unsigned thisVUC, unsigned
353 (block * SECTORSIZE), SECTORSIZE, 352 (block * SECTORSIZE), SECTORSIZE,
354 &retlen, movebuf); 353 &retlen, movebuf);
355 if (ret != -EIO) 354 if (ret != -EIO)
356 pr_debug("INFTL: error went " 355 pr_debug("INFTL: error went away on retry?\n");
357 "away on retry?\n");
358 } 356 }
359 memset(&oob, 0xff, sizeof(struct inftl_oob)); 357 memset(&oob, 0xff, sizeof(struct inftl_oob));
360 oob.b.Status = oob.b.Status1 = SECTOR_USED; 358 oob.b.Status = oob.b.Status1 = SECTOR_USED;
@@ -370,8 +368,7 @@ static u16 INFTL_foldchain(struct INFTLrecord *inftl, unsigned thisVUC, unsigned
370 * is important, by doing oldest first if we crash/reboot then it 368 * is important, by doing oldest first if we crash/reboot then it
371 * it is relatively simple to clean up the mess). 369 * it is relatively simple to clean up the mess).
372 */ 370 */
373 pr_debug("INFTL: want to erase virtual chain %d\n", 371 pr_debug("INFTL: want to erase virtual chain %d\n", thisVUC);
374 thisVUC);
375 372
376 for (;;) { 373 for (;;) {
377 /* Find oldest unit in chain. */ 374 /* Find oldest unit in chain. */
@@ -482,8 +479,8 @@ static inline u16 INFTL_findwriteunit(struct INFTLrecord *inftl, unsigned block)
482 size_t retlen; 479 size_t retlen;
483 int silly, silly2 = 3; 480 int silly, silly2 = 3;
484 481
485 pr_debug("INFTL: INFTL_findwriteunit(inftl=%p," 482 pr_debug("INFTL: INFTL_findwriteunit(inftl=%p,block=%d)\n",
486 "block=%d)\n", inftl, block); 483 inftl, block);
487 484
488 do { 485 do {
489 /* 486 /*
@@ -499,8 +496,8 @@ static inline u16 INFTL_findwriteunit(struct INFTLrecord *inftl, unsigned block)
499 blockofs, 8, &retlen, (char *)&bci); 496 blockofs, 8, &retlen, (char *)&bci);
500 497
501 status = bci.Status | bci.Status1; 498 status = bci.Status | bci.Status1;
502 pr_debug("INFTL: status of block %d in " 499 pr_debug("INFTL: status of block %d in EUN %d is %x\n",
503 "EUN %d is %x\n", block , writeEUN, status); 500 block , writeEUN, status);
504 501
505 switch(status) { 502 switch(status) {
506 case SECTOR_FREE: 503 case SECTOR_FREE:
@@ -553,9 +550,9 @@ hitused:
553 * Hopefully we free something, lets try again. 550 * Hopefully we free something, lets try again.
554 * This time we are desperate... 551 * This time we are desperate...
555 */ 552 */
556 pr_debug("INFTL: using desperate==1 " 553 pr_debug("INFTL: using desperate==1 to find free EUN "
557 "to find free EUN to accommodate write to " 554 "to accommodate write to VUC %d\n",
558 "VUC %d\n", thisVUC); 555 thisVUC);
559 writeEUN = INFTL_findfreeblock(inftl, 1); 556 writeEUN = INFTL_findfreeblock(inftl, 1);
560 if (writeEUN == BLOCK_NIL) { 557 if (writeEUN == BLOCK_NIL) {
561 /* 558 /*