提交 2fe038e3 编写于 作者: C Christian Dietrich 提交者: Jiri Kosina

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: NChristian Dietrich <christian.dietrich@informatik.uni-erlangen.de>
Signed-off-by: NJiri Kosina <jkosina@suse.cz>
上级 a28ee477
...@@ -50,6 +50,7 @@ static int sg_version_num = 30534; /* 2 digits for each component */ ...@@ -50,6 +50,7 @@ static int sg_version_num = 30534; /* 2 digits for each component */
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/blktrace_api.h> #include <linux/blktrace_api.h>
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/ratelimit.h>
#include "scsi.h" #include "scsi.h"
#include <scsi/scsi_dbg.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) ...@@ -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) { if (hp->dxfer_direction == SG_DXFER_TO_FROM_DEV) {
static char cmd[TASK_COMM_LEN]; static char cmd[TASK_COMM_LEN];
if (strcmp(current->comm, cmd) && printk_ratelimit()) { if (strcmp(current->comm, cmd)) {
printk(KERN_WARNING printk_ratelimited(KERN_WARNING
"sg_write: data in/out %d/%d bytes for SCSI command 0x%x--" "sg_write: data in/out %d/%d bytes "
"guessing data in;\n " "for SCSI command 0x%x-- guessing "
"program %s not setting count and/or reply_len properly\n", "data in;\n program %s not setting "
old_hdr.reply_len - (int)SZ_SG_HEADER, "count and/or reply_len properly\n",
input_size, (unsigned int) cmnd[0], old_hdr.reply_len - (int)SZ_SG_HEADER,
current->comm); input_size, (unsigned int) cmnd[0],
current->comm);
strcpy(cmd, current->comm); strcpy(cmd, current->comm);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册