Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp1695065lqo; Sun, 12 May 2024 14:13:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUEvfOL8gLMG721AHdgIjPQ0HlVFOwJ4Cd+dhVCC8NjqNiPdslEOqtBbiYA/aN7otHU8ucprweYuzYbNV2IGUjqcm8XgJyuxaAElWBqAw== X-Google-Smtp-Source: AGHT+IGectpNt3rlFsvelfqfRZfKbkBIzp5FEFUtK4NBp5zHa9gHbyYACrBWwfa6vOshzBBg2Md/ X-Received: by 2002:a05:6a20:3c87:b0:1ad:7e4e:428d with SMTP id adf61e73a8af0-1afde0cd675mr11577704637.20.1715548418816; Sun, 12 May 2024 14:13:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715548418; cv=pass; d=google.com; s=arc-20160816; b=0pskxfXvf8TpV3GsNQVTBLBfQXQjSw38Gdc8bHat8uBsdLn/AvxCgekmCJ4dXsWPPL c32YwG211z1qsfx9cGEIGJIvPBr1a+uUahkezoXct+JzNEAoSnqGAmJf4lQ2nW+C+5os H1MhR7mtX5nmK09U0o2g9ZTxgxT5FP4C4pi7497hbS0fAMdKgBo6dp91HHpLuaoS1xgN uKvpM2c9AkWZxE5s0i7qGQxW/Pbe3ILrv+dNxWh0I+5N2udSFVoE9tKKgi0GJX9Tz+C8 j9iWZEzfzVPXE6toSJDQMbCc/zw7S3Q7dnHiO5jUMgBWjUYVcgqwsZE+ibAkDmVe0wZa JzWg== 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=ZMMrWZKz7nQnPgNlq9UxNVqygbI9u3moJ+3ZN1u1Cww=; fh=sWWf72krJ/MaKTAbxyf3fw7TL4LwGgzoywK/5UTrsvc=; b=sQILsLF9gbF2PF/73HW1MJ62CW5Rvs4suOIfb9KaJ9a4PTlxjlakQRy8XTXEJPlsnk dsYojSbYQOVweQyGsfUWESUpEAKKj2EIoN7ZN1hxdgkHyD/rg2F/sp59bb+Ioty9G6vx 7Wd0X0MLmWAg1BJ2+cor4H0RS5P9ZmlLd9B8cEZAhaFRDnO6tjZRWtybBU7S9rN921ws 04YeOKaQ/q0dcFyr5ADUH69AAx1alg2TIKwFnA+fPQ7XPPnTlJp1TX0mlm3BUvjtoMpF NjZOeqlZJt1pkM4OB8CkNvqeEK1LuWH+GC9rsiLJTWSsFCMMN+KtEkn+tRUhymRScUgp BGnQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=Oagbd5b0; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-177017-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177017-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2b628a5d478si9855392a91.55.2024.05.12.14.13.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 May 2024 14:13:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-177017-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=Oagbd5b0; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-177017-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177017-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 74660281049 for ; Sun, 12 May 2024 21:13:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F039054913; Sun, 12 May 2024 21:13:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Oagbd5b0" 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 BD8C654762 for ; Sun, 12 May 2024 21:13: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=1715548412; cv=none; b=u2eXtVmUeTj7lFl4FbPtjQpsgrVL+VQxnB/WEJuNhXT3iNGjMQoymxIXa1Gmo3MKzlM90a+KRI3ePW3o8MK7AHBgkG0FOV9TUS/seFZo5AkCk+upyhS1vUPr/iFn/CJmaL9lSlqMc2a4FssIGy3hbKiZu9sP/eUgHwwE+VPefnI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715548412; c=relaxed/simple; bh=wDUVbv8ZpYrdpvWTtjkKG9IWXTdRp0GildcxKyLIlAo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=cJxxQkDcEJdqCcNPxIoX02lsHqB3Swa9fQuRTBeA/zU0h96q9TearjBmk36I8jBHkEMHig/dbgT2P446FUJQH49L5hP0rBWCy8Cx2xOlwtCF5MWmHJYOPHBlwONDY+3n15KK/I5Upc5LdtdhtRoIdyE2jyCQp14XM/D6VnRKNos= 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=Oagbd5b0; 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 3EFF78BE; Sun, 12 May 2024 23:13:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1715548403; bh=wDUVbv8ZpYrdpvWTtjkKG9IWXTdRp0GildcxKyLIlAo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Oagbd5b00gl5Njyd3u5ypxKJ/hgK+l/Ok/rKSJEuXzER0o/7sm5Z8y4lMlzstK3Uf G6ghJcW/HtQYzoWAVPHr6bhHR0dPX+MthO1XjT6nux3Cy+PTFjw5sNiDgTkeH59vA5 oYefUCdaZicEYg9LGU/YAGWhQ4bFLPuxCmqYapzE= Date: Mon, 13 May 2024 00:13:21 +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: nxp-ptn3460: Remove a small useless code snippet Message-ID: <20240512211321.GK17158@pendragon.ideasonboard.com> References: <20240511134251.313513-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: <20240511134251.313513-1-sui.jingfeng@linux.dev> Hi Sui, Thank you for the patch. On Sat, May 11, 2024 at 09:42:50PM +0800, Sui Jingfeng wrote: > In ptn3460_bridge_attach(), the check on the existence of bridge->encoder > has already been done in the implementation of drm_bridge_attach(). 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. Thereforei, there is s/Thereforei/Therefore/ > 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/nxp-ptn3460.c | 5 ----- > 1 file changed, 5 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/nxp-ptn3460.c b/drivers/gpu/drm/bridge/nxp-ptn3460.c > index ed93fd4c3265..e77aab965fcf 100644 > --- a/drivers/gpu/drm/bridge/nxp-ptn3460.c > +++ b/drivers/gpu/drm/bridge/nxp-ptn3460.c > @@ -229,11 +229,6 @@ static int ptn3460_bridge_attach(struct drm_bridge *bridge, > if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) > return 0; > > - if (!bridge->encoder) { > - DRM_ERROR("Parent encoder object not found"); > - return -ENODEV; > - } > - > ptn_bridge->connector.polled = DRM_CONNECTOR_POLL_HPD; > ret = drm_connector_init(bridge->dev, &ptn_bridge->connector, > &ptn3460_connector_funcs, DRM_MODE_CONNECTOR_LVDS); -- Regards, Laurent Pinchart