From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Greg KH <greg@kroah.com>
Cc: Alan Cox <alan@linux.intel.com>,
linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-usb@vger.kernel.org
Subject: Re: [PATCH 1/5] tty: Add a function to insert a string of characters with the same flag
Date: Sat, 27 Feb 2010 19:32:33 +0000 [thread overview]
Message-ID: <20100227193233.0aad1e5e@lxorguk.ukuu.org.uk> (raw)
In-Reply-To: <20100226221100.GA22352@kroah.com>
Was it really the 17th I sent the second set out - apparently so - so
ignore the first email, this is the correct patch set.
> > +int tty_insert_flip_string_fixed_flag(struct tty_struct *tty,
> > + const unsigned char *chars, char flag, size_t size)
> > {
> > int copied = 0;
> > do {
> > + int goal = min(size - copied, TTY_BUFFER_PAGE);
>
> This variable isn't used in this function.
>
> > int space = tty_buffer_request_room(tty, goal);
Its used here. The logic basically is
goal = { I want a buffer to hold "size - copied"
{ I want it to fit in one page
space = what I get back
we copy space and move on based on what we get back, so it looks correct
to me.
> > memcpy(tb->char_buf_ptr + tb->used, chars, space);
> > - memset(tb->flag_buf_ptr + tb->used, TTY_NORMAL, space);
> > + memset(tb->flag_buf_ptr + tb->used, flag, space);
>
> Should you have "goal" here instead of "space"?
No because we could ask for say 500 and get 250 back, we then want to
copy 250.
Alan
prev parent reply other threads:[~2010-02-27 19:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-17 13:06 [PATCH 1/5] tty: Add a function to insert a string of characters with the same flag Alan Cox
2010-02-17 13:06 ` [PATCH 3/5] tty: sort out the request_room handling for whiteheat Alan Cox
2010-02-17 13:07 ` [PATCH 4/5] tty: kill request_room for USB ACM class Alan Cox
[not found] ` <20100217130604.16008.86393.stgit-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2010-02-17 13:06 ` [PATCH 2/5] tty: Prune uses of tty_request_room in the USB layer Alan Cox
2010-02-17 13:07 ` [PATCH 5/5] tty: Fix up char drivers request_room usage Alan Cox
2010-02-26 22:11 ` [PATCH 1/5] tty: Add a function to insert a string of characters with the same flag Greg KH
2010-02-27 14:45 ` Christopher Curtis
2010-02-27 19:02 ` Alan Cox
2010-02-27 23:37 ` Greg KH
2010-02-27 19:32 ` Alan Cox [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=20100227193233.0aad1e5e@lxorguk.ukuu.org.uk \
--to=alan@lxorguk.ukuu.org.uk \
--cc=alan@linux.intel.com \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=linux-usb@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;
as well as URLs for NNTP newsgroup(s).