Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757047Ab1FDPqH (ORCPT ); Sat, 4 Jun 2011 11:46:07 -0400 Received: from faui40.informatik.uni-erlangen.de ([131.188.34.40]:48506 "EHLO faui40.informatik.uni-erlangen.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756773Ab1FDPps (ORCPT ); Sat, 4 Jun 2011 11:45:48 -0400 Date: Sat, 4 Jun 2011 17:36:10 +0200 From: Christian Dietrich To: Doug Gilbert , "James E.J. Bottomley" , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, trivial@kernel.org Subject: [PATCH 3/8] scsi/sg: use printk_ratelimited instead of printk_ratelimit Message-ID: <200c12c3d7ae259146549092a2abe211ec23138d.1307199715.git.christian.dietrich@informatik.uni-erlangen.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1947 Lines: 52 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 --- drivers/scsi/sg.c | 18 ++++++++++-------- 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 #include #include +#include #include "scsi.h" #include @@ -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); } } -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/