From: Arnd Bergmann <arnd@arndb.de>
To: Keith Packard <keithp@keithp.com>, Alan Cox <alan@redhat.com>
Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman <gregkh@suse.de>
Subject: Re: [PATCH] usb/serial: Add compat_ioctl pass-through
Date: Fri, 28 Nov 2008 12:43:02 +0100 [thread overview]
Message-ID: <200811281243.02841.arnd@arndb.de> (raw)
In-Reply-To: <1227810424.4277.55.camel@aiko.keithp.com>
On Thursday 27 November 2008, Keith Packard wrote:
> On Thu, 2008-11-27 at 15:31 +0100, Arnd Bergmann wrote:
>
> > You should probably define compat_ioctl to return an int as well
> > so that it becomes possible to use the same function for both eventually.
>
> The existing tty layer compat_ioctl is defined to return long; is that
> also wrong?
Yes, this was a slight mistake that got introduced when file_operations->
compat_ioctl first appeared with a long return value. It doesn't really
hurt, but new compat_ioctl functions should just return the 'int' that
gets sent back to user space.
> > Then again, we can also drop the file argument, which is entirely unused
> > in all the usb-serial ioctls.
>
> I'm not sure it's worth the effort; if some future usb serial ioctl
> needs the argument, we'd end up changing every existing driver back. I
> assume there are some serial devices for which the file is relevant
> during ioctl.
I've just checked all tty device drivers. The only one using the file
pointer in ->ioctl, ->tiocmget and ->tiocmset is serial_core, which
passes it to tty_hung_up_p(). That could easily be changed to check
(tty->flags & TTY_HUPPED) AFAICT.
Maybe Alan can comment on this. I think the code would become cleaner
if we dropped the file argument to these three functions throughout
the tty layer, but it's probably not worth the pain to change themm
call.
> > Maybe the best way for now is to make the new compat_ioctl be
> > int compat_ioctl(struct tty_struct, unsigned int cmd, unsigned long arg);
> > and leave the old ioctl as it is. When we get around to pushing the
> > BKL down into ->ioctl, we can change the prototype at the same time
> > to warn potential out-of-tree drivers.
>
> Let's figure out what the right compat_ioctl interface is first and
> worry about fixing the existing ioctl interface later.
ok.
Arnd <><
next prev parent reply other threads:[~2008-11-28 11:43 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-27 8:29 [PATCH] usb/serial: Add compat_ioctl pass-through 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 [this message]
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
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=200811281243.02841.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=alan@redhat.com \
--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