lkml.org 
[lkml]   [2022]   [Aug]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [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@linux.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

\
 
 \ /
  Last update: 2022-08-26 17:54    [W:0.083 / U:0.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site