Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp1053506lqo; Sat, 11 May 2024 05:43:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWbzXN6Ai5SnpLd2OeXySuRDU4Y1i3G+Y3HtUumBmFEaEmG7NYbDxbv9PMrYXwTfmUUm1hGFc52PE0Qj7stRmdbq+aDRezmxV7QOXA3uw== X-Google-Smtp-Source: AGHT+IE8MdoUid5ZeibPcYiW4HC5LFGb5Wyd9cbMPnrzMXJJq/Xz9wW1IVGvsek3CZPlyVUxfc3u X-Received: by 2002:a05:6a21:611:b0:1af:d153:b76a with SMTP id adf61e73a8af0-1afde0d53e3mr5306705637.18.1715431382798; Sat, 11 May 2024 05:43:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715431382; cv=pass; d=google.com; s=arc-20160816; b=n3MfSLBnJ77RIjzpfmCwWk76tpbjyPmrQxPnHDrSJmFCUl02n4B4OF5SdzWENRaF4+ G5RDe24qiHOL0MdV48dTxT9iTEwiX/ivUzt8trrKh1hlOlrP76zxqs5QYe6tqxvJvbPa en7tvZkOUfLuVyKDoNoZkwCEem4NbXx3Wa9UQXcvpJl4hgCCkjTAVbZVdaBSQNuXa8x5 b3z2qxU+V/IGeAXtzATfTYC0kGlCCPCRvXicLrhJLLRQbxbTapGKqVJHfqiGMTPHagVI 2o9wOCDsV939sWaCowL/Cj+gDo2RpD/b7lQz3O7zfucmqrbO4CIM9PPm9T6LAJQOjNnF pXpg== 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=5Mlk8jFKvoypD9IZYpI3BVSdxetHEe1rriO0cIJzkmo=; fh=wOxYnf5cB8EXtrDPB+7Ap+AE3ORvvjAbNrmA+4qPZLg=; b=Hlu0QtQJQP6b0cevKCE0pQ4kr22I/MAKXnT/iZ9cvenzXyHS6vXRQc+kfJ4QgV7jtm qExOBGn4JQFltxAGL+HqOFpljp9ESO2JXigtZfeAiZp9CxPmMHMyk9lPQ2CCrt+AUlbT +lbLWk5b7s/GcV7dQNVn4JcZruVrsQO2QmKSHYCr2w1/7Edqoc5fgG4IghQCkctoF1rf 9WvrK2FRUQ7vBNkGZRyTvgsTWJeN4+pFzm2Gc36ICZR065zK17Z3kGt0EE5KQleJNNyO piKv7qKo0ak0mp9MSVp04orUf8snphDZFqKWxojRC2RsfurkxmSXM9akaj8bW4j+H61B N5jQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="Rnl2UFX/"; 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-176537-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176537-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev 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-6341180e0e9si5580794a12.564.2024.05.11.05.43.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 May 2024 05:43:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-176537-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 header.i=@linux.dev header.s=key1 header.b="Rnl2UFX/"; 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-176537-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176537-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 6EBF5281F48 for ; Sat, 11 May 2024 12:43:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AA5374E1DA; Sat, 11 May 2024 12:42:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="Rnl2UFX/" Received: from out-178.mta1.migadu.com (out-178.mta1.migadu.com [95.215.58.178]) (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 01AAF7E9 for ; Sat, 11 May 2024 12:42:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715431377; cv=none; b=XlML8rKPLrwQkSYWHGF5dSyuIIQtalKnyLooffbPnl5F5+nz/Yw5yIahidSYFF2sjdpFZY0upSJpVKziMXG4dFyowke50gU6FWwwMWxy6AEKVS8qv1cHBG52oBOAtFENk0eZU9XUwTyPiLpsHhL/tY/Bi5w0Fo1HWJtv//zBpD8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715431377; c=relaxed/simple; bh=MeHi4bk5Ajd8/IQPQj4d8hEx3eNYc+Qz7JCRrKuCY1I=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=myBvviUu80c8ZSGTII46tsJQKWIkP+qsY8PXaKqXiSK7gBgAW94IK8xDRKP0XB9nXm5hZe/fVWE53eI13QHZqbMLOT+WiHmugEi56GP1qFlicboekAId+Kf0BRvuXL76cYBdBRLznjsJPrZBpkGM8qhFNAZhKYyYv4zxNXoXO1U= 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=Rnl2UFX/; arc=none smtp.client-ip=95.215.58.178 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=1715431374; 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=5Mlk8jFKvoypD9IZYpI3BVSdxetHEe1rriO0cIJzkmo=; b=Rnl2UFX/CCFkmjgSw8t9xem4X/DuUT4GTH4ZefCtr3W9ufq9lIMQAo9rMIqPcC7Z4lu/ke qkvjoTDCwgIO2jP4xHrEIajjK3jDOfLjDEWbOuTe7VyuJ0NeWV0MynxnFZFsbIL2g60lP9 Q6VrTpvROk4YSvqllU8Vox+Q/1Y7ifU= 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: Remove a small useless code snippet Date: Sat, 11 May 2024 20:42:38 +0800 Message-ID: <20240511124238.297192-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 Because the check on the non-existence (encoder == NULL) has already been done in the implementation of drm_bridge_attach() function, and drm_bridge_attach() is called earlier. The driver won't get to check point even if drm_bridge_attach() fails for some reasons, as it will clear the bridge->encoder to NULL and return a negective error code. Therefore, there is no need to check another again. Remove the redundant codes at the later. Signed-off-by: Sui Jingfeng --- drivers/gpu/drm/bridge/simple-bridge.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/gpu/drm/bridge/simple-bridge.c b/drivers/gpu/drm/bridge/simple-bridge.c index 28376d0ecd09..3caa918ac2e0 100644 --- a/drivers/gpu/drm/bridge/simple-bridge.c +++ b/drivers/gpu/drm/bridge/simple-bridge.c @@ -116,11 +116,6 @@ static int simple_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(&sbridge->connector, &simple_bridge_con_helper_funcs); ret = drm_connector_init_with_ddc(bridge->dev, &sbridge->connector, -- 2.43.0