Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp1106309lqo; Sat, 11 May 2024 07:38:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVNhEb/ljmA2DEswK6kzE+ca2hi+MzB6Aq8G9degS4cuo/JnYp9YVLcbDGSweTdQL46yO9GNA6j1AI2aeNHGNl/pFq/hAjvWzsyBioePA== X-Google-Smtp-Source: AGHT+IHxYXkNOTNejEbMcqATZrGriPGzTuwpgjK94k/duwa+hM25l3EKOT6DBAnVN3Eo/dCXnLoR X-Received: by 2002:a17:906:7084:b0:a59:c319:f1de with SMTP id a640c23a62f3a-a5a2d5356demr385771366b.15.1715438318194; Sat, 11 May 2024 07:38:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715438318; cv=pass; d=google.com; s=arc-20160816; b=GjfnjRwtHjXpIL7bsidydYbYGGE3YuwPPj0EA37aIAiyPztMAVem6RlfEsYmTFpJM9 k04jG7vKoDTn8OaB+jwvXicPVd6LwcPKca2KzkRje0LkFpnxuPz8Pbqo3cVIqU7tPYmu Zu1kKvacMRkzprZoGRxlNdLmM8XAz0bFvuQinnbU20jRi66f/yNhAuM+ShTeI9S5tJgJ Huf2yg6rKZhapMxnQ2m/VqzfV9ltNof7pIQGmEPCOLA3EoYm5kyzBZjXu3j5n3Xw8Pz8 ib8mLx8i9FXEz2bI6fNHkbyJZisifcu9HIlUNJdfqBhldQX8rG3EFss0WVSQ9NcRRxR1 FsCQ== 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=7oYbAK6V3PMtAQPp3g/jPrpGniPO9Da3WJamUNyoSGs=; fh=wOxYnf5cB8EXtrDPB+7Ap+AE3ORvvjAbNrmA+4qPZLg=; b=vcU3KsFeV/JfSHVMuqgK3QIdN/iNLOTerqLBpQDTxKdsl9QwGem94Z+yixzY6zdC2o wb26zERQa+LiGv7zh17E5AYvCoX3F0JCZ6k8BEwpGfwTcvI38NqWI71OgAKq4ijp8xYr fDKVIOdeq3mIKszjHJfUOS7okivum6VGTCDh00eFUXvFOr4hAtib6i87pmFjXXPhoH5A YvfzgNmT0IngFzLzxmtsKPKHTIVhKqR/SKwYLyGzxVQZMdcg3XL3pEp6mqG0ZHgKy8r3 QnbccUYEsK2pAXGBk09vwKr6hcQLR1GZjBqPRC7G0460ZjPH8xE9aTPP+DuZaOp+LRGK W2gg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=Oclv2g5M; 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-176580-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176580-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17ba6330si313312766b.623.2024.05.11.07.38.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 May 2024 07:38:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-176580-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=Oclv2g5M; 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-176580-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176580-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 am.mirrors.kernel.org (Postfix) with ESMTPS id B485E1F21928 for ; Sat, 11 May 2024 14:38:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6AD795579F; Sat, 11 May 2024 14:38:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="Oclv2g5M" Received: from out-184.mta1.migadu.com (out-184.mta1.migadu.com [95.215.58.184]) (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 A93C451034 for ; Sat, 11 May 2024 14:38:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.184 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715438310; cv=none; b=HM8S0fZuVSLVI0flcZnSukid0/+25sq/0Tu39aOIZi+Nu8CWzdq7ut8OcSeN43eedU3IGapfjLq9lmRz09XXfe7q5v6JHLnoatUyDeBvgTs+IOx3dZ9+SupETdXd7MzlScuAFQWAvmkGV0KsB8km0mC9chrtPppdDRYncGHat64= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715438310; c=relaxed/simple; bh=ARN1LqUaqN185QT2ahXkPm1gs9oNTPlneGEV9vazkcA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=TtxgXLZ1zCdjnALAWI6ajaP/UCVOtqqYkDVCdSTc1QdZAtcSAI0m5jwNjrxHD/SlqJXdGkQaq1TjmLB/lodtLJ3vsyJSraXwrisUZu2l3oqY5fgArPdRCi3Vgb5C+ji++u2eXSLNxZ1D6HV6okFH03T+h264HksTS37wcTQVU3A= 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=Oclv2g5M; arc=none smtp.client-ip=95.215.58.184 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=1715438306; 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=7oYbAK6V3PMtAQPp3g/jPrpGniPO9Da3WJamUNyoSGs=; b=Oclv2g5M1gH3fwibfFPG3GLpshvJyT1MiFS5oK9R/F4GPl1j1/YTizCaga0maO6i5NFvS5 y86vOIBu/ffajTAm6v6AkUUOKGgkyoSwCyjboNxcj4LNXkWYvQas6zBl5iGyS/DT3ilvnY /YEJWW3pKt7Yib3YrHH4fEOB12s0Xck= 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: megachips-stdpxxxx-ge-b850v3-fw: Remove a redundant check on existence of bridge->encoder Date: Sat, 11 May 2024 22:38:20 +0800 Message-ID: <20240511143820.324369-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 the ge_b850v3_lvds_create_connector 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 ge_b850v3_lvds_attach() function gets called. Remove the redundant checking codes "if (!bridge->encoder) { ... }". Signed-off-by: Sui Jingfeng --- drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c b/drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c index 4480523244e4..37f1acf5c0f8 100644 --- a/drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c +++ b/drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c @@ -165,11 +165,6 @@ static int ge_b850v3_lvds_create_connector(struct drm_bridge *bridge) struct drm_connector *connector = &ge_b850v3_lvds_ptr->connector; int ret; - if (!bridge->encoder) { - DRM_ERROR("Parent encoder object not found"); - return -ENODEV; - } - connector->polled = DRM_CONNECTOR_POLL_HPD; drm_connector_helper_add(connector, -- 2.43.0