Re: [PATCH 2/5] serial: cpm_uart: Remove custom frame size calculation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Aug 25, 2022 at 11:58 AM Ilpo Järvinen
<ilpo.jarvinen@xxxxxxxxxxxxxxx> 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




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux