ide-cd: Improve "weird block size" error message
authorFrans Pop <elendil@planet.nl>
Tue, 23 Jun 2009 23:02:58 +0000 (16:02 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 24 Jun 2009 07:32:31 +0000 (00:32 -0700)
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>
drivers/ide/ide-cd.c

index a9a1bfb14e7c7eac013dc515ac9550797ec0ee80..f0ede5953af8b5f0146d3a7e5db7546d4d17833d 100644 (file)
@@ -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;
        }