block: use printk_once
authorMarcin Slusarz <marcin.slusarz@gmail.com>
Mon, 24 Aug 2009 08:56:38 +0000 (10:56 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Fri, 11 Sep 2009 12:34:33 +0000 (14:34 +0200)
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Tim Waugh <tim@cyberelk.net>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
drivers/block/paride/pcd.c
drivers/block/sx8.c
drivers/block/viodasd.c

index 911dfd98d813cf7ad23cdc44a77aad946580bfe0..9f3518c515a15c57168f9e5fd57b073812a997ba 100644 (file)
@@ -219,8 +219,6 @@ static int pcd_sector;              /* address of next requested sector */
 static int pcd_count;          /* number of blocks still to do */
 static char *pcd_buf;          /* buffer for request in progress */
 
-static int pcd_warned;         /* Have we logged a phase warning ? */
-
 /* kernel glue structures */
 
 static int pcd_block_open(struct block_device *bdev, fmode_t mode)
@@ -417,12 +415,10 @@ static int pcd_completion(struct pcd_unit *cd, char *buf, char *fun)
                                        printk
                                            ("%s: %s: Unexpected phase %d, d=%d, k=%d\n",
                                             cd->name, fun, p, d, k);
-                               if ((verbose < 2) && !pcd_warned) {
-                                       pcd_warned = 1;
-                                       printk
-                                           ("%s: WARNING: ATAPI phase errors\n",
-                                            cd->name);
-                               }
+                               if (verbose < 2)
+                                       printk_once(
+                                           "%s: WARNING: ATAPI phase errors\n",
+                                           cd->name);
                                mdelay(1);
                        }
                        if (k++ > PCD_TMO) {
index da403b6a7f434525a694fb139d58950d65769586..f5cd2e83ebcc6757992cd59834d5f2e9ebb1d183 100644 (file)
@@ -1564,15 +1564,13 @@ static int carm_init_shm(struct carm_host *host)
 
 static int carm_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
 {
-       static unsigned int printed_version;
        struct carm_host *host;
        unsigned int pci_dac;
        int rc;
        struct request_queue *q;
        unsigned int i;
 
-       if (!printed_version++)
-               printk(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n");
+       printk_once(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n");
 
        rc = pci_enable_device(pdev);
        if (rc)
index 390d69bb7c482ad1a79a09a42192575b692b4980..b441ce3832e9ff7a403fed425d79ca354aace97b 100644 (file)
@@ -416,15 +416,9 @@ retry:
                goto retry;
        }
        if (we.max_disk > (MAX_DISKNO - 1)) {
-               static int warned;
-
-               if (warned == 0) {
-                       warned++;
-                       printk(VIOD_KERN_INFO
-                               "Only examining the first %d "
-                               "of %d disks connected\n",
-                               MAX_DISKNO, we.max_disk + 1);
-               }
+               printk_once(VIOD_KERN_INFO
+                       "Only examining the first %d of %d disks connected\n",
+                       MAX_DISKNO, we.max_disk + 1);
        }
 
        /* Send the close event to OS/400.  We DON'T expect a response */