Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp1696862lqo; Sun, 12 May 2024 14:20:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWVeaASJmg4qP5pXaz0b4dtyVXDnZkqFqjwOlDzzGuvSuOgkIxCAoN84BH4JTB6A3dyfBrSqmAVA84nE5BGypDUQ6AHFQRBCP7iX2HALA== X-Google-Smtp-Source: AGHT+IG+dYuqSP0zc8/d0v+5bK99rtloDkrbY6u0plAJYFmAzAlq2IrsVMxkJh4jHvOwlu9Ka2D4 X-Received: by 2002:a05:6358:3a0e:b0:17e:53f9:6985 with SMTP id e5c5f4694b2df-193bb62437amr987346755d.14.1715548855165; Sun, 12 May 2024 14:20:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715548855; cv=pass; d=google.com; s=arc-20160816; b=NstQ9EaJrbRe20oQVXmot+mEeV7Dzj2aOWooci+RQWMVyplra10tEYUZbUxdRRWSOE sJkhWi+gDpm4MkVthSQWea9PeDnH1u4gV3694VLUJOrRHfd/iOC9PnZ93heFUgS3/emM L47Ojhh0m6IJf8JnLwRWTe5n1G2Xg7SGE1leK2c8w2Xk6dDnt8xV7lG69cvhzZXMF4Rx 5yidT1NOUMwVN/F1eLfFbCYSWDWopchWmfo6ykze2HUfW2cWpwwnJEgc3Pp1y5pxBTkn 02JnrAUN6VBGMEE/i9esvkzqQmlJDrabfCB281UmJ8nQd7dBjsNF8CcOao5lqPGV4OfH /bfg== 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=rL+1v2NmAmvQYEZ6MmwWtyzcT+V2VEmsEG0u27dP7k8=; fh=sWWf72krJ/MaKTAbxyf3fw7TL4LwGgzoywK/5UTrsvc=; b=VeQnlhfNJGpZHd+aH8x3IQdr2S3pPcqZJt5dh7SmSf3Itj+h9zgwST+a8e5A5qIw6S L+MuPzXAxpK3U6YIK2uoERMIOUaT3ezpbkeDeDgMNCe4Q7wj5TyRWWzsSgHccllwAcur d/069kpWC6Q5qLAk/3yXdSSBK1YRHrZeGIheAFAFJJ+96SwRc0KkPLjk9tEhNv/7m8s2 WtMDaIE//ZUmPDQGtrM4UxFQX84qj8n0yuDsnBnffCrd6EGHZ6ZKH9/ZC8Xw5e4Sp95X Bbpj8EMIoCyKfIPBvs87iTK3N59iq/Ie6yI9UIItEyxFtMaDo3n0OWq5ZAEjVQIUpFnI DMmg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=RNNvYzjQ; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-177024-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177024-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 41be03b00d2f7-6340b395298si8091390a12.229.2024.05.12.14.20.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 May 2024 14:20:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-177024-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=RNNvYzjQ; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-177024-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177024-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 9E676281376 for ; Sun, 12 May 2024 21:20:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EB65D54725; Sun, 12 May 2024 21:20:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="RNNvYzjQ" 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 D36303233 for ; Sun, 12 May 2024 21:20:47 +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=1715548849; cv=none; b=Sz0INXqgEPygo3GVVnaqmO+kIVc/MADpikmt6Repkkf5RHKq0nTJvhMIiRYb4lFmFf5mGHVai3+9liEvlPiWmVXF1I3Hkw2fgNnohrS7UHTWZ06L0g6t4gQ5iNcE5hrEmFfg1yYJjzK+rfHpu1F2e6fZgH7Zv+0mwvhp6yQqJKM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715548849; c=relaxed/simple; bh=IYYvknnK9tyMIPvkrRHEIHoGdP9l9/eZ68/Kr7wpv+0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=IAi+1LnJQCTWLwoBPzbiT+bhyMsGisWZJlrOsVIaYvxVukFYuJNqKnYjd31zcWil8dNfA/HOcQJGLwlSiRLV/KITV70Z7zYPH2Isb4Ue1vzEuiIkHvdiJTjob/E/UYg5KCx0v20tNhJq028KuHKvKycK6YUlSiKYfFKFI6juXvo= 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=RNNvYzjQ; 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 95FD38BE; Sun, 12 May 2024 23:20:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1715548840; bh=IYYvknnK9tyMIPvkrRHEIHoGdP9l9/eZ68/Kr7wpv+0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RNNvYzjQXug1DRkE6BuFngaOZSHvkHanbsF/RB7Ls1Z7jDo2P+cijEs1UoyCEyU1C bqjd1aubB7jMFzvGOJXNC83LOWTJ5TdyHFHyJv+ebf7xwV7778smezW7F9yvhCLlHg rPAKhpwHPpHV/SJkd0jGtSVLObWWPBM7mijIsiM0= Date: Mon, 13 May 2024 00:20: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: synopsys: dw-mipi-dsi: Remove a redundant check on existence of bridge->encoder Message-ID: <20240512212038.GR17158@pendragon.ideasonboard.com> References: <20240511144713.325156-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: <20240511144713.325156-1-sui.jingfeng@linux.dev> Hi Sui, Thank you for the patch. On Sat, May 11, 2024 at 10:47:13PM +0800, Sui Jingfeng wrote: > In the dw_mipi_dsi_bridge_attach() 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 > dw_mipi_dsi_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/synopsys/dw-mipi-dsi.c | 5 ----- > 1 file changed, 5 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c > index 824fb3c65742..c4e9d96933dc 100644 > --- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c > +++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c > @@ -1071,11 +1071,6 @@ static int dw_mipi_dsi_bridge_attach(struct drm_bridge *bridge, > { > struct dw_mipi_dsi *dsi = bridge_to_dsi(bridge); > > - if (!bridge->encoder) { > - DRM_ERROR("Parent encoder object not found\n"); > - return -ENODEV; > - } > - > /* Set the encoder type as caller does not know it */ > bridge->encoder->encoder_type = DRM_MODE_ENCODER_DSI; > -- Regards, Laurent Pinchart