Re: [PATCH v9 2/2] spi: loongson: add bus driver for the loongson spi controller

Mark Brown
2023-05-09T04:39:29Z

[-- Attachment #1: Type: text/plain, Size: 1046 bytes --]

On Mon, May 08, 2023 at 06:04:06PM +0300, andy.shevchenko@gmail.com wrote:
> Wed, Apr 26, 2023 at 03:10:45PM +0800, Yinbo Zhu kirjoitti:

> > + loongson_spi_write_reg(loongson_spi,
> > + LOONGSON_SPI_SFCS_REG,
> > + (val ? (0x11 << spi->chip_select) :
> > + (0x1 << spi->chip_select)) | cs);

> Too many parentheses.

The code is absolutely fine, there is nothing wrong with adding explicit
parentheses even where not strictly needed if it helps to make things
clear (which is obviously always a problem wiht ternery operator use).

Please, stop this sort of nitpicking. It is at times actively unhelpful.

> > + bit = fls(div) - 1;
> > + if ((1<<bit) == div)
> > + bit--;
> > + div_tmp = rdiv[bit];

> I believe this can be optimized.

This isn't constructive feedback, if there is a concrete optimisation
you want to suggest please just suggest it.

> > +EXPORT_SYMBOL_GPL(loongson_spi_init_master);

> Please, use _NS variant.

It really does not matter, the chances of any collisions is pretty much
zero.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]