From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Keith Packard <keithp@keithp.com>
Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman <gregkh@suse.de>,
Keith Packard <keithp@keithp.com>
Subject: Re: [PATCH] usb/serial: Add compat_ioctl pass-through
Date: Fri, 28 Nov 2008 22:33:05 +0000 [thread overview]
Message-ID: <20081128223305.2d11f8d9@lxorguk.ukuu.org.uk> (raw)
In-Reply-To: <1227911282-8857-1-git-send-email-keithp@keithp.com>
On Fri, 28 Nov 2008 14:28:02 -0800
Keith Packard <keithp@keithp.com> wrote:
> USB serial devices with extended IOCTLs cannot be used in a 64-bit kernel
> from 32-bit user space as the compat_ioctl path is missing. This adds a
> pass-through so that drivers may offer this functionality. This requires
> that all drivers actually implement a compat_ioctl function if they want to
> support this operation.
>
> Signed-off-by: Keith Packard <keithp@keithp.com>
Would be far better to keep compatible ioctls anyway however that aside
clearly it should be passed on.
> +static int serial_compat_ioctl(struct tty_struct *tty, struct file *file,
> + unsigned int cmd, unsigned long arg)
> +{
> + struct usb_serial_port *port = tty->driver_data;
> + int retval = -ENODEV;
Can never be used only overwritten so why not replace with -ENOIOCTLCMD
and remove the else of the if
Also I get a CodingStyle whine about the port->serial-> side of the if
not needing { }
> + /* Called with bkl held */
> int (*ioctl)(struct tty_struct *tty, struct file *file,
> unsigned int cmd, unsigned long arg);
No... the ioctl path for tty comes from unlocked_ioctl so the BKL is not
held and should not be held.
Alan
next prev parent reply other threads:[~2008-11-28 22:33 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-27 8:29 Keith Packard
2008-11-27 8:29 ` [PATCH] usb/serial/cp2101: Add support for cp2103 GPIO pins Keith Packard
2008-11-27 10:58 ` Alan Cox
2008-11-27 18:20 ` Keith Packard
2008-11-27 18:41 ` Greg KH
2008-11-28 1:31 ` Keith Packard
2008-12-03 7:12 ` Greg KH
2008-12-03 8:11 ` Keith Packard
2008-11-27 14:31 ` [PATCH] usb/serial: Add compat_ioctl pass-through Arnd Bergmann
2008-11-27 18:27 ` Keith Packard
2008-11-28 11:43 ` Arnd Bergmann
2008-11-28 14:03 ` Alan Cox
2008-11-28 15:42 ` Arnd Bergmann
2008-11-28 22:28 ` Keith Packard
2008-11-28 22:33 ` Alan Cox [this message]
2008-11-29 1:02 ` Keith Packard
2008-11-29 1:10 ` Alan Cox
2008-11-29 1:23 ` Arjan van de Ven
2008-11-29 1:37 ` Alan Cox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081128223305.2d11f8d9@lxorguk.ukuu.org.uk \
--to=alan@lxorguk.ukuu.org.uk \
--cc=gregkh@suse.de \
--cc=keithp@keithp.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®