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>
This commit is contained in:
parent
799ee57ac8
commit
9841654949
|
@ -16,8 +16,6 @@
|
|||
|
||||
#define IDEDISK_VERSION "1.18"
|
||||
|
||||
//#define DEBUG
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/string.h>
|
||||
|
@ -176,7 +174,8 @@ static void ide_tf_set_cmd(ide_drive_t *drive, ide_task_t *task, u8 dma)
|
|||
* __ide_do_rw_disk() issues READ and WRITE commands to a disk,
|
||||
* using LBA if supported, or CHS otherwise, to address sectors.
|
||||
*/
|
||||
static ide_startstop_t __ide_do_rw_disk(ide_drive_t *drive, struct request *rq, sector_t block)
|
||||
static ide_startstop_t __ide_do_rw_disk(ide_drive_t *drive, struct request *rq,
|
||||
sector_t block)
|
||||
{
|
||||
ide_hwif_t *hwif = HWIF(drive);
|
||||
unsigned int dma = drive->using_dma;
|
||||
|
@ -229,6 +228,7 @@ static ide_startstop_t __ide_do_rw_disk(ide_drive_t *drive, struct request *rq,
|
|||
}
|
||||
} else {
|
||||
unsigned int sect, head, cyl, track;
|
||||
|
||||
track = (int)block / drive->sect;
|
||||
sect = (int)block % drive->sect + 1;
|
||||
head = track % drive->head;
|
||||
|
@ -271,7 +271,8 @@ static ide_startstop_t __ide_do_rw_disk(ide_drive_t *drive, struct request *rq,
|
|||
* 1073741822 == 549756 MB or 48bit addressing fake drive
|
||||
*/
|
||||
|
||||
static ide_startstop_t ide_do_rw_disk (ide_drive_t *drive, struct request *rq, sector_t block)
|
||||
static ide_startstop_t ide_do_rw_disk(ide_drive_t *drive, struct request *rq,
|
||||
sector_t block)
|
||||
{
|
||||
ide_hwif_t *hwif = HWIF(drive);
|
||||
|
||||
|
@ -527,6 +528,7 @@ static int proc_idedisk_read_cache
|
|||
len = sprintf(out, "%i\n", drive->id->buf_size / 2);
|
||||
else
|
||||
len = sprintf(out, "(none)\n");
|
||||
|
||||
PROC_IDE_READ_RETURN(page, start, off, count, eof, len);
|
||||
}
|
||||
|
||||
|
@ -537,6 +539,7 @@ static int proc_idedisk_read_capacity
|
|||
int len;
|
||||
|
||||
len = sprintf(page, "%llu\n", (long long)idedisk_capacity(drive));
|
||||
|
||||
PROC_IDE_READ_RETURN(page, start, off, count, eof, len);
|
||||
}
|
||||
|
||||
|
@ -551,11 +554,13 @@ static int proc_idedisk_read_smart(char *page, char **start, off_t off,
|
|||
char *out = ((char *)val) + (SECTOR_WORDS * 4);
|
||||
page = out;
|
||||
do {
|
||||
out += sprintf(out, "%04x%c", le16_to_cpu(*val), (++i & 7) ? ' ' : '\n');
|
||||
out += sprintf(out, "%04x%c", le16_to_cpu(*val),
|
||||
(++i & 7) ? ' ' : '\n');
|
||||
val += 1;
|
||||
} while (i < (SECTOR_WORDS * 2));
|
||||
len = out - page;
|
||||
}
|
||||
|
||||
PROC_IDE_READ_RETURN(page, start, off, count, eof, len);
|
||||
}
|
||||
|
||||
|
@ -626,6 +631,7 @@ static int set_multcount(ide_drive_t *drive, int arg)
|
|||
drive->mult_req = arg;
|
||||
drive->special.b.set_multmode = 1;
|
||||
(void)ide_do_drive_cmd(drive, &rq, ide_wait);
|
||||
|
||||
return (drive->mult_count == arg) ? 0 : -EIO;
|
||||
}
|
||||
|
||||
|
@ -758,17 +764,29 @@ static void idedisk_add_settings(ide_drive_t *drive)
|
|||
{
|
||||
struct hd_driveid *id = drive->id;
|
||||
|
||||
ide_add_setting(drive, "bios_cyl", SETTING_RW, TYPE_INT, 0, 65535, 1, 1, &drive->bios_cyl, NULL);
|
||||
ide_add_setting(drive, "bios_head", SETTING_RW, TYPE_BYTE, 0, 255, 1, 1, &drive->bios_head, NULL);
|
||||
ide_add_setting(drive, "bios_sect", SETTING_RW, TYPE_BYTE, 0, 63, 1, 1, &drive->bios_sect, NULL);
|
||||
ide_add_setting(drive, "address", SETTING_RW, TYPE_BYTE, 0, 2, 1, 1, &drive->addressing, set_lba_addressing);
|
||||
ide_add_setting(drive, "multcount", SETTING_RW, TYPE_BYTE, 0, id->max_multsect, 1, 1, &drive->mult_count, set_multcount);
|
||||
ide_add_setting(drive, "nowerr", SETTING_RW, TYPE_BYTE, 0, 1, 1, 1, &drive->nowerr, set_nowerr);
|
||||
ide_add_setting(drive, "lun", SETTING_RW, TYPE_INT, 0, 7, 1, 1, &drive->lun, NULL);
|
||||
ide_add_setting(drive, "wcache", SETTING_RW, TYPE_BYTE, 0, 1, 1, 1, &drive->wcache, write_cache);
|
||||
ide_add_setting(drive, "acoustic", SETTING_RW, TYPE_BYTE, 0, 254, 1, 1, &drive->acoustic, set_acoustic);
|
||||
ide_add_setting(drive, "failures", SETTING_RW, TYPE_INT, 0, 65535, 1, 1, &drive->failures, NULL);
|
||||
ide_add_setting(drive, "max_failures", SETTING_RW, TYPE_INT, 0, 65535, 1, 1, &drive->max_failures, NULL);
|
||||
ide_add_setting(drive, "bios_cyl", SETTING_RW, TYPE_INT, 0, 65535, 1, 1,
|
||||
&drive->bios_cyl, NULL);
|
||||
ide_add_setting(drive, "bios_head", SETTING_RW, TYPE_BYTE, 0, 255, 1, 1,
|
||||
&drive->bios_head, NULL);
|
||||
ide_add_setting(drive, "bios_sect", SETTING_RW, TYPE_BYTE, 0, 63, 1, 1,
|
||||
&drive->bios_sect, NULL);
|
||||
ide_add_setting(drive, "address", SETTING_RW, TYPE_BYTE, 0, 2, 1, 1,
|
||||
&drive->addressing, set_lba_addressing);
|
||||
ide_add_setting(drive, "multcount", SETTING_RW, TYPE_BYTE, 0,
|
||||
id->max_multsect, 1, 1, &drive->mult_count,
|
||||
set_multcount);
|
||||
ide_add_setting(drive, "nowerr", SETTING_RW, TYPE_BYTE, 0, 1, 1, 1,
|
||||
&drive->nowerr, set_nowerr);
|
||||
ide_add_setting(drive, "lun", SETTING_RW, TYPE_INT, 0, 7, 1, 1,
|
||||
&drive->lun, NULL);
|
||||
ide_add_setting(drive, "wcache", SETTING_RW, TYPE_BYTE, 0, 1, 1, 1,
|
||||
&drive->wcache, write_cache);
|
||||
ide_add_setting(drive, "acoustic", SETTING_RW, TYPE_BYTE, 0, 254, 1, 1,
|
||||
&drive->acoustic, set_acoustic);
|
||||
ide_add_setting(drive, "failures", SETTING_RW, TYPE_INT, 0, 65535, 1, 1,
|
||||
&drive->failures, NULL);
|
||||
ide_add_setting(drive, "max_failures", SETTING_RW, TYPE_INT, 0, 65535,
|
||||
1, 1, &drive->max_failures, NULL);
|
||||
}
|
||||
#else
|
||||
static inline void idedisk_add_settings(ide_drive_t *drive) { ; }
|
||||
|
@ -789,10 +807,9 @@ static void idedisk_setup (ide_drive_t *drive)
|
|||
/*
|
||||
* Removable disks (eg. SYQUEST); ignore 'WD' drives
|
||||
*/
|
||||
if (id->model[0] != 'W' || id->model[1] != 'D') {
|
||||
if (id->model[0] != 'W' || id->model[1] != 'D')
|
||||
drive->doorlocking = 1;
|
||||
}
|
||||
}
|
||||
|
||||
(void)set_lba_addressing(drive, 1);
|
||||
|
||||
|
@ -805,7 +822,8 @@ static void idedisk_setup (ide_drive_t *drive)
|
|||
blk_queue_max_sectors(drive->queue, max_s);
|
||||
}
|
||||
|
||||
printk(KERN_INFO "%s: max request size: %dKiB\n", drive->name, drive->queue->max_sectors / 2);
|
||||
printk(KERN_INFO "%s: max request size: %dKiB\n", drive->name,
|
||||
drive->queue->max_sectors / 2);
|
||||
|
||||
/* calculate drive capacity, and select LBA if possible */
|
||||
init_idedisk_capacity(drive);
|
||||
|
@ -821,9 +839,9 @@ static void idedisk_setup (ide_drive_t *drive)
|
|||
|
||||
if ((hwif->host_flags & IDE_HFLAG_NO_LBA48_DMA) && drive->addressing) {
|
||||
if (drive->capacity64 > 1ULL << 28) {
|
||||
printk(KERN_INFO "%s: cannot use LBA48 DMA - PIO mode will"
|
||||
" be used for accessing sectors > %u\n",
|
||||
drive->name, 1 << 28);
|
||||
printk(KERN_INFO "%s: cannot use LBA48 DMA - PIO mode"
|
||||
" will be used for accessing sectors "
|
||||
"> %u\n", drive->name, 1 << 28);
|
||||
} else
|
||||
drive->addressing = 0;
|
||||
}
|
||||
|
@ -833,6 +851,7 @@ static void idedisk_setup (ide_drive_t *drive)
|
|||
* by correcting bios_cyls:
|
||||
*/
|
||||
capacity = idedisk_capacity(drive);
|
||||
|
||||
if (!drive->forced_geom) {
|
||||
|
||||
if (idedisk_supports_lba48(drive->id)) {
|
||||
|
@ -988,7 +1007,8 @@ static int idedisk_open(struct inode *inode, struct file *filp)
|
|||
struct ide_disk_obj *idkp;
|
||||
ide_drive_t *drive;
|
||||
|
||||
if (!(idkp = ide_disk_get(disk)))
|
||||
idkp = ide_disk_get(disk);
|
||||
if (idkp == NULL)
|
||||
return -ENXIO;
|
||||
|
||||
drive = idkp->drive;
|
||||
|
|
Loading…
Reference in New Issue