From: Linus Torvalds <torvalds@linux-foundation.org>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Greg KH <greg@kroah.com>,
linux-next@vger.kernel.org, linux-kernel@vger.kernel.org,
Joe Peterson <joe@skyrush.com>
Subject: Re: linux-next: manual merge of the tty tree with the tree
Date: Mon, 7 Sep 2009 11:22:11 -0700 (PDT) [thread overview]
Message-ID: <alpine.LFD.2.01.0909071104340.25628@localhost.localdomain> (raw)
In-Reply-To: <20090907191347.fe010955.sfr@canb.auug.org.au>
On Mon, 7 Sep 2009, Stephen Rothwell wrote:
>
> Today's linux-next merge of the tty tree got a conflict in
> drivers/char/n_tty.c between commit
> 37f81fa1f63ad38e16125526bb2769ae0ea8d332 ("n_tty: do O_ONLCR translation
> as a single write") from Linus' tree and commit
> bb2d17d83926bf9d70b922031aeb49ca896e0b3d ("tty: n_tty: honor opost flag
> for echoes") from the tty tree.
>
> I fixed it up (see below) and can carry the fix for a while.
Hmm. I think that the "honor opost flag for echoes" patch is actually
wrong.
We check O_OPOST() in the _caller_ for the regular write case, and that
test actually looks like this:
if (O_OPOST(tty) && !(test_bit(TTY_HW_COOK_OUT, &tty->flags))) {
so at a minimum, if we add it to process_output() we should likely add it
in the same format. But if we need that test, I'd rather do it in the
caller anyway, like we already do for regular writes.
So maybe the patch could be changed to something (UNTESTD!) like the
following instead? And thus avoid the conflict at the same time.
Linus
---
drivers/char/n_tty.c | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/drivers/char/n_tty.c b/drivers/char/n_tty.c
index 4e28b35..9c04bb4 100644
--- a/drivers/char/n_tty.c
+++ b/drivers/char/n_tty.c
@@ -345,6 +345,18 @@ static int do_output_char(unsigned char c, struct tty_struct *tty, int space)
return 1;
}
+static int output_echo(unsigned char c, struct tty_struct *tty, int space)
+{
+ if (O_OPOST(tty) && !(test_bit(TTY_HW_COOK_OUT, &tty->flags)))
+ return do_output_char(c, tty, space);
+
+ if (!space)
+ return -1;
+
+ tty_put_char(tty, c);
+ return 1;
+}
+
/**
* process_output - output post processor
* @c: character (or partial unicode symbol)
@@ -607,7 +619,7 @@ static void process_echoes(struct tty_struct *tty)
} else {
int retval;
- retval = do_output_char(c, tty, space);
+ retval = output_echo(c, tty, space);
if (retval < 0)
break;
space -= retval;
next prev parent reply other threads:[~2009-09-07 18:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-07 9:13 linux-next: manual merge of the tty tree with the tree Stephen Rothwell
2009-09-07 18:22 ` Linus Torvalds [this message]
2009-09-07 21:55 ` Joe Peterson
2009-09-08 16:06 ` Greg KH
2009-09-09 21:05 ` Joe Peterson
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=alpine.LFD.2.01.0909071104340.25628@localhost.localdomain \
--to=torvalds@linux-foundation.org \
--cc=greg@kroah.com \
--cc=joe@skyrush.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=sfr@canb.auug.org.au \
/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).