Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp1089659lqo; Sat, 11 May 2024 07:03:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUbXjiztyAj7y6mQCPqwXHMIKKrgCqfEoDCDRrf7uisDPinDIKdAuaklphuU74a6K0vWo+3xUJ84OJWhF3N27NT97Tc74OUSarGGulgmw== X-Google-Smtp-Source: AGHT+IHT+dvsRjzhMhap1xCUaGugWAYI8LRVfo2R0ykNS8FoLfaSEs6n6BNyxtbwsTLLCAcTj73U X-Received: by 2002:a17:90a:be12:b0:2b2:7855:da05 with SMTP id 98e67ed59e1d1-2b6cc780521mr5237374a91.26.1715436222680; Sat, 11 May 2024 07:03:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715436222; cv=pass; d=google.com; s=arc-20160816; b=CKUG8ZLFM3dNydtCf92N5tE5E+rAaD0WsELedPl/XcoAShO6zpeNzvQyYP2FqmdYj3 a2qbxR0vn3sFDV8t47cBqRxFDJMHd9zf1zqjMcJCVMXdliUoeyYO9IONGa38XBIVYXFl qu57jenevgb99DxB8DIulBj53qqu104I165vhujLK+668ReIGQeOyU28dvfLtTMD1wDh 9N2wJi0cfbJrWICDHU8waetTMcB6fpwNlBuDkEgGADg0ya2a1EbTLkvC5NSVTNBdzeel 0I+65WO7FRBsz/vZ+ZMdwB5yP536on7hbN+uWMzLIKnau9esoZ1hhNOfv1t3LeMrjXiY +/4Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=HWeNl4C384y+wMABXUhvSGBiKKDCfnTUzIRZ136IUcI=; fh=wOxYnf5cB8EXtrDPB+7Ap+AE3ORvvjAbNrmA+4qPZLg=; b=yJo0m0GB3qmb9A2uA4+PWC6S1EmQ51oqTKmwg1n0Mbp/g6NJVudrn6DGGgcRJ8NXsv ySmJ8SObuefk1hBZxlZGu9HkccCfI8XzZ9/knv2t50WHOUMdBVuFxtwpLeDhsXNXyLtP UyUBvErmveoR9l54wpBZSVKYqR2eEjTWegauBbi04ArlMW939iVzjPReXyLafy8D4PZG XDCUUCSnxxY4+hM3MqLBA5B33Qjg6ehi4tPhH/BdRlcVn6uePHLnYwp2Z4yoPtAv2Z6f Vo7Y/8DLwUeHzuudkUO9ZTzs7MBDb60t8TdyOfqHvqkMCvMw2Ja8M8o5BB2J8n1QtLqY Paow==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=DFtm7vDf; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-176566-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176566-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 41be03b00d2f7-63411530b6csi5564709a12.475.2024.05.11.07.03.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 May 2024 07:03:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-176566-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 header.i=@linux.dev header.s=key1 header.b=DFtm7vDf; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-176566-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176566-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev 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 C7CC0B211FF for ; Sat, 11 May 2024 14:03:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 20F5B535BF; Sat, 11 May 2024 14:03:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="DFtm7vDf" Received: from out-187.mta1.migadu.com (out-187.mta1.migadu.com [95.215.58.187]) (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 59FB57F6 for ; Sat, 11 May 2024 14:03:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.187 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715436211; cv=none; b=miNLtkxppDN8zrHv54FgczznMkRf98Rw0TrssgRHOWyrDiubR7P5clvitNVkI6Fe8uzgssg80fNEnC1SYiRDjQGwHuY7ThNEpMcUBpXTyyOwOUAmnAkIMBQcgyGAWwJc/XIpZI92Z7ZUo8y2Uup6L771M91rspzDNaNIwfxHQIc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715436211; c=relaxed/simple; bh=mhTRt8JHohS8YFer2Eja+AGnHgG9LVArYakcCH9pRfg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Ej63Ios8Y0RECdmRaAKFL927JBjtPzcCkbXglamBQynzMZbt2Luh0NHyw2w9hlfiU2dufxuu4CTWvhQHq/ZD2yJOXHlFCWQirKJerASa3gH7Aap/IMvQwaNF/xh2ruLg4d2ttjJXbNuDRpPf11LIP5ft5JJVMvO/b3u2xYH1MSk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=DFtm7vDf; arc=none smtp.client-ip=95.215.58.187 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1715436207; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=HWeNl4C384y+wMABXUhvSGBiKKDCfnTUzIRZ136IUcI=; b=DFtm7vDf8lNIht/QmjfZvuC4N/u5fJgQDjAqudEH6C3mQxWai1Nn/iPTUFf1qNO6LXLHe+ VwMw0C8MytTgYLFVt4qR+d1P+5MDyY9PEPzWR88f54AsOxIDLnm3Uust1uoGQHTry1fDUp leK8W8MK1yENnGDO9v0LAzDtxjnd9YQ= From: Sui Jingfeng To: Maxime Ripard Cc: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Thomas Zimmermann , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Sui Jingfeng Subject: [PATCH] drm/bridge: panel: Remove a redundant check on existence of bridge->encoder Date: Sat, 11 May 2024 22:03:16 +0800 Message-ID: <20240511140316.318080-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-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT In panel_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 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 at the implementation layer, therefore remove the redundant checking codes "if (!bridge->encoder) { ... }". Signed-off-by: Sui Jingfeng --- drivers/gpu/drm/bridge/panel.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/gpu/drm/bridge/panel.c b/drivers/gpu/drm/bridge/panel.c index 7f41525f7a6e..762402dca6dd 100644 --- a/drivers/gpu/drm/bridge/panel.c +++ b/drivers/gpu/drm/bridge/panel.c @@ -65,11 +65,6 @@ static int panel_bridge_attach(struct drm_bridge *bridge, if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) return 0; - if (!bridge->encoder) { - DRM_ERROR("Missing encoder\n"); - return -ENODEV; - } - drm_connector_helper_add(connector, &panel_bridge_connector_helper_funcs); -- 2.43.0