linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Austin S. Hemmelgarn" <ahferroin7@gmail.com>
To: Pierre Paul MINGOT <mingot.pierre@gmail.com>,
	gregkh@linuxfoundation.org, jslaby@suse.cz,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Add possibility to set /dev/tty number
Date: Wed, 6 Jan 2016 08:39:11 -0500	[thread overview]
Message-ID: <568D18FF.3050101@gmail.com> (raw)
In-Reply-To: <CAGU20-qSEF6q2iOnapSM7_mqzz4u5ksk=4ubHbn10WEXW82MyA@mail.gmail.com>

On 2016-01-04 10:34, Pierre Paul MINGOT wrote:
> Hello,
> 
> In Linux there is no way to set the number of tty devices or console
> to create. By default the kernel create 64 /dev/tty devices. what is
> too much for embedded system with limited resources. As all these 64
> devices are not necessary or mandatory for the kernel proper working,
> I add a config option to set the desired tty. The lowest number you
> can set is 1 and the highest is 63, any value respectively below or
> above that, will cause a kconfig invalid entry pop-up.
> 
> Please keep me update.
> 
> Best Regards
> 
OK, circling back since I never commented on the original patch.  Greg covered most of the basics regarding formatting, so I won't comment on that.
 
>+config NR_TTY_DEVICES
>+    int "Maximum tty device number"
>+    depends on VT
>+    range 1 63
>+    default 1

The config item should default to the current value of 63, as it changes the userspace visible ABI otherwise.  It should also probably depend on EXPERT, as this isn't something that should be arbitrarily changed by most people building the kernel.

> #define MIN_NR_CONSOLES 1       /* must be at least 1 */
>-#define MAX_NR_CONSOLES	63	/* serial lines start at 64 */
>-#define MAX_NR_USER_CONSOLES 63	/* must be root to allocate above this */
>+/* serial lines start at 64 */
>+#define MAX_NR_CONSOLES	 CONFIG_NR_TTY_DEVICES
>+/* must be root to allocate above this */
>+#define MAX_NR_USER_CONSOLES CONFIG_NR_TTY_DEVICES

This shouldn't affect serial console numbering, as the minimum serial console minor number isn't defined relative to either of the values here.

Using #define to define things relative to Kconfig values in uapi headers doesn't work (at least, not just doing it with a simple #define, there might be some way to do it, but I have yet to see it), these would need to get parsed when the headers get installed, so this patch would result in MAX_NR_CONSOLES and MAX_NR_USER_CONSOLES being undefined in the userspace headers because userspace doesn't have direct access to any of the CONFIG values.

      parent reply	other threads:[~2016-01-06 13:40 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-04 15:34 [PATCH] Add possibility to set /dev/tty number Pierre Paul MINGOT
2016-01-04 15:43 ` Greg KH
2016-01-04 16:57   ` Austin S. Hemmelgarn
2016-01-04 17:11     ` Greg KH
2016-01-04 18:41       ` Austin S. Hemmelgarn
2016-01-04 22:55         ` One Thousand Gnomes
2016-01-05 13:16           ` Austin S. Hemmelgarn
2016-01-05 15:24             ` Greg KH
2016-01-05 15:33               ` Austin S. Hemmelgarn
2016-01-05 16:11             ` Theodore Ts'o
2016-01-05 16:22               ` Austin S. Hemmelgarn
2016-01-05  8:51         ` Pierre Paul MINGOT
2016-01-05 13:02           ` Austin S. Hemmelgarn
2016-01-05 15:25           ` Greg KH
2016-01-05 15:43             ` Austin S. Hemmelgarn
2016-01-05 16:03               ` Greg KH
2016-01-05 18:38         ` Austin S. Hemmelgarn
2016-01-05 20:47           ` One Thousand Gnomes
2016-01-06 12:42             ` Austin S. Hemmelgarn
2016-01-06 13:54               ` One Thousand Gnomes
2016-01-06 14:07                 ` Austin S. Hemmelgarn
2016-01-06 13:39 ` Austin S. Hemmelgarn [this message]

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=568D18FF.3050101@gmail.com \
    --to=ahferroin7@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingot.pierre@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).