Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp1696308lqo; Sun, 12 May 2024 14:18:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCViWCv57YCDI4zhdk3665CyQdCtUAfuQlnVhjIgFvKm0S52u/GM6lhT1HjAZqU44mYIrgTI6h+QwtAv6A4KgWRSF+aTfB0DPzS4USUQ4Q== X-Google-Smtp-Source: AGHT+IEKgoMSHqp51YhEQMnRBF13xSroput6y1iIiIUnqXxmmvfX1FFiuQV++DYIDhTR03MlNwY9 X-Received: by 2002:a05:6e02:1648:b0:36a:686:b3bf with SMTP id e9e14a558f8ab-36cc148e3c2mr109624365ab.17.1715548713782; Sun, 12 May 2024 14:18:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715548713; cv=pass; d=google.com; s=arc-20160816; b=iKCu82jqO+XR6bYA5DySmj9bi+UtPJsXjW+ratIqMbajAwmF7QEfyoNGcLVkCb2tDU In+wrFm1tl6sQ/sYE9WvuSp27EdPIM+y/FGfl0v9DBACK74wda5Mdc04dZWxI40wPB0v Damn/wSzNUpBh5c774K3AkrWwrN8XUFUeOwhyBgYjytfFj+qL83zx+z4ZmLaSF+NVxua l6SgIcbXq4U/fNQqFa5B7yZOM82y9bVACNyuhLGPimji32loCDtZYwogwyUFuTecALQz cKMRcQnqKea8FUGRsQR/M2+geSMBXT6AC11RqlCqzr6n8no6Wa2EVZnJMMc2yFn7UgXh iV+Q== 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=aP47+BWdDRfWbhleYNRbNPgTfaXf0HnhW/fWB56sJec=; fh=sWWf72krJ/MaKTAbxyf3fw7TL4LwGgzoywK/5UTrsvc=; b=kzJ3AO6dD8oOmsPC2EK/WBu/iKQmiWxREuVtVhrXhAo6gn3/z+1vhKcGayNsNt2/qK /4QPYbr7h5ms62eKj2Ixya4VVozg3ftOc20+mQAjzMxgqJS14BJPPSpKLq/4fdYz6A66 z3wr6G3612x8YTJmldQBMl1aNI+2q8N0/G/xktIPrc62IP9lmeh01ShWYK99MOpO/QN0 xwcr3MEWxty2IRi8nQg/wGeVODHGY2Phrc3czHyFCu4AjsVspZVa33K2NLNvCZh5WRny VB1l73EbeIkj+ZkR/VIXzzAzJxUluK6+2FwbMF3jb9UT75yPGKwxXUGIls2ENJ85u3c1 mpcA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=TXKD5RQV; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-177022-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177022-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 41be03b00d2f7-634103f566asi8181815a12.381.2024.05.12.14.18.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 May 2024 14:18:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-177022-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=TXKD5RQV; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-177022-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177022-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id A8AA9B2121E for ; Sun, 12 May 2024 21:18:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E1E545645D; Sun, 12 May 2024 21:18:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="TXKD5RQV" 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 BD67156443 for ; Sun, 12 May 2024 21:18:20 +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=1715548702; cv=none; b=ur3nN+qGEkoICcIfj2Tqynn/qdwD3mqXEiyOr/jOTVfw2foo6TidqPu8w1DdITvBC30iE+Abcfx7MtkcsPMeWt3uK5oULJZI62xe5QUL46+GuIKybqTfdiIVcdDQc9OSlI3+PX61GBbPEm0P4DT5Dw3+gJJpDIwEuSvNYKN5KiI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715548702; c=relaxed/simple; bh=RDUZ8+FocGX8YVEG5nU4EkYFd9O449ehrN3FKTWnLK4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=KKdmzpZd7bqub+wSmXrq94p8FHaqvWLFM+6Exth3ATe9ofBTfHBFKZfbEGXXOyOhxxT8J6rFTcJImFnTjU+CMSGrfxWrSaZZPWRRon9uBQWqet7WcpZMnV31P2ZG8LSIzBAqUZCHUx2863qI/x47lzMHbbe5qZ9aumnMIXgbHm0= 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=TXKD5RQV; 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 7914A8BE; Sun, 12 May 2024 23:18:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1715548693; bh=RDUZ8+FocGX8YVEG5nU4EkYFd9O449ehrN3FKTWnLK4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TXKD5RQVNPAMLy89fHsB+1Btre0gQHgdcxBRhUPPjYvw/pc56g3Zx1qqaz9B4ocKW gUtvoCUqf6EF1eNrM0XrMRuE953FJADPfBUDZ12KvG6OmA4UPes3N4PoqouIMDdTRn 7BUGne6QYrf0h+IUzmEeGrtqTJ82pwBO7N1R82Es= Date: Mon, 13 May 2024 00:18:11 +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: adv7511: Remove a redundant check on existence of bridge->encoder Message-ID: <20240512211811.GP17158@pendragon.ideasonboard.com> References: <20240511142308.319541-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: <20240511142308.319541-1-sui.jingfeng@linux.dev> Hi Sui, Thank you for the patch. On Sat, May 11, 2024 at 10:23:08PM +0800, Sui Jingfeng wrote: > In the adv7511_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 is called. > > Remove the redundant checking codes "if (!bridge->encoder) { ... }". > > Signed-off-by: Sui Jingfeng Reviewed-by: Laurent Pinchart > --- > drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 5 ----- > 1 file changed, 5 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c > index b5518ff97165..1a0e614e0fd3 100644 > --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c > +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c > @@ -871,11 +871,6 @@ static int adv7511_connector_init(struct adv7511 *adv) > struct drm_bridge *bridge = &adv->bridge; > int ret; > > - if (!bridge->encoder) { > - DRM_ERROR("Parent encoder object not found"); > - return -ENODEV; > - } > - > if (adv->i2c_main->irq) > adv->connector.polled = DRM_CONNECTOR_POLL_HPD; > else -- Regards, Laurent Pinchart