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]
Message-ID: <CAHp75Vc9DG69pbCACB9o6=1pFDHYUkzwi6siXNOywQ-_Uzb4vA@mail.gmail.com>
Date:   Tue, 18 Jul 2023 22:58:46 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Fabrizio Castro <fabrizio.castro.jz@...esas.com>
Cc:     Mark Brown <broonie@...nel.org>,
        Geert Uytterhoeven <geert+renesas@...der.be>,
        linux-spi@...r.kernel.org, linux-kernel@...r.kernel.org,
        Chris Paterson <Chris.Paterson2@...esas.com>,
        Biju Das <biju.das@...renesas.com>,
        Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>,
        linux-renesas-soc@...r.kernel.org
Subject: Re: [PATCH v2 2/4] spi: rzv2m-csi: Improve data types, casting and alignment

On Tue, Jul 18, 2023 at 10:25 PM Fabrizio Castro
<fabrizio.castro.jz@...esas.com> wrote:
>
> "unsigned int" is more appropriate than "int" for the members
> of "struct rzv2m_csi_priv".
> Using void* rather than u8* for txbuf and rxbuf allows for
> the removal of some type casting.
> Remove the unnecessary casting of "data" to "struct rzv2m_csi_priv*"
> in function "rzv2m_csi_irq_handler".
> Also, members "bytes_per_word" and "errors" introduce gaps
> in the structure.
> Adjust "struct rzv2m_csi_priv" and its members usage accordingly.

Hmm... A bit of fancy indentation. Why is each sentence separated?

...

>         wait_queue_head_t wait;
> -       u8 errors;
> +       u32 errors;
>         u32 status;

As far as I understand Geert he wanted something like

  u32 status;
  u8 errors;

...

> -               u16 *buf = (u16 *)csi->txbuf;
> +               const u16 *buf = csi->txbuf;

> -               u8 *buf = (u8 *)csi->txbuf;
> +               const u8 *buf = csi->txbuf;

> -               u16 *buf = (u16 *)csi->rxbuf;
> +               u16 *buf = csi->rxbuf;

> -               u8 *buf = (u8 *)csi->rxbuf;
> +               u8 *buf = csi->rxbuf;

Yep, these look much better now.

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ