lkml.org 
[lkml]   [2021]   [Nov]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 4/4] spi: dw: Add Synopsys Component version reading and parsing
On Fri, Nov 12, 2021 at 11:27 PM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
> On Fri, Nov 12, 2021 at 10:52 PM Serge Semin
> <Sergey.Semin@baikalelectronics.ru> wrote:

> > + /*
> > + * Retrieve the Synopsys component version if it hasn't been specified
> > + * by the platform. Note the CoreKit version ID is encoded as a 4bytes
> > + * ASCII string enclosed with '*' symbol.
> > + */
> > + if (!dws->ver) {
> > + u32 comp;
> > +
> > + comp = dw_readl(dws, DW_SPI_VERSION);
> > + dws->ver = (DW_SPI_GET_BYTE(comp, 3) - '0') * 100;
> > + dws->ver += (DW_SPI_GET_BYTE(comp, 2) - '0') * 10;
> > + dws->ver += (DW_SPI_GET_BYTE(comp, 1) - '0');
> > +
> > + dev_dbg(dev, "Synopsys DWC%sSSI v%u.%02u\n",
> > + (dws->caps & DW_SPI_CAP_DWC_HSSI) ? " " : " APB ",
> > + dws->ver / 100, dws->ver % 100);
>
> Oh là là, first you multiply then you divide in the same piece of code!
> What's wrong with fourcc (and thus keep it in ver filed as is) ? (Also
> we have %p4cc)
>
> > + }

Have you seen this, btw?

https://elixir.bootlin.com/linux/latest/source/drivers/tty/serial/8250/8250_dwlib.c#L93


--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2021-11-12 22:39    [W:0.263 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site