Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2304964pxb; Fri, 5 Feb 2021 14:29:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJyKxp5f20OoHr/6nNBBhHnP6lm4ilsxyP/BJcktNT465f2baM0NniaGOkks5V+/K10tXySI X-Received: by 2002:a17:907:7605:: with SMTP id jx5mr6143572ejc.340.1612564166900; Fri, 05 Feb 2021 14:29:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612564166; cv=none; d=google.com; s=arc-20160816; b=X7SI2ahy9VnYfwfRRD8gRpw2CfOy/1GerkDJ8BhSWuNuPkjISTW0MGU++klTZZngbr her2395Tfg38TsrnUQJtDBxKgKc8CufcyEJ274/RHoD8MeepY6guGP+HkLxcuwHQuphc pfw9YtcJuScW5AdVm5tUVG2ByLkZeop+wOA+Ix7EBh4dij4fK9GyuTVtBJPUy++QupGY QdFi+5O+gdWshOZLRzmcaqTcc1fg/mx2plP++YEmE6yr0WqZDEGb1PHP2n162WbZNm0s HGN5r1NA3I/72hHhzh+zPKpYssD1Z8ZmI893oKi5IjoOsrx62LYyBTt+4H1Hgnw30mrn Yw7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ReB/SKGbYSmV+gHHVpHKWpF4d3DN99iVGB/82b/coPc=; b=zsefhJYH915tsbQjcWKVW+pHOzAk4uuFLUDYPH3h83TwnBVpm6e2/JtdaInGs9qupT phBcB5D1X5z8dS80QI75TdFyK/9sjoC7E/Fsoi5M9AUMZzxYCC5eGZXvP83IMh/JzorM KN67EQSu4UPdBzvC5D4/3p8bfsBhoFH4H4eWeNGqFnIGpJhYe3t81HCcAiEObY5YOXpf EFCHETst6ok63CWlCwgntYQKq3zstYUER6jwa+CEeIsQvkdw6h2Pge7emVto+3XT3z29 7UPoovCLnVJJTO2GGs46rCP8jUWMKhb/y1Cqj4b6AD5ArZiz00VKLZu9QSQcSuBqGXaO 3FYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=L5rDOUWS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a20si762667edx.226.2021.02.05.14.29.03; Fri, 05 Feb 2021 14:29:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=L5rDOUWS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232994AbhBEWZL (ORCPT + 99 others); Fri, 5 Feb 2021 17:25:11 -0500 Received: from mail.kernel.org ([198.145.29.99]:44978 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232850AbhBEOyw (ORCPT ); Fri, 5 Feb 2021 09:54:52 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id BEAC9650C3; Fri, 5 Feb 2021 14:14:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612534493; bh=uzQETzjw8nT8iksAVQnNxCTqHD4pn5w/R5OubRmSggc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L5rDOUWSUOMCF99MW3zqXOmkso6LGLKr/E6EclZxlnR/zAb/Pgbbc7Fd2KJDgWefi vO48G2ZO+aT47FsaTZiJJqtHK7q7d2q+GxSaGV/+P22BPfD43icsgyE+PthWGYDyiP hrGn2xsH1Xr2NbBRd2Y6kUykE4kjyBqvQLz56jUQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marek Szyprowski , Mark Brown , Benjamin Gaignard , "Rafael J. Wysocki" , Sudip Mukherjee Subject: [PATCH 4.14 06/15] base: core: Remove WARN_ON from link dependencies check Date: Fri, 5 Feb 2021 15:08:51 +0100 Message-Id: <20210205140649.986802207@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210205140649.733510103@linuxfoundation.org> References: <20210205140649.733510103@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Benjamin Gaignard commit e16f4f3e0b7daecd48d4f944ab4147c1a6cb16a8 upstream In some cases the link between between customer and supplier already exist, for example when a device use its parent as a supplier. Do not warn about already existing dependencies because device_link_add() takes care of this case. Link: http://lkml.kernel.org/r/20180709111753eucas1p1f32e66fb2f7ea3216097cd72a132355d~-rzycA5Rg0378203782eucas1p1C@eucas1p1.samsung.com Reported-by: Marek Szyprowski Reviewed-by: Mark Brown Signed-off-by: Benjamin Gaignard Reviewed-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sudip Mukherjee Signed-off-by: Greg Kroah-Hartman --- drivers/base/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -109,7 +109,7 @@ static int device_is_dependent(struct de 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); @@ -117,7 +117,7 @@ static int device_is_dependent(struct de return ret; list_for_each_entry(link, &dev->links.consumers, s_node) { - if (WARN_ON(link->consumer == target)) + if (link->consumer == target) return 1; ret = device_is_dependent(link->consumer, target);