Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drivers: mtd: sm_ftl: Fix alignment of block comment

A star has been added to subsequent line of block comment
The closing */ has been shifted to new line
This is done to maintain code uniformity

Signed-off-by: Shubhankar Kuranagatti <shubhankarvk@gmail.com>
[<miquel.raynal@bootlin.com>: Fixed the title]
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20210504062059.mywqzwveyjfawreg@kewl-virtual-machine

authored by

Shubhankar Kuranagatti and committed by
Miquel Raynal
cc9d663a feb05fae

+32 -19
+32 -19
drivers/mtd/sm_ftl.c
··· 265 265 again: 266 266 if (try++) { 267 267 /* Avoid infinite recursion on CIS reads, sm_recheck_media 268 - won't help anyway */ 268 + * won't help anyway 269 + */ 269 270 if (zone == 0 && block == ftl->cis_block && boffset == 270 271 ftl->cis_boffset) 271 272 return ret; ··· 277 276 } 278 277 279 278 /* Unfortunately, oob read will _always_ succeed, 280 - despite card removal..... */ 279 + * despite card removal..... 280 + */ 281 281 ret = mtd_read_oob(mtd, sm_mkoffset(ftl, zone, block, boffset), &ops); 282 282 283 283 /* Test for unknown errors */ ··· 413 411 414 412 /* If write fails. try to erase the block */ 415 413 /* This is safe, because we never write in blocks 416 - that contain valuable data. 417 - This is intended to repair block that are marked 418 - as erased, but that isn't fully erased*/ 414 + * that contain valuable data. 415 + * This is intended to repair block that are marked 416 + * as erased, but that isn't fully erased 417 + */ 419 418 420 419 if (sm_erase_block(ftl, zone, block, 0)) 421 420 return -EIO; ··· 451 448 452 449 /* We aren't checking the return value, because we don't care */ 453 450 /* This also fails on fake xD cards, but I guess these won't expose 454 - any bad blocks till fail completely */ 451 + * any bad blocks till fail completely 452 + */ 455 453 for (boffset = 0; boffset < ftl->block_size; boffset += SM_SECTOR_SIZE) 456 454 sm_write_sector(ftl, zone, block, boffset, NULL, &oob); 457 455 } ··· 509 505 510 506 /* First just check that block doesn't look fishy */ 511 507 /* Only blocks that are valid or are sliced in two parts, are 512 - accepted */ 508 + * accepted 509 + */ 513 510 for (boffset = 0; boffset < ftl->block_size; 514 511 boffset += SM_SECTOR_SIZE) { 515 512 ··· 559 554 0x01, 0x03, 0xD9, 0x01, 0xFF, 0x18, 0x02, 0xDF, 0x01, 0x20 560 555 }; 561 556 /* Find out media parameters. 562 - * This ideally has to be based on nand id, but for now device size is enough */ 557 + * This ideally has to be based on nand id, but for now device size is enough 558 + */ 563 559 static int sm_get_media_info(struct sm_ftl *ftl, struct mtd_info *mtd) 564 560 { 565 561 int i; ··· 613 607 } 614 608 615 609 /* Minimum xD size is 16MiB. Also, all xD cards have standard zone 616 - sizes. SmartMedia cards exist up to 128 MiB and have same layout*/ 610 + * sizes. SmartMedia cards exist up to 128 MiB and have same layout 611 + */ 617 612 if (size_in_megs >= 16) { 618 613 ftl->zone_count = size_in_megs / 16; 619 614 ftl->zone_size = 1024; ··· 789 782 } 790 783 791 784 /* Test to see if block is erased. It is enough to test 792 - first sector, because erase happens in one shot */ 785 + * first sector, because erase happens in one shot 786 + */ 793 787 if (sm_block_erased(&oob)) { 794 788 kfifo_in(&zone->free_sectors, 795 789 (unsigned char *)&block, 2); ··· 800 792 /* If block is marked as bad, skip it */ 801 793 /* This assumes we can trust first sector*/ 802 794 /* However the way the block valid status is defined, ensures 803 - very low probability of failure here */ 795 + * very low probability of failure here 796 + */ 804 797 if (!sm_block_valid(&oob)) { 805 798 dbg("PH %04d <-> <marked bad>", block); 806 799 continue; ··· 812 803 813 804 /* Invalid LBA means that block is damaged. */ 814 805 /* We can try to erase it, or mark it as bad, but 815 - lets leave that to recovery application */ 806 + * lets leave that to recovery application 807 + */ 816 808 if (lba == -2 || lba >= ftl->max_lba) { 817 809 dbg("PH %04d <-> LBA %04d(bad)", block, lba); 818 810 continue; ··· 821 811 822 812 823 813 /* If there is no collision, 824 - just put the sector in the FTL table */ 814 + * just put the sector in the FTL table 815 + */ 825 816 if (zone->lba_to_phys_table[lba] < 0) { 826 817 dbg_verbose("PH %04d <-> LBA %04d", block, lba); 827 818 zone->lba_to_phys_table[lba] = block; ··· 845 834 } 846 835 847 836 /* If both blocks are valid and share same LBA, it means that 848 - they hold different versions of same data. It not 849 - known which is more recent, thus just erase one of them 850 - */ 837 + * they hold different versions of same data. It not 838 + * known which is more recent, thus just erase one of them 839 + */ 851 840 sm_printk("both blocks are valid, erasing the later"); 852 841 sm_erase_block(ftl, zone_num, block, 1); 853 842 } ··· 856 845 zone->initialized = 1; 857 846 858 847 /* No free sectors, means that the zone is heavily damaged, write won't 859 - work, but it can still can be (partially) read */ 848 + * work, but it can still can be (partially) read 849 + */ 860 850 if (!kfifo_len(&zone->free_sectors)) { 861 851 sm_printk("no free blocks in zone %d", zone_num); 862 852 return 0; ··· 964 952 965 953 /* If there are no spare blocks, */ 966 954 /* we could still continue by erasing/writing the current block, 967 - but for such worn out media it doesn't worth the trouble, 968 - and the dangers */ 955 + * but for such worn out media it doesn't worth the trouble, 956 + * and the dangers 957 + */ 969 958 if (kfifo_out(&zone->free_sectors, 970 959 (unsigned char *)&write_sector, 2) != 2) { 971 960 dbg("no free sectors for write!");