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] [day] [month] [year] [list]
Date:   Tue, 8 Aug 2023 23:59:24 +0300
From:   Serge Semin <fancer.lancer@...il.com>
To:     Mark Brown <broonie@...nel.org>
Cc:     Kunihiko Hayashi <hayashi.kunihiko@...ionext.com>,
        linux-spi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] spi: dw: Set default value if reg-io-width isn't
 specified

On Tue, Aug 08, 2023 at 01:46:08PM +0100, Mark Brown wrote:
> On Tue, Aug 08, 2023 at 09:00:18AM +0900, Kunihiko Hayashi wrote:
> > On 2023/08/08 7:57, Serge Semin wrote:
> > > On Mon, Aug 07, 2023 at 09:16:21AM +0900, Kunihiko Hayashi wrote:
> 
> > > > According to the dt-bindings, the default value of reg-io-width is 4.
> > > > However, the value becomes zero when reg-io-width isn't specified.
> 
> > > This semantic is implied by the dw_read_io_reg() and dw_write_io_reg()
> > > methods. It doesn't seem like that much necessary duplicating it in the
> > > property parse procedure, if not to say - redundant.
> 
> > I see. Currently since the variable reg_io_width has no other references
> > other than dw_{read, write}_io_reg(), it means the default value is taken
> > if this is zero.
> 
> > So, I think we should be careful when actually using the value of
> > this variable.
> 
> It does feel like a sensible robustness improvement,

I wouldn't call it "a sensible improvement" in this context, but
merely something like "a data-field/property coherency fixup".

> even if it's not
> fixing a specific issue now it might save us from future issues.

Such issues are very unlikely to happen unless somebody would try to
use the dw_spi.reg_io_width field separately from the denoted methods.
If one does, what he would have needed to make sure is that the field
always takes a correct value which would have led to this patch anyway
but at least it would have got a firm justification.

So to speak I wouldn't have bothered with merging the patch now at
least without changing the patch log which would have had to be
reduced to just the first paragraph with additional message stating
that the change just makes sure that the field is in a coherent state
with the DT-property value in order to improve the code
maintainability.

-Serge(y)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ