scsi/sg: use printk_ratelimited instead of printk_ratelimit
authorChristian Dietrich <christian.dietrich@informatik.uni-erlangen.de>
Sat, 4 Jun 2011 15:36:10 +0000 (17:36 +0200)
committerJiri Kosina <jkosina@suse.cz>
Thu, 15 Sep 2011 12:05:25 +0000 (14:05 +0200)
Since printk_ratelimit() shouldn't be used anymore (see comment in
include/linux/printk.h), replace it with printk_ratelimited.

Signed-off-by: Christian Dietrich <christian.dietrich@informatik.uni-erlangen.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/scsi/sg.c

index 909ed9ed24c0fb25663ee09d5ac864628f220843..441a1c5b8974a2ffaf9d104924cdfa58daa54713 100644 (file)
@@ -50,6 +50,7 @@ static int sg_version_num = 30534;    /* 2 digits for each component */
 #include <linux/delay.h>
 #include <linux/blktrace_api.h>
 #include <linux/mutex.h>
+#include <linux/ratelimit.h>
 
 #include "scsi.h"
 #include <scsi/scsi_dbg.h>
@@ -626,14 +627,15 @@ sg_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos)
         */
        if (hp->dxfer_direction == SG_DXFER_TO_FROM_DEV) {
                static char cmd[TASK_COMM_LEN];
-               if (strcmp(current->comm, cmd) && printk_ratelimit()) {
-                       printk(KERN_WARNING
-                              "sg_write: data in/out %d/%d bytes for SCSI command 0x%x--"
-                              "guessing data in;\n   "
-                              "program %s not setting count and/or reply_len properly\n",
-                              old_hdr.reply_len - (int)SZ_SG_HEADER,
-                              input_size, (unsigned int) cmnd[0],
-                              current->comm);
+               if (strcmp(current->comm, cmd)) {
+                       printk_ratelimited(KERN_WARNING
+                                          "sg_write: data in/out %d/%d bytes "
+                                          "for SCSI command 0x%x-- guessing "
+                                          "data in;\n   program %s not setting "
+                                          "count and/or reply_len properly\n",
+                                          old_hdr.reply_len - (int)SZ_SG_HEADER,
+                                          input_size, (unsigned int) cmnd[0],
+                                          current->comm);
                        strcpy(cmd, current->comm);
                }
        }