Browse Source

Char: mxser, ratelimit ioctl warning

The GET_MAJOR ioctl prints out a warning, make it ratelimited.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Acked-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Jiri Slaby 17 years ago
parent
commit
8f3d137e0d
1 changed files with 4 additions and 2 deletions
  1. 4 2
      drivers/char/mxser.c

+ 4 - 2
drivers/char/mxser.c

@@ -1612,8 +1612,10 @@ static int mxser_ioctl_special(unsigned int cmd, void __user *argp)
 
 
 	switch (cmd) {
 	switch (cmd) {
 	case MOXA_GET_MAJOR:
 	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);
 		return put_user(ttymajor, (int __user *)argp);
 
 
 	case MOXA_CHKPORTENABLE:
 	case MOXA_CHKPORTENABLE: