summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sg.c
diff options
context:
space:
mode:
authorChristian Dietrich <christian.dietrich@informatik.uni-erlangen.de>2011-06-04 17:36:10 +0200
committerJiri Kosina <jkosina@suse.cz>2011-09-15 14:05:25 +0200
commit2fe038e33c3921512f5450e113c263a772939f4c (patch)
tree608a8aa550b54f9dbfafe6e9dc2f97ba788aa5f6 /drivers/scsi/sg.c
parenta28ee477e5e5e183fa0289841fd90f350a6e0415 (diff)
downloadop-kernel-dev-2fe038e33c3921512f5450e113c263a772939f4c.zip
op-kernel-dev-2fe038e33c3921512f5450e113c263a772939f4c.tar.gz
scsi/sg: use printk_ratelimited instead of printk_ratelimit
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>
Diffstat (limited to 'drivers/scsi/sg.c')
-rw-r--r--drivers/scsi/sg.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 909ed9e..441a1c5 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -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);
}
}
OpenPOWER on IntegriCloud