Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp1695508lqo; Sun, 12 May 2024 14:15:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVwkhEl8J62FRwzlGUzJgE2m67HWZpsM+498JyMZY+wW/c0+K3qQSlXhlrqc4K04utDVqG3L3AxLL6zRSO9mL6Chi1uZRYtu3zwbZuGfw== X-Google-Smtp-Source: AGHT+IFO4gLhv8ZQHgUoTsuopyM5pZdapNY7lK1Otnb529k97E1okKfWObCQhj32eRr9sVOljIwS X-Received: by 2002:ac8:5908:0:b0:43a:ed56:4c86 with SMTP id d75a77b69052e-43dfdba8fd0mr86310971cf.56.1715548522921; Sun, 12 May 2024 14:15:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715548522; cv=pass; d=google.com; s=arc-20160816; b=TCl2ulC2cErpSe6nGqsMt6CwFS6abKkT16/8K0jnNF9EhA2j84Mi3PXSmauJgGPb+O LXepFsBQSJulotwcld7JEQ4qDOT0wAHgO80rwMrSTazPYR9TeN/ZCxx6xx2wFjDyeSGE 9DWTy+YvrDgP27kPlw0do+bd8y5b0/dg0jWkgpycNcSx10EWa2eO0hC30XAtaIcSsPtE 37cQBRdQ+Xb6W2fd7LANz6BGH/PhVNGP/ECgW6H5gt+oKz08i7f/U4jjPl8hR2/tl4MH 7c8SaHQVPrH6yt5nb+rC+vjRaqSvrRb5RkoPg7UTSCl9oWgOHVRsKbDbZ/DYyvzsqYse XDVQ== 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=u3BfkhqIsskwDUNY8oahcM1rZtTjW3XWohlW3RaY29Q=; fh=sWWf72krJ/MaKTAbxyf3fw7TL4LwGgzoywK/5UTrsvc=; b=rZxaXZEsYULMdXv0eJcr/WjMNHctUebfe9078J9QTjGb8rPdP1Ote2i22OVvoSgHIY p7pbTgk/CSaxAJ8LpKQoSZmkWD6kfAbzxFM2krUEG/PZwXFY2Cse3TlfQYgR87654z4P JuGSP8FoFgIlsF9ROpTQopJ3TTAZqfYMgQrK+uvc9wzCU1Z9wOjqkkZa+J5DQ5HIcJsa 67uBGNt/KBxuXRmm+6GCrKgxs5l5IMoiNKs/VsrEVajy2hvDtY8h12hTku7SLBilqVLZ LTDGDeot4DxvfndRsmeb5sPxDAD8IuJeFfy9Wzb61uQsaW7LMWe637kklkS2Ibf2QteD r/Zw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=gKMkrveb; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-177019-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177019-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-43df549cf7esi81689001cf.28.2024.05.12.14.15.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 May 2024 14:15:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-177019-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=gKMkrveb; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-177019-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177019-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 6C5941C20BCF for ; Sun, 12 May 2024 21:15:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7CB3A54725; Sun, 12 May 2024 21:15:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="gKMkrveb" 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 5AADD3233 for ; Sun, 12 May 2024 21:15:15 +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=1715548516; cv=none; b=FMR1fBy0rpxN/ktwKO/q6eAdeEzeYEWsQlABZpg0rJR2TcszUFkSoddZFsjwHigvtgcpdU1oi30V/4pLkyfZxrIetQucfNdp1CNukHDrxaOL22MmOhaq6jrZjEpaA/gKlfCJCpLq1KuYyzHk4p6RBtzXm47t2wcrTQDOmR2mviQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715548516; c=relaxed/simple; bh=Rkze3iANAO8ka/TqH6bLFED6WH90fpw+Xj1Fk1AxUKY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=LSJ9ILyOA+ILirIdaLgaql2KWM9zb+JWiI+FZ+ONPDtSuLKgAWm0dasTWOLFzZYLlLaeZNJuT68l2WewYYyvhFdDfP0jsNI3jHyRs6G73y5ArLEZ1DVLh0HR4NfNwxrULFC2Pc9wSV/XbiwdYsOYZV/nk/P+8f3Fpclb36ginCk= 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=gKMkrveb; 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 C4B00A98; Sun, 12 May 2024 23:15:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1715548508; bh=Rkze3iANAO8ka/TqH6bLFED6WH90fpw+Xj1Fk1AxUKY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gKMkrvebfwOotaJNVHsGOpFLDbvnJALxqRtA0XsmJx84n+aUG7NAs4As0rccyepL0 ZNswEqH95lgUyUMn2EpaN29pQ+G9U3WqYA0c4gUAqBv1t2vkI3ej001e3y0fD4++0v ocpuaDA87oX/zBbooTsDYliElX7NW54ddNtsaadc= Date: Mon, 13 May 2024 00:15:06 +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: it6505: Remove a redundant check on existence of bridge->encoder Message-ID: <20240512211506.GM17158@pendragon.ideasonboard.com> References: <20240511141056.318679-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: <20240511141056.318679-1-sui.jingfeng@linux.dev> Hi Sui, Thank you for the patch. On Sat, May 11, 2024 at 10:10:56PM +0800, Sui Jingfeng wrote: > In it6505_bridge_attach(), the check on the existence of bridge->encoder > has already been done in the implementation of drm_bridge_attach(). And > it is done before the bridge->funcs->attach function hook is called. Hence, > it is guaranteed that the .encoder member of the struct drm_bridge is not > NULL when the panel_bridge_attach() is called. > > There is no need to check the existence of bridge->encoder another time, > remove the redundant checking codes "if (!bridge->encoder) { ... }". > > Signed-off-by: Sui Jingfeng Reviewed-by: Laurent Pinchart > --- > drivers/gpu/drm/bridge/ite-it6505.c | 5 ----- > 1 file changed, 5 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/ite-it6505.c b/drivers/gpu/drm/bridge/ite-it6505.c > index 27334173e911..494030a75dba 100644 > --- a/drivers/gpu/drm/bridge/ite-it6505.c > +++ b/drivers/gpu/drm/bridge/ite-it6505.c > @@ -2881,11 +2881,6 @@ static int it6505_bridge_attach(struct drm_bridge *bridge, > return -EINVAL; > } > > - if (!bridge->encoder) { > - dev_err(dev, "Parent encoder object not found"); > - return -ENODEV; > - } > - > /* Register aux channel */ > it6505->aux.drm_dev = bridge->dev; > -- Regards, Laurent Pinchart