From nobody Thu Dec 18 23:43:33 2025 Received: from out30-130.freemail.mail.aliyun.com (out30-130.freemail.mail.aliyun.com [115.124.30.130]) (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 C46431F94C for ; Thu, 29 Aug 2024 02:42:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724899347; cv=none; b=cQKih7hxX7uSuDak5tZlLcvzRXTQAlzT8V7AEueLLoFaivh012NxVA3tj1JA1VitZbRNhcs/hkbk2CWcTFugUp3s8nxy/rrgcQuN8iAzXBSJ2cCsMlvGaeiCofuP7EnNIQYGE+kmjQ/IvNApQ4DrhH3UJhaiGfdQkLFQuO77B0c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724899347; c=relaxed/simple; bh=wNwCA+QfjEzwl1Z3eviD6tmcBkbFGyEvDqAQKeeWnhM=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=pxdi8pZaLH+vrDcBsEl8djBpBH4YhIHXpZsUpbjnL5dfFiw3dn+cFnNyMDB5j8EL6+Fo0BpFPtEjGXfno2TsNXn5makU1/CWXoL+vj3FI0qqOmqH9peeMkRGTaIarLg1oV3qVDCnh4Q5VF1DNxBdGkkCsn7TXSlqnJrWNkXVxe4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=FTQlL2lA; arc=none smtp.client-ip=115.124.30.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="FTQlL2lA" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1724899336; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=wMQwFo6g6tszV+9ZlBCy+iOoyHhp9U9JGEfN9QAnmGc=; b=FTQlL2lA8oD2EEQOWzmx5ouFI8NRivbuPMFDk87VinvRlbxbGNN5QzMZFerwg42ZDldkTaamVlqKo+wrea6MC6zMrS8n+0TfWGV+nccrsvO9Dpz83mXsmj35zHW3pthUk59wR4ps4X1/NAci9G7zO77rGlmPY33BBf3eSboJra8= Received: from localhost(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0WDrLx0U_1724899015) by smtp.aliyun-inc.com; Thu, 29 Aug 2024 10:37:05 +0800 From: Jiapeng Chong To: harry.wentland@amd.com Cc: sunpeng.li@amd.com, Rodrigo.Siqueira@amd.com, alexander.deucher@amd.com, christian.koenig@amd.com, Xinhui.Pan@amd.com, airlied@gmail.com, daniel@ffwll.ch, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Jiapeng Chong , Abaci Robot Subject: [PATCH -next] drm/amd/display: Remove the redundant else if branch in the function amdgpu_dm_init() Date: Thu, 29 Aug 2024 10:36:54 +0800 Message-Id: <20240829023654.20884-1-jiapeng.chong@linux.alibaba.com> X-Mailer: git-send-email 2.32.0.3.g01195cf9f Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The assignment of the else and if else branches is the same, so we remove it and add comments here to make the code easier to understand. ./drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c:1871:6-8: WARNING: poss= ible condition with no effect (if =3D=3D else). Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=3D9829 Signed-off-by: Jiapeng Chong --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gp= u/drm/amd/display/amdgpu_dm/amdgpu_dm.c index e14c0c060e1b..71624917c475 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -1868,9 +1868,7 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) init_data.flags.disable_ips =3D DMUB_IPS_DISABLE_DYNAMIC; else if (amdgpu_dc_debug_mask & DC_DISABLE_IPS2_DYNAMIC) init_data.flags.disable_ips =3D DMUB_IPS_RCG_IN_ACTIVE_IPS2_IN_OFF; - else if (amdgpu_dc_debug_mask & DC_FORCE_IPS_ENABLE) - init_data.flags.disable_ips =3D DMUB_IPS_ENABLE; - else + else /* The branch cover "else if (amdgpu_dc_debug_mask & DC_FORCE_IPS_EN= ABLE)" */ init_data.flags.disable_ips =3D DMUB_IPS_ENABLE; =20 init_data.flags.disable_ips_in_vpb =3D 0; --=20 2.32.0.3.g01195cf9f