lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 12 Nov 2021 23:37:36 +0200
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Serge Semin <Sergey.Semin@...kalelectronics.ru>
Cc:     Serge Semin <fancer.lancer@...il.com>,
        Mark Brown <broonie@...nel.org>,
        Nandhini Srikandan <nandhini.srikandan@...el.com>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Andy Shevchenko <andy@...nel.org>,
        linux-spi <linux-spi@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [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@...il.com> wrote:
> On Fri, Nov 12, 2021 at 10:52 PM Serge Semin
> <Sergey.Semin@...kalelectronics.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ