lkml.org 
[lkml]   [2023]   [May]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v9 2/2] spi: loongson: add bus driver for the loongson spi controller
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.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2023-05-09 06:39    [W:0.085 / U:0.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site