[PATCH 1/1] Char: mxser, ratelimit ioctl warning

From: Jiri Slaby
Date: Fri Jul 25 2008 - 04:42:58 EST


Get major ioctl prints out a warning, make it ratelimited.

Signed-off-by: Jiri Slaby <jirislaby@xxxxxxxxx>
Cc: Alan Cox <alan@xxxxxxxxxxxxxxxxxxx>
---
drivers/char/mxser.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c
index 48676ad..3c1ecd5 100644
--- a/drivers/char/mxser.c
+++ b/drivers/char/mxser.c
@@ -1631,8 +1631,10 @@ static int mxser_ioctl_special(unsigned int cmd, void __user *argp)

switch (cmd) {
case MOXA_GET_MAJOR:
- printk(KERN_WARNING "mxser: '%s' uses deprecated ioctl %x, fix "
- "your userspace\n", current->comm, cmd);
+ if (printk_ratelimit())
+ printk(KERN_WARNING "mxser: '%s' uses deprecated ioctl "
+ "%x (GET_MAJOR), fix your userspace\n",
+ current->comm, cmd);
return put_user(ttymajor, (int __user *)argp);

case MOXA_CHKPORTENABLE:
--
1.5.6.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/