Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1446589imm; Thu, 12 Jul 2018 01:56:00 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcqcc7038KsrrZNwYNfmOHneyFI/VvWjm5Tm29SONmk0uMcvI5WzCFuSGj11+s8CAmUeJ2L X-Received: by 2002:a17:902:2702:: with SMTP id c2-v6mr1287874plb.297.1531385760750; Thu, 12 Jul 2018 01:56:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531385760; cv=none; d=google.com; s=arc-20160816; b=0VqeqOO+XgDkskN8S6BoqKAPqWA8SVNG867vSiA02LXSawW1IlPMWgP6stbS5uDR1f WUC1jG38BCe/7M500J728WQMvA3h+4NDtw81/e4dvMyi7I77ReMYfRAvrD1G8QtYhE5I V6Bslos6J5thDbOOTM2GR2MtTWrFSOlnHmnpZhhSqNULASYtJVJFIl0Wg85LAB/ozjV5 Bdx+ks08J54O9V4T0902pQ2TKAV7ajoKcMbgdBJLVlH6yeCKE8ih/nfjj20sXgU5IGcm Ri/S0a1VEAckUvztMxBrVuFXY4YzmChCKeCeavlWGKLpYYVuVkni/iS2wn+Mk07urULh N8bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=Z7X4wU6VA9POmMxuq3Laj85CvqjdkO6TUJL/MTNNCOg=; b=mmqrBsQD5RR0pRpZEiRBosZLrEAUZsKJXQ4v85MDEgirah53N4wMJ1shfGVjmFQSuD WSG8a8FadXEnMQn60Pf9wHw16DiyH/FoZustFBEXmu5cJCZhq9ewdJ2XLLN5NcsvPmoa IVyj6HDBdoxJnxKQavgaphaRM8cUPdLGSAjtWuu0wOFI8x8UVwVzCSRsuldJzYh8GZ/U ORYAwvsD49DS7sq6YWD8VYyrm5lOG+GbEO4w22LQZLw+uonr0y6LqbFrbpFT1My97RZ2 +g6TxVppyI9iu561CydvBsF6AcKnxUahA2KJU243DvqNNHjoydPTuPzZdvPJw/ynXTq+ +0nw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v8-v6si6674717pff.248.2018.07.12.01.55.43; Thu, 12 Jul 2018 01:56:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726784AbeGLJDo (ORCPT + 99 others); Thu, 12 Jul 2018 05:03:44 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:55894 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726366AbeGLJDo (ORCPT ); Thu, 12 Jul 2018 05:03:44 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 910F1D02; Thu, 12 Jul 2018 08:55:05 +0000 (UTC) Date: Thu, 12 Jul 2018 10:55:01 +0200 From: Greg KH To: Benjamin Gaignard , "Rafael J. Wysocki" Cc: broonie@kernel.org, p.paillet@st.com, linux-kernel@vger.kernel.org, m.szyprowski@samsung.com, Benjamin Gaignard Subject: Re: [PATCH] base: core: Remove WARN_ON from link dependencies check Message-ID: <20180712085501.GA25313@kroah.com> References: <20180712080623.21203-1-benjamin.gaignard@st.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180712080623.21203-1-benjamin.gaignard@st.com> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > Signed-off-by: Benjamin Gaignard > --- > 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