All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Reif <reif@earthlink.net>
To: sparclinux@vger.kernel.org
Subject: Re: tty compile warnings
Date: Mon, 01 Sep 2008 15:58:04 +0000	[thread overview]
Message-ID: <48BC110C.1@earthlink.net> (raw)
In-Reply-To: <48BBEDB2.3080207@earthlink.net>

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

Alan Cox wrote:
> You could try removing _x_cc[2] and changing [NCCS] to [NCCS+2] which
> might work depending upon the alignment you get.
>   
The following patch compiles without error but I'm a bit confused
about the sizes.  VMIN is 16 and VTIME is 17 so user NCCS should
be 16 and kernel NCCS 18 unless there are padding or some legacy
issues here. 17 + 2 + one for c_line = 20 bytes which makes sense for
padding but NCCS is used to copy the control characters which means
an unused control character is copied.

[-- Attachment #2: tty.diff.txt --]
[-- Type: text/plain, Size: 1493 bytes --]

diff --git a/arch/sparc/include/asm/termbits.h b/arch/sparc/include/asm/termbits.h
index d6ca3e2..c154288 100644
--- a/arch/sparc/include/asm/termbits.h
+++ b/arch/sparc/include/asm/termbits.h
@@ -29,10 +29,11 @@ struct termios {
 	tcflag_t c_cflag;		/* control mode flags */
 	tcflag_t c_lflag;		/* local mode flags */
 	cc_t c_line;			/* line discipline */
+#ifndef __KERNEL__
 	cc_t c_cc[NCCS];		/* control characters */
-#ifdef __KERNEL__
+#else
+	cc_t c_cc[NCCS+2];	/* kernel needs 2 more to hold vmin/vtime */
 #define SIZEOF_USER_TERMIOS sizeof (struct termios) - (2*sizeof (cc_t))
-	cc_t _x_cc[2];                  /* We need them to hold vmin/vtime */
 #endif
 };
 
@@ -42,8 +43,7 @@ struct termios2 {
 	tcflag_t c_cflag;		/* control mode flags */
 	tcflag_t c_lflag;		/* local mode flags */
 	cc_t c_line;			/* line discipline */
-	cc_t c_cc[NCCS];		/* control characters */
-	cc_t _x_cc[2];                  /* padding to match ktermios */
+	cc_t c_cc[NCCS+2];		/* control characters */
 	speed_t c_ispeed;		/* input speed */
 	speed_t c_ospeed;		/* output speed */
 };
@@ -54,8 +54,7 @@ struct ktermios {
 	tcflag_t c_cflag;		/* control mode flags */
 	tcflag_t c_lflag;		/* local mode flags */
 	cc_t c_line;			/* line discipline */
-	cc_t c_cc[NCCS];		/* control characters */
-	cc_t _x_cc[2];                  /* We need them to hold vmin/vtime */
+	cc_t c_cc[NCCS+2];		/* control characters */
 	speed_t c_ispeed;		/* input speed */
 	speed_t c_ospeed;		/* output speed */
 };

  parent reply	other threads:[~2008-09-01 15:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-01 13:27 tty compile warnings Robert Reif
2008-09-01 13:57 ` Alan Cox
2008-09-01 15:58 ` Robert Reif [this message]
2008-09-03  0:21 ` David Miller

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=48BC110C.1@earthlink.net \
    --to=reif@earthlink.net \
    --cc=sparclinux@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 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.