All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] TTY: export NR_LDISC and N_* line discipline numbers to user-space
@ 2011-05-24  8:43 Florian Fainelli
  2011-05-24 12:40 ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Florian Fainelli @ 2011-05-24  8:43 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: lkml, Maxime Bizon

From: Florian Fainelli <ffainelli@freebox.fr>

Since commit (4564f9e5: consolidate line discipline number definitions)
the patch moved all line discipline number from a per-architecture termios.h
to a shared one: tty.h. However, prior to this consolidation work, the
line discipline numbers were outside of an ifdef __KERNEL__/endif block
so these numbers used to be exported to user-space.

Since such numbers are kernel ABI anyway, and tty.h is already included
for user- space header processing, just move these relevant defines
outside of the ifdef __KERNEL__/endif block in include/linux/tty.h.

CC: Maxime Bizon <mbizon@freebox.fr>
Signed-off-by: Florian Fainelli <ffainelli@freebox.fr>
---
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 9f469c7..272dc9a 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -5,24 +5,6 @@
  * 'tty.h' defines some structures used by tty_io.c and some defines.
  */
 
-#ifdef __KERNEL__
-#include <linux/fs.h>
-#include <linux/major.h>
-#include <linux/termios.h>
-#include <linux/workqueue.h>
-#include <linux/tty_driver.h>
-#include <linux/tty_ldisc.h>
-#include <linux/mutex.h>
-
-#include <asm/system.h>
-
-
-/*
- * (Note: the *_driver.minor_start values 1, 64, 128, 192 are
- * hardcoded at present.)
- */
-#define NR_UNIX98_PTY_DEFAULT	4096      /* Default maximum for Unix98 ptys */
-#define NR_UNIX98_PTY_MAX	(1 << MINORBITS) /* Absolute limit */
 #define NR_LDISCS		30
 
 /* line disciplines */
@@ -51,6 +33,25 @@
 #define N_GSM0710	21	/* GSM 0710 Mux */
 #define N_TI_WL		22	/* for TI's WL BT, FM, GPS combo chips */
 
+#ifdef __KERNEL__
+#include <linux/fs.h>
+#include <linux/major.h>
+#include <linux/termios.h>
+#include <linux/workqueue.h>
+#include <linux/tty_driver.h>
+#include <linux/tty_ldisc.h>
+#include <linux/mutex.h>
+
+#include <asm/system.h>
+
+
+/*
+ * (Note: the *_driver.minor_start values 1, 64, 128, 192 are
+ * hardcoded at present.)
+ */
+#define NR_UNIX98_PTY_DEFAULT	4096      /* Default maximum for Unix98 ptys */
+#define NR_UNIX98_PTY_MAX	(1 << MINORBITS) /* Absolute limit */
+
 /*
  * This character is the same as _POSIX_VDISABLE: it cannot be used as
  * a c_cc[] character, but indicates that a particular special character
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] TTY: export NR_LDISC and N_* line discipline numbers to user-space
  2011-05-24  8:43 [PATCH] TTY: export NR_LDISC and N_* line discipline numbers to user-space Florian Fainelli
@ 2011-05-24 12:40 ` Greg KH
  2011-05-24 13:17   ` Florian Fainelli
  0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2011-05-24 12:40 UTC (permalink / raw)
  To: Florian Fainelli; +Cc: lkml, Maxime Bizon

On Tue, May 24, 2011 at 10:43:03AM +0200, Florian Fainelli wrote:
> From: Florian Fainelli <ffainelli@freebox.fr>
> 
> Since commit (4564f9e5: consolidate line discipline number definitions)
> the patch moved all line discipline number from a per-architecture termios.h
> to a shared one: tty.h. However, prior to this consolidation work, the
> line discipline numbers were outside of an ifdef __KERNEL__/endif block
> so these numbers used to be exported to user-space.
> 
> Since such numbers are kernel ABI anyway, and tty.h is already included
> for user- space header processing, just move these relevant defines
> outside of the ifdef __KERNEL__/endif block in include/linux/tty.h.

Any reason you didn't copy _any_ of the people who signed off on that
patch, or the original author of that patch?

Anyway, this is been this way for four years, since the 2.6.21 kernel
release.  Since no one has noticed, or complained, since then, how much
a problem is this really?

Meaning, why has it taken this long for anyone to notice?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] TTY: export NR_LDISC and N_* line discipline numbers to user-space
  2011-05-24 12:40 ` Greg KH
@ 2011-05-24 13:17   ` Florian Fainelli
  2011-05-24 13:33     ` Greg KH
  2011-05-24 14:09     ` Tilman Schmidt
  0 siblings, 2 replies; 6+ messages in thread
From: Florian Fainelli @ 2011-05-24 13:17 UTC (permalink / raw)
  To: Greg KH; +Cc: lkml, Maxime Bizon, Tilman Schmidt, Andrew Morton

Hello,

On Tuesday 24 May 2011 14:40:44 Greg KH wrote:
> On Tue, May 24, 2011 at 10:43:03AM +0200, Florian Fainelli wrote:
> > From: Florian Fainelli <ffainelli@freebox.fr>
> > 
> > Since commit (4564f9e5: consolidate line discipline number definitions)
> > the patch moved all line discipline number from a per-architecture
> > termios.h to a shared one: tty.h. However, prior to this consolidation
> > work, the line discipline numbers were outside of an ifdef
> > __KERNEL__/endif block so these numbers used to be exported to
> > user-space.
> > 
> > Since such numbers are kernel ABI anyway, and tty.h is already included
> > for user- space header processing, just move these relevant defines
> > outside of the ifdef __KERNEL__/endif block in include/linux/tty.h.
> 
> Any reason you didn't copy _any_ of the people who signed off on that
> patch, or the original author of that patch?

No particular reason but my mistake, fixed that.

> 
> Anyway, this is been this way for four years, since the 2.6.21 kernel
> release.  Since no one has noticed, or complained, since then, how much
> a problem is this really?

This is a problem because you may have out of tree drivers using a line 
discpline number, and you do not want your companion user-space application to 
have to use a different line discpline number but the one the kernel should 
provide.

> 
> Meaning, why has it taken this long for anyone to notice?

- long standing user-space applications such as pppd got their N_PPP long ago, 
and do not have to worry about N_PPP being renumbered so they can just define 
it in pppd's sources it won't break

- I started implementing a line discipline driver only a couple of months ago 
and then realized that such ABI should have been exported
--
Florian

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] TTY: export NR_LDISC and N_* line discipline numbers to user-space
  2011-05-24 13:17   ` Florian Fainelli
@ 2011-05-24 13:33     ` Greg KH
  2011-05-24 13:45       ` Florian Fainelli
  2011-05-24 14:09     ` Tilman Schmidt
  1 sibling, 1 reply; 6+ messages in thread
From: Greg KH @ 2011-05-24 13:33 UTC (permalink / raw)
  To: Florian Fainelli; +Cc: lkml, Maxime Bizon, Tilman Schmidt, Andrew Morton

On Tue, May 24, 2011 at 03:17:23PM +0200, Florian Fainelli wrote:
> Hello,
> 
> On Tuesday 24 May 2011 14:40:44 Greg KH wrote:
> > On Tue, May 24, 2011 at 10:43:03AM +0200, Florian Fainelli wrote:
> > > From: Florian Fainelli <ffainelli@freebox.fr>
> > > 
> > > Since commit (4564f9e5: consolidate line discipline number definitions)
> > > the patch moved all line discipline number from a per-architecture
> > > termios.h to a shared one: tty.h. However, prior to this consolidation
> > > work, the line discipline numbers were outside of an ifdef
> > > __KERNEL__/endif block so these numbers used to be exported to
> > > user-space.
> > > 
> > > Since such numbers are kernel ABI anyway, and tty.h is already included
> > > for user- space header processing, just move these relevant defines
> > > outside of the ifdef __KERNEL__/endif block in include/linux/tty.h.
> > 
> > Any reason you didn't copy _any_ of the people who signed off on that
> > patch, or the original author of that patch?
> 
> No particular reason but my mistake, fixed that.
> 
> > 
> > Anyway, this is been this way for four years, since the 2.6.21 kernel
> > release.  Since no one has noticed, or complained, since then, how much
> > a problem is this really?
> 
> This is a problem because you may have out of tree drivers using a line 
> discpline number, and you do not want your companion user-space application to 
> have to use a different line discpline number but the one the kernel should 
> provide.
> 
> > 
> > Meaning, why has it taken this long for anyone to notice?
> 
> - long standing user-space applications such as pppd got their N_PPP long ago, 
> and do not have to worry about N_PPP being renumbered so they can just define 
> it in pppd's sources it won't break
> 
> - I started implementing a line discipline driver only a couple of months ago 
> and then realized that such ABI should have been exported

Ok, then it really isn't that important of a change :)

I'll queue it up for the next major merge window after this one, thanks.

greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] TTY: export NR_LDISC and N_* line discipline numbers to user-space
  2011-05-24 13:33     ` Greg KH
@ 2011-05-24 13:45       ` Florian Fainelli
  0 siblings, 0 replies; 6+ messages in thread
From: Florian Fainelli @ 2011-05-24 13:45 UTC (permalink / raw)
  To: Greg KH; +Cc: lkml, Maxime Bizon, Tilman Schmidt, Andrew Morton

On Tuesday 24 May 2011 15:33:53 Greg KH wrote:
> On Tue, May 24, 2011 at 03:17:23PM +0200, Florian Fainelli wrote:
> > Hello,
> > 
> > On Tuesday 24 May 2011 14:40:44 Greg KH wrote:
> > > On Tue, May 24, 2011 at 10:43:03AM +0200, Florian Fainelli wrote:
> > > > From: Florian Fainelli <ffainelli@freebox.fr>
> > > > 
> > > > Since commit (4564f9e5: consolidate line discipline number
> > > > definitions) the patch moved all line discipline number from a
> > > > per-architecture termios.h to a shared one: tty.h. However, prior to
> > > > this consolidation work, the line discipline numbers were outside of
> > > > an ifdef
> > > > __KERNEL__/endif block so these numbers used to be exported to
> > > > user-space.
> > > > 
> > > > Since such numbers are kernel ABI anyway, and tty.h is already
> > > > included for user- space header processing, just move these relevant
> > > > defines outside of the ifdef __KERNEL__/endif block in
> > > > include/linux/tty.h.
> > > 
> > > Any reason you didn't copy _any_ of the people who signed off on that
> > > patch, or the original author of that patch?
> > 
> > No particular reason but my mistake, fixed that.
> > 
> > > Anyway, this is been this way for four years, since the 2.6.21 kernel
> > > release.  Since no one has noticed, or complained, since then, how much
> > > a problem is this really?
> > 
> > This is a problem because you may have out of tree drivers using a line
> > discpline number, and you do not want your companion user-space
> > application to have to use a different line discpline number but the one
> > the kernel should provide.
> > 
> > > Meaning, why has it taken this long for anyone to notice?
> > 
> > - long standing user-space applications such as pppd got their N_PPP long
> > ago, and do not have to worry about N_PPP being renumbered so they can
> > just define it in pppd's sources it won't break
> > 
> > - I started implementing a line discipline driver only a couple of months
> > ago and then realized that such ABI should have been exported
> 
> Ok, then it really isn't that important of a change :)
> 
> I'll queue it up for the next major merge window after this one, thanks.

Thanks!
--
Florian

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] TTY: export NR_LDISC and N_* line discipline numbers to user-space
  2011-05-24 13:17   ` Florian Fainelli
  2011-05-24 13:33     ` Greg KH
@ 2011-05-24 14:09     ` Tilman Schmidt
  1 sibling, 0 replies; 6+ messages in thread
From: Tilman Schmidt @ 2011-05-24 14:09 UTC (permalink / raw)
  To: Florian Fainelli; +Cc: Greg KH, lkml, Maxime Bizon, Andrew Morton

[-- Attachment #1: Type: text/plain, Size: 1699 bytes --]

Am 24.05.2011 15:17 schrieb Florian Fainelli:
> On Tuesday 24 May 2011 14:40:44 Greg KH wrote:
>> On Tue, May 24, 2011 at 10:43:03AM +0200, Florian Fainelli wrote:
>>> From: Florian Fainelli <ffainelli@freebox.fr>
>>>
>>> Since commit (4564f9e5: consolidate line discipline number definitions)
>>> the patch moved all line discipline number from a per-architecture
>>> termios.h to a shared one: tty.h. However, prior to this consolidation
>>> work, the line discipline numbers were outside of an ifdef
>>> __KERNEL__/endif block so these numbers used to be exported to
>>> user-space.
>>>
>>> Since such numbers are kernel ABI anyway, and tty.h is already included
>>> for user- space header processing, just move these relevant defines
>>> outside of the ifdef __KERNEL__/endif block in include/linux/tty.h.
[...]
>> Meaning, why has it taken this long for anyone to notice?
> 
> - long standing user-space applications such as pppd got their N_PPP long ago, 
> and do not have to worry about N_PPP being renumbered so they can just define 
> it in pppd's sources it won't break

Also, I just checked on openSUSE 11.2, which comes with kernel
release is 2.6.27, and it still defines the LD numbers in
/usr/include/bits/ioctl-types.h (included from sys/ioctl.h).
I guess other distributions are doing the same, so their users
wouldn't notice the change.

Anyway, the patch is fine by me. Feel free to add:

Acked-by: Tilman Schmidt <tilman@imap.cc>

Thanks,
Tilman

-- 
Tilman Schmidt                    E-Mail: tilman@imap.cc
Bonn, Germany
Diese Nachricht besteht zu 100% aus wiederverwerteten Bits.
Ungeöffnet mindestens haltbar bis: (siehe Rückseite)


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 259 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-05-24 14:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-24  8:43 [PATCH] TTY: export NR_LDISC and N_* line discipline numbers to user-space Florian Fainelli
2011-05-24 12:40 ` Greg KH
2011-05-24 13:17   ` Florian Fainelli
2011-05-24 13:33     ` Greg KH
2011-05-24 13:45       ` Florian Fainelli
2011-05-24 14:09     ` Tilman Schmidt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.