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

ide-disk: fix issues found by checkpatch.pl

There are no changes to the resulting drivers/ide/ide-disk.o binary file
(md5sum-s after and before the patch match).

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

+70 -50
+70 -50
drivers/ide/ide-disk.c
··· 16 16 17 17 #define IDEDISK_VERSION "1.18" 18 18 19 - //#define DEBUG 20 - 21 19 #include <linux/module.h> 22 20 #include <linux/types.h> 23 21 #include <linux/string.h> ··· 86 88 * 87 89 * It is called only once for each drive. 88 90 */ 89 - static int lba_capacity_is_ok (struct hd_driveid *id) 91 + static int lba_capacity_is_ok(struct hd_driveid *id) 90 92 { 91 93 unsigned long lba_sects, chs_sects, head, tail; 92 94 ··· 174 176 * __ide_do_rw_disk() issues READ and WRITE commands to a disk, 175 177 * using LBA if supported, or CHS otherwise, to address sectors. 176 178 */ 177 - static ide_startstop_t __ide_do_rw_disk(ide_drive_t *drive, struct request *rq, sector_t block) 179 + static ide_startstop_t __ide_do_rw_disk(ide_drive_t *drive, struct request *rq, 180 + sector_t block) 178 181 { 179 182 ide_hwif_t *hwif = HWIF(drive); 180 183 unsigned int dma = drive->using_dma; ··· 227 228 tf->device = (block >> 8) & 0xf; 228 229 } 229 230 } else { 230 - unsigned int sect,head,cyl,track; 231 + unsigned int sect, head, cyl, track; 232 + 231 233 track = (int)block / drive->sect; 232 234 sect = (int)block % drive->sect + 1; 233 235 head = track % drive->head; ··· 271 271 * 1073741822 == 549756 MB or 48bit addressing fake drive 272 272 */ 273 273 274 - static ide_startstop_t ide_do_rw_disk (ide_drive_t *drive, struct request *rq, sector_t block) 274 + static ide_startstop_t ide_do_rw_disk(ide_drive_t *drive, struct request *rq, 275 + sector_t block) 275 276 { 276 277 ide_hwif_t *hwif = HWIF(drive); 277 278 ··· 453 452 * in above order (i.e., if value of higher priority is available, 454 453 * reset will be ignored). 455 454 */ 456 - static void init_idedisk_capacity (ide_drive_t *drive) 455 + static void init_idedisk_capacity(ide_drive_t *drive) 457 456 { 458 457 struct hd_driveid *id = drive->id; 459 458 /* ··· 480 479 } 481 480 } 482 481 483 - static sector_t idedisk_capacity (ide_drive_t *drive) 482 + static sector_t idedisk_capacity(ide_drive_t *drive) 484 483 { 485 484 return drive->capacity64 - drive->sect0; 486 485 } ··· 525 524 int len; 526 525 527 526 if (drive->id_read) 528 - len = sprintf(out,"%i\n", drive->id->buf_size / 2); 527 + len = sprintf(out, "%i\n", drive->id->buf_size / 2); 529 528 else 530 - len = sprintf(out,"(none)\n"); 531 - PROC_IDE_READ_RETURN(page,start,off,count,eof,len); 529 + len = sprintf(out, "(none)\n"); 530 + 531 + PROC_IDE_READ_RETURN(page, start, off, count, eof, len); 532 532 } 533 533 534 534 static int proc_idedisk_read_capacity ··· 538 536 ide_drive_t*drive = (ide_drive_t *)data; 539 537 int len; 540 538 541 - len = sprintf(page,"%llu\n", (long long)idedisk_capacity(drive)); 542 - PROC_IDE_READ_RETURN(page,start,off,count,eof,len); 539 + len = sprintf(page, "%llu\n", (long long)idedisk_capacity(drive)); 540 + 541 + PROC_IDE_READ_RETURN(page, start, off, count, eof, len); 543 542 } 544 543 545 544 static int proc_idedisk_read_smart(char *page, char **start, off_t off, ··· 554 551 char *out = ((char *)val) + (SECTOR_WORDS * 4); 555 552 page = out; 556 553 do { 557 - out += sprintf(out, "%04x%c", le16_to_cpu(*val), (++i & 7) ? ' ' : '\n'); 554 + out += sprintf(out, "%04x%c", le16_to_cpu(*val), 555 + (++i & 7) ? ' ' : '\n'); 558 556 val += 1; 559 557 } while (i < (SECTOR_WORDS * 2)); 560 558 len = out - page; 561 559 } 562 - PROC_IDE_READ_RETURN(page,start,off,count,eof,len); 560 + 561 + PROC_IDE_READ_RETURN(page, start, off, count, eof, len); 563 562 } 564 563 565 564 static int proc_idedisk_read_sv ··· 625 620 if (drive->special.b.set_multmode) 626 621 return -EBUSY; 627 622 628 - ide_init_drive_cmd (&rq); 623 + ide_init_drive_cmd(&rq); 629 624 rq.cmd_type = REQ_TYPE_ATA_TASKFILE; 630 625 631 626 drive->mult_req = arg; 632 627 drive->special.b.set_multmode = 1; 633 - (void) ide_do_drive_cmd (drive, &rq, ide_wait); 628 + (void)ide_do_drive_cmd(drive, &rq, ide_wait); 629 + 634 630 return (drive->mult_count == arg) ? 0 : -EIO; 635 631 } 636 632 ··· 707 701 return err; 708 702 } 709 703 710 - static int do_idedisk_flushcache (ide_drive_t *drive) 704 + static int do_idedisk_flushcache(ide_drive_t *drive) 711 705 { 712 706 ide_task_t args; 713 707 ··· 720 714 return ide_no_data_taskfile(drive, &args); 721 715 } 722 716 723 - static int set_acoustic (ide_drive_t *drive, int arg) 717 + static int set_acoustic(ide_drive_t *drive, int arg) 724 718 { 725 719 ide_task_t args; 726 720 ··· 754 748 return 0; 755 749 756 750 if (!idedisk_supports_lba48(drive->id)) 757 - return -EIO; 751 + return -EIO; 758 752 drive->addressing = arg; 759 753 return 0; 760 754 } ··· 764 758 { 765 759 struct hd_driveid *id = drive->id; 766 760 767 - ide_add_setting(drive, "bios_cyl", SETTING_RW, TYPE_INT, 0, 65535, 1, 1, &drive->bios_cyl, NULL); 768 - ide_add_setting(drive, "bios_head", SETTING_RW, TYPE_BYTE, 0, 255, 1, 1, &drive->bios_head, NULL); 769 - ide_add_setting(drive, "bios_sect", SETTING_RW, TYPE_BYTE, 0, 63, 1, 1, &drive->bios_sect, NULL); 770 - ide_add_setting(drive, "address", SETTING_RW, TYPE_BYTE, 0, 2, 1, 1, &drive->addressing, set_lba_addressing); 771 - ide_add_setting(drive, "multcount", SETTING_RW, TYPE_BYTE, 0, id->max_multsect, 1, 1, &drive->mult_count, set_multcount); 772 - ide_add_setting(drive, "nowerr", SETTING_RW, TYPE_BYTE, 0, 1, 1, 1, &drive->nowerr, set_nowerr); 773 - ide_add_setting(drive, "lun", SETTING_RW, TYPE_INT, 0, 7, 1, 1, &drive->lun, NULL); 774 - ide_add_setting(drive, "wcache", SETTING_RW, TYPE_BYTE, 0, 1, 1, 1, &drive->wcache, write_cache); 775 - ide_add_setting(drive, "acoustic", SETTING_RW, TYPE_BYTE, 0, 254, 1, 1, &drive->acoustic, set_acoustic); 776 - ide_add_setting(drive, "failures", SETTING_RW, TYPE_INT, 0, 65535, 1, 1, &drive->failures, NULL); 777 - ide_add_setting(drive, "max_failures", SETTING_RW, TYPE_INT, 0, 65535, 1, 1, &drive->max_failures, NULL); 761 + ide_add_setting(drive, "bios_cyl", SETTING_RW, TYPE_INT, 0, 65535, 1, 1, 762 + &drive->bios_cyl, NULL); 763 + ide_add_setting(drive, "bios_head", SETTING_RW, TYPE_BYTE, 0, 255, 1, 1, 764 + &drive->bios_head, NULL); 765 + ide_add_setting(drive, "bios_sect", SETTING_RW, TYPE_BYTE, 0, 63, 1, 1, 766 + &drive->bios_sect, NULL); 767 + ide_add_setting(drive, "address", SETTING_RW, TYPE_BYTE, 0, 2, 1, 1, 768 + &drive->addressing, set_lba_addressing); 769 + ide_add_setting(drive, "multcount", SETTING_RW, TYPE_BYTE, 0, 770 + id->max_multsect, 1, 1, &drive->mult_count, 771 + set_multcount); 772 + ide_add_setting(drive, "nowerr", SETTING_RW, TYPE_BYTE, 0, 1, 1, 1, 773 + &drive->nowerr, set_nowerr); 774 + ide_add_setting(drive, "lun", SETTING_RW, TYPE_INT, 0, 7, 1, 1, 775 + &drive->lun, NULL); 776 + ide_add_setting(drive, "wcache", SETTING_RW, TYPE_BYTE, 0, 1, 1, 1, 777 + &drive->wcache, write_cache); 778 + ide_add_setting(drive, "acoustic", SETTING_RW, TYPE_BYTE, 0, 254, 1, 1, 779 + &drive->acoustic, set_acoustic); 780 + ide_add_setting(drive, "failures", SETTING_RW, TYPE_INT, 0, 65535, 1, 1, 781 + &drive->failures, NULL); 782 + ide_add_setting(drive, "max_failures", SETTING_RW, TYPE_INT, 0, 65535, 783 + 1, 1, &drive->max_failures, NULL); 778 784 } 779 785 #else 780 786 static inline void idedisk_add_settings(ide_drive_t *drive) { ; } 781 787 #endif 782 788 783 - static void idedisk_setup (ide_drive_t *drive) 789 + static void idedisk_setup(ide_drive_t *drive) 784 790 { 785 791 ide_hwif_t *hwif = drive->hwif; 786 792 struct hd_driveid *id = drive->id; ··· 805 787 806 788 if (drive->removable) { 807 789 /* 808 - * Removable disks (eg. SYQUEST); ignore 'WD' drives 790 + * Removable disks (eg. SYQUEST); ignore 'WD' drives 809 791 */ 810 - if (id->model[0] != 'W' || id->model[1] != 'D') { 792 + if (id->model[0] != 'W' || id->model[1] != 'D') 811 793 drive->doorlocking = 1; 812 - } 813 794 } 814 795 815 796 (void)set_lba_addressing(drive, 1); ··· 822 805 blk_queue_max_sectors(drive->queue, max_s); 823 806 } 824 807 825 - printk(KERN_INFO "%s: max request size: %dKiB\n", drive->name, drive->queue->max_sectors / 2); 808 + printk(KERN_INFO "%s: max request size: %dKiB\n", drive->name, 809 + drive->queue->max_sectors / 2); 826 810 827 811 /* calculate drive capacity, and select LBA if possible */ 828 - init_idedisk_capacity (drive); 812 + init_idedisk_capacity(drive); 829 813 830 814 /* limit drive capacity to 137GB if LBA48 cannot be used */ 831 815 if (drive->addressing == 0 && drive->capacity64 > 1ULL << 28) { ··· 839 821 840 822 if ((hwif->host_flags & IDE_HFLAG_NO_LBA48_DMA) && drive->addressing) { 841 823 if (drive->capacity64 > 1ULL << 28) { 842 - printk(KERN_INFO "%s: cannot use LBA48 DMA - PIO mode will" 843 - " be used for accessing sectors > %u\n", 844 - drive->name, 1 << 28); 824 + printk(KERN_INFO "%s: cannot use LBA48 DMA - PIO mode" 825 + " will be used for accessing sectors " 826 + "> %u\n", drive->name, 1 << 28); 845 827 } else 846 828 drive->addressing = 0; 847 829 } ··· 850 832 * if possible, give fdisk access to more of the drive, 851 833 * by correcting bios_cyls: 852 834 */ 853 - capacity = idedisk_capacity (drive); 835 + capacity = idedisk_capacity(drive); 836 + 854 837 if (!drive->forced_geom) { 855 838 856 839 if (idedisk_supports_lba48(drive->id)) { ··· 1007 988 struct ide_disk_obj *idkp; 1008 989 ide_drive_t *drive; 1009 990 1010 - if (!(idkp = ide_disk_get(disk))) 991 + idkp = ide_disk_get(disk); 992 + if (idkp == NULL) 1011 993 return -ENXIO; 1012 994 1013 995 drive = idkp->drive; ··· 1130 1110 } 1131 1111 1132 1112 static struct block_device_operations idedisk_ops = { 1133 - .owner = THIS_MODULE, 1134 - .open = idedisk_open, 1135 - .release = idedisk_release, 1136 - .ioctl = idedisk_ioctl, 1137 - .getgeo = idedisk_getgeo, 1138 - .media_changed = idedisk_media_changed, 1139 - .revalidate_disk= idedisk_revalidate_disk 1113 + .owner = THIS_MODULE, 1114 + .open = idedisk_open, 1115 + .release = idedisk_release, 1116 + .ioctl = idedisk_ioctl, 1117 + .getgeo = idedisk_getgeo, 1118 + .media_changed = idedisk_media_changed, 1119 + .revalidate_disk = idedisk_revalidate_disk 1140 1120 }; 1141 1121 1142 1122 MODULE_DESCRIPTION("ATA DISK Driver"); ··· 1199 1179 return -ENODEV; 1200 1180 } 1201 1181 1202 - static void __exit idedisk_exit (void) 1182 + static void __exit idedisk_exit(void) 1203 1183 { 1204 1184 driver_unregister(&idedisk_driver.gen_driver); 1205 1185 }