Skip to content

Commit

Permalink
ide: icside.c: fix printk format string compile warning
Browse files Browse the repository at this point in the history
Use correct format string parameter for the peak datarate, and prevent
uninitialized use of cycle_time.

Signed-off-by: Christian Dietrich <christian.dietrich@informatik.uni-erlangen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Christian Dietrich authored and David S. Miller committed Jun 6, 2012
1 parent 32a527a commit 027253c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/ide/icside.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ static const struct ide_port_ops icside_v6_no_dma_port_ops = {
*/
static void icside_set_dma_mode(ide_hwif_t *hwif, ide_drive_t *drive)
{
unsigned long cycle_time;
unsigned long cycle_time = 0;
int use_dma_info = 0;
const u8 xfer_mode = drive->dma_mode;

Expand Down Expand Up @@ -271,9 +271,9 @@ static void icside_set_dma_mode(ide_hwif_t *hwif, ide_drive_t *drive)

ide_set_drivedata(drive, (void *)cycle_time);

printk("%s: %s selected (peak %dMB/s)\n", drive->name,
ide_xfer_verbose(xfer_mode),
2000 / (unsigned long)ide_get_drivedata(drive));
printk(KERN_INFO "%s: %s selected (peak %luMB/s)\n",
drive->name, ide_xfer_verbose(xfer_mode),
2000 / (cycle_time ? cycle_time : (unsigned long) -1));
}

static const struct ide_port_ops icside_v6_port_ops = {
Expand Down

0 comments on commit 027253c

Please sign in to comment.