[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75Vf+ksuv6Y_xY=qPdGT7XTZGKpDwPT5UDqwBMUwkW47gRA@mail.gmail.com>
Date: Fri, 26 Aug 2022 18:53:55 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jirislaby@...nel.org>,
"open list:SERIAL DRIVERS" <linux-serial@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/5] serial: cpm_uart: Remove custom frame size calculation
On Thu, Aug 25, 2022 at 11:58 AM Ilpo Järvinen
<ilpo.jarvinen@...ux.intel.com> wrote:
>
> The number of bits can be calculated using helpers in core, no need for
> the driver to do it on its own.
>
> The mode register is programmed with frame bits minus 1, rearrange the
> comments related to that "feature" closer to the actual write.
...
> + out_be16(&smcp->smc_smcmr, smcr_mk_clen(tty_get_frame_size(termios->c_cflag) - 1) |
> + cval | SMCMR_SM_UART | prev_mode);
> } else {
> out_be16(&pinfo->sccup->scc_genscc.scc_mrblr, pinfo->rx_fifosize);
> out_be16(&pinfo->sccup->scc_maxidl, maxidl);
> - out_be16(&sccp->scc_psmr, (sbits << 12) | scval);
> + out_be16(&sccp->scc_psmr, (UART_LCR_WLEN(tty_get_char_size(termios->c_cflag))
> + << 12) | scval);
Seems it's better to calc it beforehand in the temporary variable for
both branches of the conditional and fix a bit strange indentation
here.
> }
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists