lkml.org 
[lkml]   [2006]   [Jun]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [PATCH] Airprime driver improvements to allow full speed EvDO transfers
    Date
    Andrew Morton <akpm@osdl.org> writes:
    > On Fri, 30 Jun 2006 01:48:02 -0400
    > Andy Gay <andy@andynet.net> wrote:
    [...]
    >> + if (tty && urb->actual_length) {
    >> + tty_buffer_request_room(tty, urb->actual_length);
    >> + tty_insert_flip_string(tty, data, urb->actual_length);
    >
    > Is it correct to ignore the return value from those two functions?

    In fact, according to Alan Cox answer, the first call is useless here at
    all, i.e., tty_buffer_request_room() is for subsequent
    tty_insert_flip_char() calls in a loop, not for
    tty_insert_flip_string(). tty_insert_flip_string() calls
    tty_buffer_request_room() itself, and does it in a loop in attempt to
    find as much memory as possible.

    tty_insert_flip_string() returns number of bytes it has actually
    inserted, but I don't believe one can do much if it returns less than
    has been requested as it means that we are out of kernel memory.

    Overall, it seems it should be just:

    + if (tty && urb->actual_length) {
    + tty_insert_flip_string(tty, data, urb->actual_length);

    --
    Sergei.
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2006-06-30 12:54    [W:0.032 / U:90.216 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site