Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp1697026lqo; Sun, 12 May 2024 14:21:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXbP3+RpWxugnemorBRePaLT7XAowt/JCxwMyMY5mDwoat9eK+u+/H1bTC5lrjm7HC1IeaE4VpE2DDytC6vrtE+mi6mOLYyO4Bxg2xDHg== X-Google-Smtp-Source: AGHT+IGRBbn3TpK2T0f3cO3BC7i0T8NQeTEXx7lk2qVAc2d6SPQGs/KZ+JAtzWpW+LKwzKlepM+Y X-Received: by 2002:a05:620a:d4e:b0:792:91e0:e236 with SMTP id af79cd13be357-792c759012dmr816798885a.30.1715548895906; Sun, 12 May 2024 14:21:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715548895; cv=pass; d=google.com; s=arc-20160816; b=XsRI2NS4C4P0wLa8EJqJTmNJPItE0MrAbfvsG8TuqL94eeLLNiGnpDxNwc/NuZ5zXA WuUKDMexXHZVgYzEiD0IZN/fa1R7bLhpHiGyn4V4EkGqWxjoQiQp/tWWJI0CZZJv7+Rw cyRhTaIkAWXZ0w+2kw5io8lqWaFJWzOVV/VP3JK3hRU8SsE8ro2riRlHbxz8Oe97S0fz +6vdjPw+9FTZjaSdQZKH6a2RYnW9A+7qP8tKaZDXWhabqgCjuTFkD00XV6nRoeLiDiwS seb5WBZsw8Ke2zT9+TOSOCfk8tYRllYlqxmtaKvf6XaodUm+BPsLSj5gOmJTRM0jErT2 1zjA== 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=mda6ynCftHo0FiBitw8g6BMk/Srqal2BPPYesxLOluo=; fh=sWWf72krJ/MaKTAbxyf3fw7TL4LwGgzoywK/5UTrsvc=; b=0n4dX0tKWUv4HyErHIXs017gmABa6lwDSiqWaVAuAEfXCag0Glim6qJXXIQNJ3URYU SKgPoKnvFp3HrdxMJmh7zUnNY6YxPhnyWb8elO1j4ffFEtIfzO9SnYzaKLsdw7KfE00z 4M5nzFMuM5p2uSDcQNvE6CXrA1Iu2+UIOpWbIoqP1vvZ3hv9UcTQnNuNiRJAmctpx2Kg PDbtn20xHypQxx2SssqOR+GlHT4KKV7icfHg3tyAiXL/iIx30yrySuICnkyPN8JdiujW 9YAvNW0+BWJ9yE0rZuVWi34pGW5DLsrRViE9btsmlgqst+PCPfwg9FL1gMLg5GLTCf2u 9peA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=q0Zgd6n1; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-177025-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177025-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-792d77be583si307176085a.373.2024.05.12.14.21.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 May 2024 14:21:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-177025-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=q0Zgd6n1; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-177025-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177025-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id A20F01C20C5D for ; Sun, 12 May 2024 21:21:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C02BD54725; Sun, 12 May 2024 21:21:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="q0Zgd6n1" 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 A4B213233 for ; Sun, 12 May 2024 21:21:27 +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=1715548889; cv=none; b=SN/myZc6+0PBqZNOqUPumanXO6hdX6dmMkjhm/Ht/8FLJ15IfvtQV3umX4WcGsGFYAbTxGmZKkvDgFj2/M9mZhdjn2MD1d9ZeCztVj4pNEyD1Cpydth0iT4BirN6bg5flqBNVCEMLyen9SmFhbmG4NaWomW0ixDY+XKlLPbeqL4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715548889; c=relaxed/simple; bh=5liMwDMQqGwgDBOeSGRvPnrNGvH2XDVoxgQf1n5jyxw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=kDwFywcQ04Qobs48sgE3fS+L7pcCxb4zxInOYnh87xhi+qDua9cabCY032ozaq24n4WZ/A9sRXbNgyRbqGPLL4ut59Tz0ZTKlR8aYgzUxMadjjnv4/hv24XSJAEMZ5XhNMUa6ZkAsqHj/WEluZfpJX3Ux/QuXtKPryXnpejl1tE= 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=q0Zgd6n1; 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 9485B8BE; Sun, 12 May 2024 23:21:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1715548880; bh=5liMwDMQqGwgDBOeSGRvPnrNGvH2XDVoxgQf1n5jyxw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=q0Zgd6n1KxI+ollROOJQX004ZWu0/657VKEUFRgLE1wZzHEWcrEfyd328HCMPuj/P fvUmFwMmBzXkurYRoA/mAIzR8j3tpgvmTJFAx4ugGLHjieH2Gwc2WmAO3+7H1X8lq/ igBpPqeezrPMsaKbcNIHaYEkSGDMeKz1A6XAre00= Date: Mon, 13 May 2024 00:21:18 +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: megachips-stdpxxxx-ge-b850v3-fw: Remove a redundant check on existence of bridge->encoder Message-ID: <20240512212118.GS17158@pendragon.ideasonboard.com> References: <20240511143820.324369-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: <20240511143820.324369-1-sui.jingfeng@linux.dev> Hi Sui, Thank you for the patch. On Sat, May 11, 2024 at 10:38:20PM +0800, Sui Jingfeng wrote: > In the ge_b850v3_lvds_create_connector function, the check on the existence > of bridge->encoder is not necessary, as it has already been done in the > drm_bridge_attach() function. And the check on the drm bridge core > happens before check in the implementation. Hence, it is guaranteed that > the .encoder member of the struct drm_bridge is not NULL when > ge_b850v3_lvds_attach() function gets called. > > Remove the redundant checking codes "if (!bridge->encoder) { ... }". > > Signed-off-by: Sui Jingfeng Reviewed-by: Laurent Pinchart > --- > drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c | 5 ----- > 1 file changed, 5 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c b/drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c > index 4480523244e4..37f1acf5c0f8 100644 > --- a/drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c > +++ b/drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c > @@ -165,11 +165,6 @@ static int ge_b850v3_lvds_create_connector(struct drm_bridge *bridge) > struct drm_connector *connector = &ge_b850v3_lvds_ptr->connector; > int ret; > > - if (!bridge->encoder) { > - DRM_ERROR("Parent encoder object not found"); > - return -ENODEV; > - } > - > connector->polled = DRM_CONNECTOR_POLL_HPD; > > drm_connector_helper_add(connector, -- Regards, Laurent Pinchart