All of lore.kernel.org
 help / color / mirror / Atom feed
From: Serge Semin <fancer.lancer@gmail.com>
To: Mark Brown <broonie@kernel.org>
Cc: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>,
	linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] spi: dw: Set default value if reg-io-width isn't specified
Date: Tue, 8 Aug 2023 23:59:24 +0300	[thread overview]
Message-ID: <4dhdiqmyd2ytpxjv3ph2shxmfu4cg7sshpip7qic6rmqlbfen3@knn33heekvu3> (raw)
In-Reply-To: <1505ec01-186d-451a-9164-d42796954c01@sirena.org.uk>

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)

  reply	other threads:[~2023-08-08 21:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-07  0:16 [PATCH] spi: dw: Set default value if reg-io-width isn't specified Kunihiko Hayashi
2023-08-07 22:57 ` Serge Semin
2023-08-08  0:00   ` Kunihiko Hayashi
2023-08-08 12:46     ` Mark Brown
2023-08-08 20:59       ` Serge Semin [this message]
2023-08-08 15:34 ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4dhdiqmyd2ytpxjv3ph2shxmfu4cg7sshpip7qic6rmqlbfen3@knn33heekvu3 \
    --to=fancer.lancer@gmail.com \
    --cc=broonie@kernel.org \
    --cc=hayashi.kunihiko@socionext.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.