[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100227193233.0aad1e5e@lxorguk.ukuu.org.uk>
Date: Sat, 27 Feb 2010 19:32:33 +0000
From: Alan Cox <alan@...rguk.ukuu.org.uk>
To: Greg KH <greg@...ah.com>
Cc: Alan Cox <alan@...ux.intel.com>, linux-serial@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org
Subject: Re: [PATCH 1/5] tty: Add a function to insert a string of
characters with the same flag
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists