From: Greg KH <gregkh@linuxfoundation.org>
To: Benjamin Gaignard <benjamin.gaignard@linaro.org>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: broonie@kernel.org, p.paillet@st.com,
linux-kernel@vger.kernel.org, m.szyprowski@samsung.com,
Benjamin Gaignard <benjamin.gaignard@st.com>
Subject: Re: [PATCH] base: core: Remove WARN_ON from link dependencies check
Date: Thu, 12 Jul 2018 10:55:01 +0200 [thread overview]
Message-ID: <20180712085501.GA25313@kroah.com> (raw)
In-Reply-To: <20180712080623.21203-1-benjamin.gaignard@st.com>
On Thu, Jul 12, 2018 at 10:06:23AM +0200, Benjamin Gaignard wrote:
> In some cases the link between between customer and supplier
> already exist. Do not warn about already existing dependencies
> because device_link_add() take care of this case.
Why would a link already exist that is asked to be created again? What
code path causes this?
>
> Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>
> ---
> drivers/base/core.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/base/core.c b/drivers/base/core.c
> index df3e1a44707a..fcdc17f0f349 100644
> --- a/drivers/base/core.c
> +++ b/drivers/base/core.c
> @@ -105,7 +105,7 @@ static int device_is_dependent(struct device *dev, void *target)
> struct device_link *link;
> int ret;
>
> - if (WARN_ON(dev == target))
> + if (dev == target)
> return 1;
>
> ret = device_for_each_child(dev, target, device_is_dependent);
> @@ -113,7 +113,7 @@ static int device_is_dependent(struct device *dev, void *target)
> return ret;
>
> list_for_each_entry(link, &dev->links.consumers, s_node) {
> - if (WARN_ON(link->consumer == target))
> + if (link->consumer == target)
> return 1;
Both of these WARN_ON are for valid code? That feels really odd to me,
I need more explanation here please.
thanks,
greg k-h
next prev parent reply other threads:[~2018-07-12 8:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-12 8:06 [PATCH] base: core: Remove WARN_ON from link dependencies check Benjamin Gaignard
2018-07-12 8:55 ` Greg KH [this message]
2018-07-12 9:18 ` Benjamin Gaignard
2018-07-12 10:25 ` Mark Brown
2018-07-16 9:45 ` Rafael J. Wysocki
2018-07-13 16:14 ` 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=20180712085501.GA25313@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=benjamin.gaignard@linaro.org \
--cc=benjamin.gaignard@st.com \
--cc=broonie@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=p.paillet@st.com \
--cc=rjw@rjwysocki.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox