Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp1697268lqo; Sun, 12 May 2024 14:22:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCURsEXbx7WaN7JKAh3J27GkjjIrHp6J3sEsAWt8zZg5mJOg5Andbk5PiiNqSMMizuMoCd0usH/HdETQbt6dFqPVRaJn09qx1G85vom0fQ== X-Google-Smtp-Source: AGHT+IGxuF/IlxR6EyYauRAR0Jk6w+leuRUCDbnlj3sNlsimRMGQn4FPaVUMTa9rPEVPOquuDDil X-Received: by 2002:a50:c010:0:b0:572:a6dc:45aa with SMTP id 4fb4d7f45d1cf-5734d5c1796mr7820630a12.4.1715548958306; Sun, 12 May 2024 14:22:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715548958; cv=pass; d=google.com; s=arc-20160816; b=A3c4V8SuyvyBYsJnLX/Yvi5ckvlS3bJW2lYpdfc+7t7Q0+0daRUPNwwcU4qr82AeV4 haK2FiKat1zuhkE6aCniHkNu/kqqIOqQwgCdisQFNVv2wS4DwL8h4NP9jhElW6OVX/i2 dMnAJWRpv4q0AZm/RdjUAlauSq8Mq2LxLDz8wYm7oCPZLtlXlC+99sFqr/UF+nCdrVjv e8s9A2IJvyPfXl6pc27uzqIvcf+0vuBg1KAA0M+lg2w6/kwoC1AyYCEMQe2ppR/vAdwf EmFiTPFpjV6FFIBloahjq82wDNKYYjcNnVDQ0ZDMGiBvYaKazv4BybXeXIEWiCrobb7b Z7LQ== 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=1rxJgBRJdZzRaTZysK6jPTXttZhXhB8gPsFMJYjBFwY=; fh=sWWf72krJ/MaKTAbxyf3fw7TL4LwGgzoywK/5UTrsvc=; b=qNOigF9ztOsJqZHLXsGkKZHfQ70qN8q6GCkRWaYpVbEMUmewaZ/5BPHY54ckwZt8q7 IB/IkK373Jw1WB+Ixe5ALlpUzjzddLbfjtAcGRSte6umF28ePhp5ma5YBGb/vFwsxGV4 hlZbUfQs32I3DGZpA+pj5lYvF005o7k3IOqqQOtKtnRsjrRVm2AdLSL7iEZrgerfgCwL Wb6I/BcnQNIG6GGNFj1O//ca4LXBIhUXHl4zFd3SlbOhBT471TZpvLxJP+/V83lU5lwG CjfxWHuXXimThP1EXBl8Mt8akeh3gh1VOdPOzpJv3SgQn/MXI/L9LCI07Vd4WABjDbTE rgEQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=YxcMJYwZ; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-177026-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177026-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5735a4a9fa3si2741435a12.98.2024.05.12.14.22.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 May 2024 14:22:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-177026-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=YxcMJYwZ; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-177026-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177026-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 0F6DF1F21651 for ; Sun, 12 May 2024 21:22:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6EC3A3233; Sun, 12 May 2024 21:22:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="YxcMJYwZ" 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 45E5F381DA for ; Sun, 12 May 2024 21:22:30 +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=1715548951; cv=none; b=mCES4tY2CCMNgFURuYuFdfbQUiznBAGE5ifSvrqK0UpOAYH3ifNZTpiPXvZLduXtbg70HOrpFRq4t1pkXd/8BUBG9LXzLeseT9hatyCU56i5rU8mw8oTVnShrGPJJEgBIoE0E8v6ER2gvk9WIKIY29WCgYyF+15DJsL0Aw6oCXc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715548951; c=relaxed/simple; bh=IpE/1z4h7esQnfB3BIM9qsCQl4xVSuaOIPmnyTRgaBc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=p41QumzkWziqX2zSrpSvpgpWw4acPO+fbDQkRWdAT95YRQwpkUGnnetQfwqNwvoj5yA4njqzQiPFe6JJAIWgDtl575da6KiN90s+9Pp487DSAfn42ItU82UxcKi93OLmAs9LfdthYbKe/sTo6/AwdWyknUv1Xp5Q9l14KUq/DXE= 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=YxcMJYwZ; 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 AB2BB8BE; Sun, 12 May 2024 23:22:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1715548942; bh=IpE/1z4h7esQnfB3BIM9qsCQl4xVSuaOIPmnyTRgaBc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YxcMJYwZCxTQu53OrYfLQOFrMUZazvyfuG++c0347NxPAvHlz6JXv4gaeKHyFGh0Z t1LZGBRV58ZdFi4eHbd163FJPs/SZz9lz8P1XCMVp8bFSjxx6bvtl4FQ8AYydovExq pCKoKqeaq0FmSJDKMIqNl7Ry8EIQjv2ccgvwKxDI= Date: Mon, 13 May 2024 00:22:15 +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: cdns-mhdp8546: Remove a redundant check on existence of bridge->encoder Message-ID: <20240512212215.GT17158@pendragon.ideasonboard.com> References: <20240511143027.320180-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: <20240511143027.320180-1-sui.jingfeng@linux.dev> Hi Sui, Thank you for the patch. On Sat, May 11, 2024 at 10:30:27PM +0800, Sui Jingfeng wrote: > In the cdns_mhdp_connector_init() 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 > adv7511_bridge_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/cadence/cdns-mhdp8546-core.c | 5 ----- > 1 file changed, 5 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c > index e226acc5c15e..16b58a7dcc54 100644 > --- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c > +++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c > @@ -1697,11 +1697,6 @@ static int cdns_mhdp_connector_init(struct cdns_mhdp_device *mhdp) > struct drm_bridge *bridge = &mhdp->bridge; > int ret; > > - if (!bridge->encoder) { > - dev_err(mhdp->dev, "Parent encoder object not found"); > - return -ENODEV; > - } > - > conn->polled = DRM_CONNECTOR_POLL_HPD; > > ret = drm_connector_init(bridge->dev, conn, &cdns_mhdp_conn_funcs, -- Regards, Laurent Pinchart