All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: tangbin <tangbin@cmss.chinamobile.com>
Cc: olivier.moysan@foss.st.com, arnaud.pouliquen@foss.st.com,
	lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Subject: Re: [PATCH] ASoC: stm32: spdifrx: Delete unnecessary check in theprobe function
Date: Wed, 11 Aug 2021 13:19:55 +0100	[thread overview]
Message-ID: <20210811121955.GD4167@sirena.org.uk> (raw)
In-Reply-To: <7ddb13ee-2ca6-bf8d-2a83-9896d29176c5@cmss.chinamobile.com>

[-- Attachment #1: Type: text/plain, Size: 897 bytes --]

On Wed, Aug 11, 2021 at 08:09:00PM +0800, tangbin wrote:
> On 2021/8/11 19:58, Mark Brown wrote:
> > On Wed, Aug 11, 2021 at 07:55:23PM +0800, Tang Bin wrote:

> > > The function stm32_spdifrx_parse_of() is only called by the function
> > > stm32_spdifrx_probe(), and the probe function is only called with
> > > an openfirmware platform device. Therefore there is no need to check
> > > the device_node in probe function.

> > What is the benefit of not doing the check?  It seems like reasonable
> > defensive programming.

> I think it's unnecessary, because we all know than the probe function is
> only trigger if

> the device and the driver matches, and the trigger mode is just Device Tree.
> So the device_node

> must be exist in the probe function if it works. That's the reason why I
> think it's redundant.

I see why it is redundant, I don't see what problem this redudnancy
causes.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Mark Brown <broonie@kernel.org>
To: tangbin <tangbin@cmss.chinamobile.com>
Cc: olivier.moysan@foss.st.com, arnaud.pouliquen@foss.st.com,
	lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Subject: Re: [PATCH] ASoC: stm32: spdifrx: Delete unnecessary check in theprobe function
Date: Wed, 11 Aug 2021 13:19:55 +0100	[thread overview]
Message-ID: <20210811121955.GD4167@sirena.org.uk> (raw)
In-Reply-To: <7ddb13ee-2ca6-bf8d-2a83-9896d29176c5@cmss.chinamobile.com>


[-- Attachment #1.1: Type: text/plain, Size: 897 bytes --]

On Wed, Aug 11, 2021 at 08:09:00PM +0800, tangbin wrote:
> On 2021/8/11 19:58, Mark Brown wrote:
> > On Wed, Aug 11, 2021 at 07:55:23PM +0800, Tang Bin wrote:

> > > The function stm32_spdifrx_parse_of() is only called by the function
> > > stm32_spdifrx_probe(), and the probe function is only called with
> > > an openfirmware platform device. Therefore there is no need to check
> > > the device_node in probe function.

> > What is the benefit of not doing the check?  It seems like reasonable
> > defensive programming.

> I think it's unnecessary, because we all know than the probe function is
> only trigger if

> the device and the driver matches, and the trigger mode is just Device Tree.
> So the device_node

> must be exist in the probe function if it works. That's the reason why I
> think it's redundant.

I see why it is redundant, I don't see what problem this redudnancy
causes.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-08-11 12:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-11 11:55 [PATCH] ASoC: stm32: spdifrx: Delete unnecessary check in the probe function Tang Bin
2021-08-11 11:55 ` Tang Bin
2021-08-11 11:58 ` Mark Brown
2021-08-11 11:58   ` Mark Brown
2021-08-11 12:09   ` [PATCH] ASoC: stm32: spdifrx: Delete unnecessary check in theprobe function tangbin
2021-08-11 12:09     ` tangbin
2021-08-11 12:19     ` Mark Brown [this message]
2021-08-11 12:19       ` Mark Brown
2021-08-11 12:28       ` [PATCH] ASoC: stm32: spdifrx: Delete unnecessary check in the probe function tangbin
2021-08-11 12:28         ` tangbin

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=20210811121955.GD4167@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=arnaud.pouliquen@foss.st.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=olivier.moysan@foss.st.com \
    --cc=perex@perex.cz \
    --cc=tangbin@cmss.chinamobile.com \
    --cc=tiwai@suse.com \
    --cc=zhangshengju@cmss.chinamobile.com \
    /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.