lkml.org 
[lkml]   [2022]   [May]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 3/5] tty/termbits: remove #ifdef IBSHIFT that is always defined
    Date
    IBSHIFT is defined by all architectures.

    Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    ---
    drivers/tty/tty_baudrate.c | 11 +----------
    1 file changed, 1 insertion(+), 10 deletions(-)

    diff --git a/drivers/tty/tty_baudrate.c b/drivers/tty/tty_baudrate.c
    index 07bbbfee5635..d10318956c97 100644
    --- a/drivers/tty/tty_baudrate.c
    +++ b/drivers/tty/tty_baudrate.c
    @@ -91,7 +91,6 @@ EXPORT_SYMBOL(tty_termios_baud_rate);

    speed_t tty_termios_input_baud_rate(struct ktermios *termios)
    {
    -#ifdef IBSHIFT
    unsigned int cbaud = (termios->c_cflag >> IBSHIFT) & CBAUD;

    if (cbaud == B0)
    @@ -110,9 +109,6 @@ speed_t tty_termios_input_baud_rate(struct ktermios *termios)
    cbaud += 15;
    }
    return cbaud >= n_baud_table ? 0 : baud_table[cbaud];
    -#else /* IBSHIFT */
    - return tty_termios_baud_rate(termios);
    -#endif /* IBSHIFT */
    }
    EXPORT_SYMBOL(tty_termios_input_baud_rate);

    @@ -152,10 +148,9 @@ void tty_termios_encode_baud_rate(struct ktermios *termios,
    termios->c_ispeed = ibaud;
    termios->c_ospeed = obaud;

    -#ifdef IBSHIFT
    if (((termios->c_cflag >> IBSHIFT) & CBAUD) != B0)
    ibinput = 1; /* An input speed was specified */
    -#endif
    +
    /* If the user asked for a precise weird speed give a precise weird
    * answer. If they asked for a Bfoo speed they may have problems
    * digesting non-exact replies so fuzz a bit.
    @@ -170,9 +165,7 @@ void tty_termios_encode_baud_rate(struct ktermios *termios,
    iclose = 0;

    termios->c_cflag &= ~CBAUD;
    -#ifdef IBSHIFT
    termios->c_cflag &= ~(CBAUD << IBSHIFT);
    -#endif

    /*
    * Our goal is to find a close match to the standard baud rate
    @@ -194,12 +187,10 @@ void tty_termios_encode_baud_rate(struct ktermios *termios,
    */
    if (ofound == i && !ibinput)
    ifound = i;
    -#ifdef IBSHIFT
    else {
    ifound = i;
    termios->c_cflag |= (baud_bits[i] << IBSHIFT);
    }
    -#endif
    }
    } while (++i < n_baud_table);

    --
    2.30.2
    \
     
     \ /
      Last update: 2022-05-11 12:14    [W:3.161 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site