Skip to content

Commit

Permalink
ide-cd: Improve "weird block size" error message
Browse files Browse the repository at this point in the history
Currently the error gets repeated too frequently, for example each
time HAL polls the device when a disc is present. Avoid that by using
printk_once instead of printk.

Also join the error and corrective action messages into a single line.

Signed-off-by: Frans Pop <elendil@planet.nl>
Acked-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Frans Pop authored and David S. Miller committed Jun 24, 2009
1 parent af054ed commit d9ae624
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/ide/ide-cd.c
Original file line number Diff line number Diff line change
Expand Up @@ -889,10 +889,9 @@ static int cdrom_read_capacity(ide_drive_t *drive, unsigned long *capacity,
case 4096:
break;
default:
printk(KERN_ERR PFX "%s: weird block size %u\n",
printk_once(KERN_ERR PFX "%s: weird block size %u; "
"setting default block size to 2048\n",
drive->name, blocklen);
printk(KERN_ERR PFX "%s: default to 2kb block size\n",
drive->name);
blocklen = 2048;
break;
}
Expand Down

0 comments on commit d9ae624

Please sign in to comment.