ide: checkpatch.pl fixes for ide-lib.c

Fix following errors/warnings detected by checkpatch.pl:

- WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
- WARNING: space prohibited between function name and open parenthesis '('
- ERROR: trailing whitespace
- ERROR: trailing statements should be on next line
- WARNING: printk() should include KERN_ facility level
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent 047140ae
...@@ -43,7 +43,6 @@ const char *ide_xfer_verbose(u8 mode) ...@@ -43,7 +43,6 @@ const char *ide_xfer_verbose(u8 mode)
return s; return s;
} }
EXPORT_SYMBOL(ide_xfer_verbose); EXPORT_SYMBOL(ide_xfer_verbose);
/** /**
...@@ -87,7 +86,7 @@ static u8 ide_rate_filter(ide_drive_t *drive, u8 speed) ...@@ -87,7 +86,7 @@ static u8 ide_rate_filter(ide_drive_t *drive, u8 speed)
* This is used by most chipset support modules when "auto-tuning". * This is used by most chipset support modules when "auto-tuning".
*/ */
u8 ide_get_best_pio_mode (ide_drive_t *drive, u8 mode_wanted, u8 max_mode) u8 ide_get_best_pio_mode(ide_drive_t *drive, u8 mode_wanted, u8 max_mode)
{ {
u16 *id = drive->id; u16 *id = drive->id;
int pio_mode = -1, overridden = 0; int pio_mode = -1, overridden = 0;
...@@ -131,7 +130,6 @@ u8 ide_get_best_pio_mode (ide_drive_t *drive, u8 mode_wanted, u8 max_mode) ...@@ -131,7 +130,6 @@ u8 ide_get_best_pio_mode (ide_drive_t *drive, u8 mode_wanted, u8 max_mode)
return pio_mode; return pio_mode;
} }
EXPORT_SYMBOL_GPL(ide_get_best_pio_mode); EXPORT_SYMBOL_GPL(ide_get_best_pio_mode);
/* req_pio == "255" for auto-tune */ /* req_pio == "255" for auto-tune */
...@@ -162,7 +160,6 @@ void ide_set_pio(ide_drive_t *drive, u8 req_pio) ...@@ -162,7 +160,6 @@ void ide_set_pio(ide_drive_t *drive, u8 req_pio)
(void)ide_set_pio_mode(drive, XFER_PIO_0 + pio); (void)ide_set_pio_mode(drive, XFER_PIO_0 + pio);
} }
EXPORT_SYMBOL_GPL(ide_set_pio); EXPORT_SYMBOL_GPL(ide_set_pio);
/** /**
...@@ -243,7 +240,6 @@ int ide_set_dma_mode(ide_drive_t *drive, const u8 mode) ...@@ -243,7 +240,6 @@ int ide_set_dma_mode(ide_drive_t *drive, const u8 mode)
return ide_config_drive_speed(drive, mode); return ide_config_drive_speed(drive, mode);
} }
} }
EXPORT_SYMBOL_GPL(ide_set_dma_mode); EXPORT_SYMBOL_GPL(ide_set_dma_mode);
/** /**
...@@ -286,7 +282,7 @@ static void ide_dump_opcode(ide_drive_t *drive) ...@@ -286,7 +282,7 @@ static void ide_dump_opcode(ide_drive_t *drive)
if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE)
task = rq->special; task = rq->special;
printk("ide: failed opcode was: "); printk(KERN_ERR "ide: failed opcode was: ");
if (task == NULL) if (task == NULL)
printk(KERN_CONT "unknown\n"); printk(KERN_CONT "unknown\n");
else else
...@@ -324,44 +320,55 @@ static void ide_dump_sector(ide_drive_t *drive) ...@@ -324,44 +320,55 @@ static void ide_dump_sector(ide_drive_t *drive)
drive->hwif->tp_ops->tf_read(drive, &task); drive->hwif->tp_ops->tf_read(drive, &task);
if (lba48 || (tf->device & ATA_LBA)) if (lba48 || (tf->device & ATA_LBA))
printk(", LBAsect=%llu", printk(KERN_CONT ", LBAsect=%llu",
(unsigned long long)ide_get_lba_addr(tf, lba48)); (unsigned long long)ide_get_lba_addr(tf, lba48));
else else
printk(", CHS=%d/%d/%d", (tf->lbah << 8) + tf->lbam, printk(KERN_CONT ", CHS=%d/%d/%d", (tf->lbah << 8) + tf->lbam,
tf->device & 0xf, tf->lbal); tf->device & 0xf, tf->lbal);
} }
static void ide_dump_ata_error(ide_drive_t *drive, u8 err) static void ide_dump_ata_error(ide_drive_t *drive, u8 err)
{ {
printk("{ "); printk(KERN_ERR "{ ");
if (err & ATA_ABORTED) printk("DriveStatusError "); if (err & ATA_ABORTED)
printk(KERN_CONT "DriveStatusError ");
if (err & ATA_ICRC) if (err & ATA_ICRC)
printk((err & ATA_ABORTED) ? "BadCRC " : "BadSector "); printk(KERN_CONT "%s",
if (err & ATA_UNC) printk("UncorrectableError "); (err & ATA_ABORTED) ? "BadCRC " : "BadSector ");
if (err & ATA_IDNF) printk("SectorIdNotFound "); if (err & ATA_UNC)
if (err & ATA_TRK0NF) printk("TrackZeroNotFound "); printk(KERN_CONT "UncorrectableError ");
if (err & ATA_AMNF) printk("AddrMarkNotFound "); if (err & ATA_IDNF)
printk("}"); printk(KERN_CONT "SectorIdNotFound ");
if (err & ATA_TRK0NF)
printk(KERN_CONT "TrackZeroNotFound ");
if (err & ATA_AMNF)
printk(KERN_CONT "AddrMarkNotFound ");
printk(KERN_CONT "}");
if ((err & (ATA_BBK | ATA_ABORTED)) == ATA_BBK || if ((err & (ATA_BBK | ATA_ABORTED)) == ATA_BBK ||
(err & (ATA_UNC | ATA_IDNF | ATA_AMNF))) { (err & (ATA_UNC | ATA_IDNF | ATA_AMNF))) {
ide_dump_sector(drive); ide_dump_sector(drive);
if (HWGROUP(drive) && HWGROUP(drive)->rq) if (HWGROUP(drive) && HWGROUP(drive)->rq)
printk(", sector=%llu", printk(KERN_CONT ", sector=%llu",
(unsigned long long)HWGROUP(drive)->rq->sector); (unsigned long long)HWGROUP(drive)->rq->sector);
} }
printk("\n"); printk(KERN_CONT "\n");
} }
static void ide_dump_atapi_error(ide_drive_t *drive, u8 err) static void ide_dump_atapi_error(ide_drive_t *drive, u8 err)
{ {
printk("{ "); printk(KERN_ERR "{ ");
if (err & ATAPI_ILI) printk("IllegalLengthIndication "); if (err & ATAPI_ILI)
if (err & ATAPI_EOM) printk("EndOfMedia "); printk(KERN_CONT "IllegalLengthIndication ");
if (err & ATA_ABORTED) printk("AbortedCommand "); if (err & ATAPI_EOM)
if (err & ATA_MCR) printk("MediaChangeRequested "); printk(KERN_CONT "EndOfMedia ");
if (err & ATAPI_LFS) printk("LastFailedSense=0x%02x ", if (err & ATA_ABORTED)
printk(KERN_CONT "AbortedCommand ");
if (err & ATA_MCR)
printk(KERN_CONT "MediaChangeRequested ");
if (err & ATAPI_LFS)
printk(KERN_CONT "LastFailedSense=0x%02x ",
(err & ATAPI_LFS) >> 4); (err & ATAPI_LFS) >> 4);
printk("}\n"); printk(KERN_CONT "}\n");
} }
/** /**
...@@ -381,22 +388,29 @@ u8 ide_dump_status(ide_drive_t *drive, const char *msg, u8 stat) ...@@ -381,22 +388,29 @@ u8 ide_dump_status(ide_drive_t *drive, const char *msg, u8 stat)
u8 err = 0; u8 err = 0;
local_irq_save(flags); local_irq_save(flags);
printk("%s: %s: status=0x%02x { ", drive->name, msg, stat); printk(KERN_ERR "%s: %s: status=0x%02x { ", drive->name, msg, stat);
if (stat & ATA_BUSY) if (stat & ATA_BUSY)
printk("Busy "); printk(KERN_CONT "Busy ");
else { else {
if (stat & ATA_DRDY) printk("DriveReady "); if (stat & ATA_DRDY)
if (stat & ATA_DF) printk("DeviceFault "); printk(KERN_CONT "DriveReady ");
if (stat & ATA_DSC) printk("SeekComplete "); if (stat & ATA_DF)
if (stat & ATA_DRQ) printk("DataRequest "); printk(KERN_CONT "DeviceFault ");
if (stat & ATA_CORR) printk("CorrectedError "); if (stat & ATA_DSC)
if (stat & ATA_IDX) printk("Index "); printk(KERN_CONT "SeekComplete ");
if (stat & ATA_ERR) printk("Error "); if (stat & ATA_DRQ)
printk(KERN_CONT "DataRequest ");
if (stat & ATA_CORR)
printk(KERN_CONT "CorrectedError ");
if (stat & ATA_IDX)
printk(KERN_CONT "Index ");
if (stat & ATA_ERR)
printk(KERN_CONT "Error ");
} }
printk("}\n"); printk(KERN_CONT "}\n");
if ((stat & (ATA_BUSY | ATA_ERR)) == ATA_ERR) { if ((stat & (ATA_BUSY | ATA_ERR)) == ATA_ERR) {
err = ide_read_error(drive); err = ide_read_error(drive);
printk("%s: %s: error=0x%02x ", drive->name, msg, err); printk(KERN_ERR "%s: %s: error=0x%02x ", drive->name, msg, err);
if (drive->media == ide_disk) if (drive->media == ide_disk)
ide_dump_ata_error(drive, err); ide_dump_ata_error(drive, err);
else else
...@@ -406,5 +420,4 @@ u8 ide_dump_status(ide_drive_t *drive, const char *msg, u8 stat) ...@@ -406,5 +420,4 @@ u8 ide_dump_status(ide_drive_t *drive, const char *msg, u8 stat)
local_irq_restore(flags); local_irq_restore(flags);
return err; return err;
} }
EXPORT_SYMBOL(ide_dump_status); EXPORT_SYMBOL(ide_dump_status);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment