Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp1694897lqo; Sun, 12 May 2024 14:12:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVnq4jJ9+lmXgG0BhDLPBVgpMrYgJwVZ3cFDghXsJ/hA3I5riLjrmwW8JMmpARUwEarH9zV5Qq7mi2z+iH1MG6LIniI8RPXaczyLHYEvQ== X-Google-Smtp-Source: AGHT+IGp/eOV1ApdqUN/1WnG73VclIrC6p3ButTCHE/vcuubpEaJlUDEgrlWxzL28c03d/k9eNeR X-Received: by 2002:a17:90a:9281:b0:2b2:b99f:4d5b with SMTP id 98e67ed59e1d1-2b6cc454828mr6876017a91.18.1715548377248; Sun, 12 May 2024 14:12:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715548377; cv=pass; d=google.com; s=arc-20160816; b=pYe6kLZvLeESLrDGIjcQ1nhe8YVoIi9wbkMuJFvEQF+KIpT4TGFE1aRfJnjrmyswYI wICXowpL2Mn8Yh3khEKEV+NBJv+FVcEsRuDrZl9TgiafORNDDj9jiU+xGbkBe0owPzxf FeQqjdGIDtj4Q3B9P2gW3WEBIjeVJjDvnILGp0S8kKybQAFD+S09O6y4ECUsLKnKBgAR x3Yv7Jmfa4xXe6insHyokbY3/DE1pEcANUDkZ67kysM5kDVBtFoKrzSBR0fWydwt1iv3 Q816Kao4ZpvEbHRXh/QmNeir1fDAWMEl3CWyI5BPeMam02KD8oc54wKF7B1OYIdU/SQC Oa/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=CBo3/f7SUIP4Og1tTVACExNRsyy8EG5gF4IkR5QHneM=; fh=sWWf72krJ/MaKTAbxyf3fw7TL4LwGgzoywK/5UTrsvc=; b=M9zUXJYRtApJshLM0TQz6Iyqq5iwfap6FzRGmyVrCx16//fuASOLEb1FprLEFsqrtQ MLl+bbkA8jaYcTwX4S15YfCN19/A/QNZAcGbyVqsWf3TDa+I0NnxIa8ebxf1YSqFnPwp tsOCTr/fTZ40/HUKolZq6cHrZYBPGUqv3xi4S2DDTqolWwfrg+wvZKLtz7MjDEHbTDrU QsueIpcbPpCqGC9LXA4PWyT9SGSjz1/RDL3d1zsUFp372p9dZFBci7hqxp+7/kmd8a6I YdgdYSSfFhTol19rWcgEddoqGE4Ei6zTvg2eiTW1u6UwpSyykWmlKHQ4dp4TglYsnQR5 SijA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=o7zlbeth; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-177016-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177016-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 98e67ed59e1d1-2b670f4df9esi4642329a91.47.2024.05.12.14.12.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 May 2024 14:12:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-177016-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=o7zlbeth; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-177016-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177016-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 D2D9928128F for ; Sun, 12 May 2024 21:12:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6316354725; Sun, 12 May 2024 21:12:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="o7zlbeth" 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 E2D7150A6E for ; Sun, 12 May 2024 21:12:48 +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=1715548370; cv=none; b=mVHBqdK7ahfNJK1AeQ2t8/3gAUp69AS4o+3Y/1LTVaXi5X1paBQa5LUAoOzz5NixnBLadFFlytBYjUZUGi4ZrHsv50QZ4qez4gbHUicR1I1DvDFiuypPFF5uy9jtX8vx37auZoll6jUTHGLNglY4rsa0NXX2IyFy83qNbf0kWHo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715548370; c=relaxed/simple; bh=0Y6YWsXVS/Pnd6DKSQDP6mb62MOpLyFDRoFLxmIMW+w=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=OgGCZUZTaXvTNaaXyy5kqt9pg1qMCUssUa75Xh6H7DedgCwT6ml3LRMsf7yPNp7zq48aHt+nNESDG4AoVrCTlMtszxQFNTV2l4bfWmhN+y7X+Y0fkmMY4afRO6wYsXC2ES71pjD9z4FiFK3WqPyWaPocAsQOVTEtN0uegOG5B5M= 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=o7zlbeth; 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 200EB8BE; Sun, 12 May 2024 23:12:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1715548361; bh=0Y6YWsXVS/Pnd6DKSQDP6mb62MOpLyFDRoFLxmIMW+w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=o7zlbethJzCmIh/T5QP+RvEyUBA1J1mLuWM5vdGx+4UXJlCMKHlbuB+SKrwmkQDtI 3u186NcufAoj1bahm1S3g05e3bgH+vqrOgewA2XvNOfu7rRh42RHkhO4RXgfhKFt/s WdXUz65vxVJjLulfIsbaXWJt5EtmqQttzp2rM0ZI= Date: Mon, 13 May 2024 00:12:38 +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: tfp410: Remove a small useless code snippet Message-ID: <20240512211238.GJ17158@pendragon.ideasonboard.com> References: <20240511132423.311884-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: <20240511132423.311884-1-sui.jingfeng@linux.dev> Hi Sui, Thank you for the patch. On Sat, May 11, 2024 at 09:24:23PM +0800, Sui Jingfeng wrote: > In the tfp410_attach(), the check on the existence of bridge->encoder has > already been done in the implementation of drm_bridge_attach() function. > The driver won't go further if bridge->encoder is NULL and the driver will > quit even if drm_bridge_attach() fails for some reasons. > > Therefore there is no need to check another time at the later, remove the > redundant checking codes "if (!bridge->encoder) { ... }". > > Signed-off-by: Sui Jingfeng Reviewed-by: Laurent Pinchart > --- > drivers/gpu/drm/bridge/ti-tfp410.c | 5 ----- > 1 file changed, 5 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/ti-tfp410.c b/drivers/gpu/drm/bridge/ti-tfp410.c > index c7bef5c23927..b1b1e4d5a24a 100644 > --- a/drivers/gpu/drm/bridge/ti-tfp410.c > +++ b/drivers/gpu/drm/bridge/ti-tfp410.c > @@ -133,11 +133,6 @@ static int tfp410_attach(struct drm_bridge *bridge, > if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) > return 0; > > - if (!bridge->encoder) { > - dev_err(dvi->dev, "Missing encoder\n"); > - return -ENODEV; > - } > - > if (dvi->next_bridge->ops & DRM_BRIDGE_OP_DETECT) > dvi->connector.polled = DRM_CONNECTOR_POLL_HPD; > else -- Regards, Laurent Pinchart