Skip to content

Commit 0a32a10

Browse files
computersforpeacededekind
authored andcommitted
mtd: cleanup style on pr_debug messages
Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
1 parent 289c052 commit 0a32a10

9 files changed

Lines changed: 66 additions & 78 deletions

File tree

‎drivers/mtd/chips/cfi_cmdset_0002.c‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -440,8 +440,8 @@ struct mtd_info *cfi_cmdset_0002(struct map_info *map, int primary)
440440
mtd->writesize = 1;
441441
mtd->writebufsize = cfi_interleave(cfi) << cfi->cfiq->MaxBufWriteSize;
442442

443-
pr_debug("MTD %s(): write buffer size %d\n",
444-
__func__, mtd->writebufsize);
443+
pr_debug("MTD %s(): write buffer size %d\n", __func__,
444+
mtd->writebufsize);
445445

446446
mtd->reboot_notifier.notifier_call = cfi_amdstd_reboot;
447447

@@ -1798,8 +1798,7 @@ static int do_atmel_lock(struct map_info *map, struct flchip *chip,
17981798
goto out_unlock;
17991799
chip->state = FL_LOCKING;
18001800

1801-
pr_debug("MTD %s(): LOCK 0x%08lx len %d\n",
1802-
__func__, adr, len);
1801+
pr_debug("MTD %s(): LOCK 0x%08lx len %d\n", __func__, adr, len);
18031802

18041803
cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chip->start, map, cfi,
18051804
cfi->device_type, NULL);
@@ -1834,8 +1833,7 @@ static int do_atmel_unlock(struct map_info *map, struct flchip *chip,
18341833
goto out_unlock;
18351834
chip->state = FL_UNLOCKING;
18361835

1837-
pr_debug("MTD %s(): LOCK 0x%08lx len %d\n",
1838-
__func__, adr, len);
1836+
pr_debug("MTD %s(): LOCK 0x%08lx len %d\n", __func__, adr, len);
18391837

18401838
cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chip->start, map, cfi,
18411839
cfi->device_type, NULL);

‎drivers/mtd/devices/m25p80.c‎

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,8 @@ static int wait_till_ready(struct m25p *flash)
208208
*/
209209
static int erase_chip(struct m25p *flash)
210210
{
211-
pr_debug("%s: %s %lldKiB\n",
212-
dev_name(&flash->spi->dev), __func__,
213-
(long long)(flash->mtd.size >> 10));
211+
pr_debug("%s: %s %lldKiB\n", dev_name(&flash->spi->dev), __func__,
212+
(long long)(flash->mtd.size >> 10));
214213

215214
/* Wait until finished previous write command. */
216215
if (wait_till_ready(flash))
@@ -249,9 +248,8 @@ static int m25p_cmdsz(struct m25p *flash)
249248
*/
250249
static int erase_sector(struct m25p *flash, u32 offset)
251250
{
252-
pr_debug("%s: %s %dKiB at 0x%08x\n",
253-
dev_name(&flash->spi->dev), __func__,
254-
flash->mtd.erasesize / 1024, offset);
251+
pr_debug("%s: %s %dKiB at 0x%08x\n", dev_name(&flash->spi->dev),
252+
__func__, flash->mtd.erasesize / 1024, offset);
255253

256254
/* Wait until finished previous write command. */
257255
if (wait_till_ready(flash))
@@ -285,9 +283,9 @@ static int m25p80_erase(struct mtd_info *mtd, struct erase_info *instr)
285283
u32 addr,len;
286284
uint32_t rem;
287285

288-
pr_debug("%s: %s %s 0x%llx, len %lld\n",
289-
dev_name(&flash->spi->dev), __func__, "at",
290-
(long long)instr->addr, (long long)instr->len);
286+
pr_debug("%s: %s at 0x%llx, len %lld\n", dev_name(&flash->spi->dev),
287+
__func__, (long long)instr->addr,
288+
(long long)instr->len);
291289

292290
/* sanity checks */
293291
if (instr->addr + instr->len > flash->mtd.size)
@@ -347,9 +345,8 @@ static int m25p80_read(struct mtd_info *mtd, loff_t from, size_t len,
347345
struct spi_transfer t[2];
348346
struct spi_message m;
349347

350-
pr_debug("%s: %s %s 0x%08x, len %zd\n",
351-
dev_name(&flash->spi->dev), __func__, "from",
352-
(u32)from, len);
348+
pr_debug("%s: %s from 0x%08x, len %zd\n", dev_name(&flash->spi->dev),
349+
__func__, (u32)from, len);
353350

354351
/* sanity checks */
355352
if (!len)
@@ -416,9 +413,8 @@ static int m25p80_write(struct mtd_info *mtd, loff_t to, size_t len,
416413
struct spi_transfer t[2];
417414
struct spi_message m;
418415

419-
pr_debug("%s: %s %s 0x%08x, len %zd\n",
420-
dev_name(&flash->spi->dev), __func__, "to",
421-
(u32)to, len);
416+
pr_debug("%s: %s to 0x%08x, len %zd\n", dev_name(&flash->spi->dev),
417+
__func__, (u32)to, len);
422418

423419
*retlen = 0;
424420

@@ -509,9 +505,8 @@ static int sst_write(struct mtd_info *mtd, loff_t to, size_t len,
509505
size_t actual;
510506
int cmd_sz, ret;
511507

512-
pr_debug("%s: %s %s 0x%08x, len %zd\n",
513-
dev_name(&flash->spi->dev), __func__, "to",
514-
(u32)to, len);
508+
pr_debug("%s: %s to 0x%08x, len %zd\n", dev_name(&flash->spi->dev),
509+
__func__, (u32)to, len);
515510

516511
*retlen = 0;
517512

@@ -788,7 +783,7 @@ static const struct spi_device_id *__devinit jedec_probe(struct spi_device *spi)
788783
tmp = spi_write_then_read(spi, &code, 1, id, 5);
789784
if (tmp < 0) {
790785
pr_debug("%s: error %d reading JEDEC ID\n",
791-
dev_name(&spi->dev), tmp);
786+
dev_name(&spi->dev), tmp);
792787
return ERR_PTR(tmp);
793788
}
794789
jedec = id[0];

‎drivers/mtd/devices/mtd_dataflash.c‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,8 @@ static int dataflash_read(struct mtd_info *mtd, loff_t from, size_t len,
249249
uint8_t *command;
250250
int status;
251251

252-
pr_debug("%s: read 0x%x..0x%x\n",
253-
dev_name(&priv->spi->dev), (unsigned)from, (unsigned)(from + len));
252+
pr_debug("%s: read 0x%x..0x%x\n", dev_name(&priv->spi->dev),
253+
(unsigned)from, (unsigned)(from + len));
254254

255255
*retlen = 0;
256256

@@ -384,7 +384,7 @@ static int dataflash_write(struct mtd_info *mtd, loff_t to, size_t len,
384384

385385
status = spi_sync(spi, &msg);
386386
if (status < 0)
387-
pr_debug("%s: xfer %u -> %d \n",
387+
pr_debug("%s: xfer %u -> %d\n",
388388
dev_name(&spi->dev), addr, status);
389389

390390
(void) dataflash_waitready(priv->spi);
@@ -406,7 +406,7 @@ static int dataflash_write(struct mtd_info *mtd, loff_t to, size_t len,
406406
status = spi_sync(spi, &msg);
407407
spi_transfer_del(x + 1);
408408
if (status < 0)
409-
pr_debug("%s: pgm %u/%u -> %d \n",
409+
pr_debug("%s: pgm %u/%u -> %d\n",
410410
dev_name(&spi->dev), addr, writelen, status);
411411

412412
(void) dataflash_waitready(priv->spi);
@@ -426,7 +426,7 @@ static int dataflash_write(struct mtd_info *mtd, loff_t to, size_t len,
426426

427427
status = spi_sync(spi, &msg);
428428
if (status < 0)
429-
pr_debug("%s: compare %u -> %d \n",
429+
pr_debug("%s: compare %u -> %d\n",
430430
dev_name(&spi->dev), addr, status);
431431

432432
status = dataflash_waitready(priv->spi);
@@ -906,14 +906,14 @@ static int __devinit dataflash_probe(struct spi_device *spi)
906906
break;
907907
/* obsolete AT45DB1282 not (yet?) supported */
908908
default:
909-
pr_debug("%s: unsupported device (%x)\n",
910-
dev_name(&spi->dev), status & 0x3c);
909+
pr_debug("%s: unsupported device (%x)\n", dev_name(&spi->dev),
910+
status & 0x3c);
911911
status = -ENODEV;
912912
}
913913

914914
if (status < 0)
915-
pr_debug("%s: add_dataflash --> %d\n",
916-
dev_name(&spi->dev), status);
915+
pr_debug("%s: add_dataflash --> %d\n", dev_name(&spi->dev),
916+
status);
917917

918918
return status;
919919
}

‎drivers/mtd/inftlcore.c‎

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -213,16 +213,16 @@ static u16 INFTL_findfreeblock(struct INFTLrecord *inftl, int desperate)
213213
u16 pot = inftl->LastFreeEUN;
214214
int silly = inftl->nb_blocks;
215215

216-
pr_debug("INFTL: INFTL_findfreeblock(inftl=%p,"
217-
"desperate=%d)\n", inftl, desperate);
216+
pr_debug("INFTL: INFTL_findfreeblock(inftl=%p,desperate=%d)\n",
217+
inftl, desperate);
218218

219219
/*
220220
* Normally, we force a fold to happen before we run out of free
221221
* blocks completely.
222222
*/
223223
if (!desperate && inftl->numfreeEUNs < 2) {
224-
pr_debug("INFTL: there are too few free "
225-
"EUNs (%d)\n", inftl->numfreeEUNs);
224+
pr_debug("INFTL: there are too few free EUNs (%d)\n",
225+
inftl->numfreeEUNs);
226226
return BLOCK_NIL;
227227
}
228228

@@ -257,8 +257,8 @@ static u16 INFTL_foldchain(struct INFTLrecord *inftl, unsigned thisVUC, unsigned
257257
struct inftl_oob oob;
258258
size_t retlen;
259259

260-
pr_debug("INFTL: INFTL_foldchain(inftl=%p,thisVUC=%d,"
261-
"pending=%d)\n", inftl, thisVUC, pendingblock);
260+
pr_debug("INFTL: INFTL_foldchain(inftl=%p,thisVUC=%d,pending=%d)\n",
261+
inftl, thisVUC, pendingblock);
262262

263263
memset(BlockMap, 0xff, sizeof(BlockMap));
264264
memset(BlockDeleted, 0, sizeof(BlockDeleted));
@@ -321,8 +321,7 @@ static u16 INFTL_foldchain(struct INFTLrecord *inftl, unsigned thisVUC, unsigned
321321
* Chain, and the Erase Unit into which we are supposed to be copying.
322322
* Go for it.
323323
*/
324-
pr_debug("INFTL: folding chain %d into unit %d\n",
325-
thisVUC, targetEUN);
324+
pr_debug("INFTL: folding chain %d into unit %d\n", thisVUC, targetEUN);
326325

327326
for (block = 0; block < inftl->EraseSize/SECTORSIZE ; block++) {
328327
unsigned char movebuf[SECTORSIZE];
@@ -353,8 +352,7 @@ static u16 INFTL_foldchain(struct INFTLrecord *inftl, unsigned thisVUC, unsigned
353352
(block * SECTORSIZE), SECTORSIZE,
354353
&retlen, movebuf);
355354
if (ret != -EIO)
356-
pr_debug("INFTL: error went "
357-
"away on retry?\n");
355+
pr_debug("INFTL: error went away on retry?\n");
358356
}
359357
memset(&oob, 0xff, sizeof(struct inftl_oob));
360358
oob.b.Status = oob.b.Status1 = SECTOR_USED;
@@ -370,8 +368,7 @@ static u16 INFTL_foldchain(struct INFTLrecord *inftl, unsigned thisVUC, unsigned
370368
* is important, by doing oldest first if we crash/reboot then it
371369
* it is relatively simple to clean up the mess).
372370
*/
373-
pr_debug("INFTL: want to erase virtual chain %d\n",
374-
thisVUC);
371+
pr_debug("INFTL: want to erase virtual chain %d\n", thisVUC);
375372

376373
for (;;) {
377374
/* Find oldest unit in chain. */
@@ -482,8 +479,8 @@ static inline u16 INFTL_findwriteunit(struct INFTLrecord *inftl, unsigned block)
482479
size_t retlen;
483480
int silly, silly2 = 3;
484481

485-
pr_debug("INFTL: INFTL_findwriteunit(inftl=%p,"
486-
"block=%d)\n", inftl, block);
482+
pr_debug("INFTL: INFTL_findwriteunit(inftl=%p,block=%d)\n",
483+
inftl, block);
487484

488485
do {
489486
/*
@@ -499,8 +496,8 @@ static inline u16 INFTL_findwriteunit(struct INFTLrecord *inftl, unsigned block)
499496
blockofs, 8, &retlen, (char *)&bci);
500497

501498
status = bci.Status | bci.Status1;
502-
pr_debug("INFTL: status of block %d in "
503-
"EUN %d is %x\n", block , writeEUN, status);
499+
pr_debug("INFTL: status of block %d in EUN %d is %x\n",
500+
block , writeEUN, status);
504501

505502
switch(status) {
506503
case SECTOR_FREE:
@@ -553,9 +550,9 @@ static inline u16 INFTL_findwriteunit(struct INFTLrecord *inftl, unsigned block)
553550
* Hopefully we free something, lets try again.
554551
* This time we are desperate...
555552
*/
556-
pr_debug("INFTL: using desperate==1 "
557-
"to find free EUN to accommodate write to "
558-
"VUC %d\n", thisVUC);
553+
pr_debug("INFTL: using desperate==1 to find free EUN "
554+
"to accommodate write to VUC %d\n",
555+
thisVUC);
559556
writeEUN = INFTL_findfreeblock(inftl, 1);
560557
if (writeEUN == BLOCK_NIL) {
561558
/*

‎drivers/mtd/inftlmount.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,8 +385,7 @@ int INFTL_formatblock(struct INFTLrecord *inftl, int block)
385385
struct mtd_info *mtd = inftl->mbd.mtd;
386386
int physblock;
387387

388-
pr_debug("INFTL: INFTL_formatblock(inftl=%p,"
389-
"block=%d)\n", inftl, block);
388+
pr_debug("INFTL: INFTL_formatblock(inftl=%p,block=%d)\n", inftl, block);
390389

391390
memset(instr, 0, sizeof(struct erase_info));
392391

‎drivers/mtd/nand/mxc_nand.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,7 @@ static void wait_op_done(struct mxc_nand_host *host, int useirq)
349349
udelay(1);
350350
}
351351
if (max_retries < 0)
352-
pr_debug("%s: INT not set\n",
353-
__func__);
352+
pr_debug("%s: INT not set\n", __func__);
354353
}
355354
}
356355

@@ -386,8 +385,7 @@ static void send_cmd_v1_v2(struct mxc_nand_host *host, uint16_t cmd, int useirq)
386385
udelay(1);
387386
}
388387
if (max_retries < 0)
389-
pr_debug("%s: RESET failed\n",
390-
__func__);
388+
pr_debug("%s: RESET failed\n", __func__);
391389
} else {
392390
/* Wait for operation to complete */
393391
wait_op_done(host, useirq);

‎drivers/mtd/nand/nand_bch.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ int nand_bch_correct_data(struct mtd_info *mtd, unsigned char *buf,
9393
buf[errloc[i] >> 3] ^= (1 << (errloc[i] & 7));
9494
/* else error in ecc, no action needed */
9595

96-
pr_debug("%s: corrected bitflip %u\n",
97-
__func__, errloc[i]);
96+
pr_debug("%s: corrected bitflip %u\n", __func__,
97+
errloc[i]);
9898
}
9999
} else if (count < 0) {
100100
printk(KERN_ERR "ecc unrecoverable error\n");

‎drivers/mtd/nand/omap2.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -763,8 +763,8 @@ static int omap_compare_ecc(u8 *ecc_data1, /* read from NAND memory */
763763

764764
find_bit = (ecc_bit[5] << 2) + (ecc_bit[3] << 1) + ecc_bit[1];
765765

766-
pr_debug("Correcting single bit ECC error at "
767-
"offset: %d, bit: %d\n", find_byte, find_bit);
766+
pr_debug("Correcting single bit ECC error at offset: "
767+
"%d, bit: %d\n", find_byte, find_bit);
768768

769769
page_data[find_byte] ^= (1 << find_bit);
770770

0 commit comments

Comments
 (0)