Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp1695336lqo; Sun, 12 May 2024 14:14:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWFCfrXhr+QC+h4TVnEqFdZ0vlmYV3IMivEhZszUkrcCXNJfc76IigXE5qH0lCdV7upVNeh+wJJfgjOWs1lIQiv+pqwCIbalQFzVzmLQw== X-Google-Smtp-Source: AGHT+IEeb6iOD0TL6kDwK8WCD8tweTPNCTyfMTWq3hgA8GKk47Znk6oVjOJX7lHbdvd8FCcmN7AS X-Received: by 2002:a05:6a00:2e9c:b0:6ed:41f3:cd06 with SMTP id d2e1a72fcca58-6f4e0298a79mr10892388b3a.7.1715548483591; Sun, 12 May 2024 14:14:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715548483; cv=pass; d=google.com; s=arc-20160816; b=TamF2ty3zyfdP8g5eL8jCLnt0UdCQs3gESg+RTzktl++69uQcgMBdYTZpYtrfR9vmR dHeooPt/9DDVWeZwrvQSwDbc0WgMJqQgfBcA1/RqVC9S6Bs1nUAT7JyMDjsBWqwnVTHr kieCou+jx4sv3cZiQCZcDqXAeZe75z6Vh8+H0Q869kzbJdsHL6icG543muXnqI/3Ag8J VYMOJeAdWC6ahUplvGotgY9EpYbrKiedccrD23+5X8pYwGfkTQ6VjXITp85mj3/W12/3 8ZrRGqTs9HAb12nXholTzILpBQLV+GZOcU2kHsmydoS7HRmEwqO1KFj422jKY1LsaXkS gSgQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=7q20+FYTe5yA44r/lK0e3y8a/rS3S9gqD0i0geDEDVc=; fh=sWWf72krJ/MaKTAbxyf3fw7TL4LwGgzoywK/5UTrsvc=; b=eR8lVH63mX6oi+jiroq4RR2FWoZSayuvSFHheQOZyNYh86nd6tKoiV71e0Ib8bbyf1 varJyc77dSOIXcjaIKG1/y+qHUKAbJBIOw10pFCwHH3IUFzaz5NYpRDSgR0iONZkiSiw fviQsfyEmSd72ElwhLJAc+4bH0XfhCuCPfGbyuYXKZv8uuIA297/bY4Wb7VLAElKxN8S ZnPLxwq+d0pNf2NPUUnY3ryPOzEgAcAuzppr/Y6H8wg0OiURBOye3ooV+KDQM4T0Y6Q3 SQmJftttFQSSg836Ph8IL7QoZ+N5bvGYAOine/Xz0NXcwpstoLi7A4+xyYLL501QWLiQ 2CFg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=OVf1pBUr; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-177018-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177018-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-63f14c541b1si2046676a12.289.2024.05.12.14.14.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 May 2024 14:14:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-177018-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=OVf1pBUr; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-177018-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177018-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id A9916281075 for ; Sun, 12 May 2024 21:14:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3DD2E56443; Sun, 12 May 2024 21:14:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="OVf1pBUr" Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0A67055E48 for ; Sun, 12 May 2024 21:14:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715548476; cv=none; b=HE13RUCkV7bGACplMKPBFaQ9Gw2M26+IGLHN9sEeQDZl1BtXwjuN5/ENtM+lpwGFitsTRNZJgsg4I1Z6oa0p1a+Rk9mxU1dxE682ivs5GMfV9OrMYYkPAx7CwHKXWkfwJZcEMrGOk1ZPqZb5kJi5wnZa+/NkyOIOI2wEt0sxZ0w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715548476; c=relaxed/simple; bh=FG6iKX2wYIDzAZO1I+hGEmxBg8st+4S4h3rD+0EIdPM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Itl2mPxERWIwnoAsoMQLEX2IoFuagOE67UqZ4sEz7WZ4CeVcrkw96O3LxIecXt5IpTt1mLaCBkudJpNYmgy8oJQa4K1eXzM7SE9OcWr6vYr9C7/DayiXlc4WRg8TuJ3KJigs3JyHCVxKg7y62sTOtJ6E9jWhQlsOEPlyLHvrAEE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=OVf1pBUr; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 9C6D38BE; Sun, 12 May 2024 23:14:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1715548467; bh=FG6iKX2wYIDzAZO1I+hGEmxBg8st+4S4h3rD+0EIdPM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OVf1pBUrQ3+ReIvEpXYckwu1PKGSeSbmzPcp8TgSMlMRqZyrqyT4t7PDTX8bx8+Bj O5wneKOyBWUey0VJV5wTZMi1HEdsToGMSwbq1rng8Q4NmT8F/R3SrMqmea+Q75w2ww gw6+tHULeVflFJl8VHtc8VB4gfsSxiJmlRzdLg5g= Date: Mon, 13 May 2024 00:14:25 +0300 From: Laurent Pinchart To: Sui Jingfeng Cc: Maxime Ripard , Andrzej Hajda , Neil Armstrong , Robert Foss , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Thomas Zimmermann , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/bridge: panel: Remove a redundant check on existence of bridge->encoder Message-ID: <20240512211425.GL17158@pendragon.ideasonboard.com> References: <20240511140316.318080-1-sui.jingfeng@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20240511140316.318080-1-sui.jingfeng@linux.dev> Hi Sui, Thank you for the patch. On Sat, May 11, 2024 at 10:03:16PM +0800, Sui Jingfeng wrote: > In panel_bridge_attach(), the check on the existence of bridge->encoder > has already been done in the implementation of drm_bridge_attach(). And > it is done before the bridge->funcs->attach hook is called. Hence, it is > guaranteed that the .encoder member of the struct drm_bridge is not NULL > when the panel_bridge_attach() is called. > > There is no need to check the existence of bridge->encoder another time > at the implementation layer, therefore remove the redundant checking codes > "if (!bridge->encoder) { ... }". > > Signed-off-by: Sui Jingfeng Reviewed-by: Laurent Pinchart > --- > drivers/gpu/drm/bridge/panel.c | 5 ----- > 1 file changed, 5 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/panel.c b/drivers/gpu/drm/bridge/panel.c > index 7f41525f7a6e..762402dca6dd 100644 > --- a/drivers/gpu/drm/bridge/panel.c > +++ b/drivers/gpu/drm/bridge/panel.c > @@ -65,11 +65,6 @@ static int panel_bridge_attach(struct drm_bridge *bridge, > if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) > return 0; > > - if (!bridge->encoder) { > - DRM_ERROR("Missing encoder\n"); > - return -ENODEV; > - } > - > drm_connector_helper_add(connector, > &panel_bridge_connector_helper_funcs); > -- Regards, Laurent Pinchart