Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp891825rdb; Fri, 1 Dec 2023 01:01:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IGjEv3tlobHRZWLnSPF+I9LLG0/HSfOyY+e/3X8pN6hjJg2+d44x6uU0wdQ048Xr/KqWqwf X-Received: by 2002:a17:90b:350f:b0:285:ad94:a7fd with SMTP id ls15-20020a17090b350f00b00285ad94a7fdmr18444255pjb.44.1701421290561; Fri, 01 Dec 2023 01:01:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701421290; cv=none; d=google.com; s=arc-20160816; b=AXChdXE8lm34m2K8Ee5MnzBJXccsQzGeUygyhkdYfC99vJkFDi56mCgHB8QGRVPfQ6 q5nImyM0FQyVPDB9s7m1KqWSxSj2HmF6WmAQZZdA6tOqqJT7lpzlaI6307Qyquhzijyj NHASrpJ3qTBdrkpStZlzU48w4SFMi5r+9Wuf7RPMoP8Ve9oM1rATqz57qL0MoCrl/CTz j6NEqXSZ3byDD840GClDH/h9GtfuyYcXXRBDkswPR9+wVgEkIz7ltvx1Jb94b+rDkg2l nuqBxJ3oeDwgS0Hu9Vl4qkR4pm4mMj4GsUQnhjjHMyDWqs0cGrVaK1p4ViPnmfA/tC0i U14w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=HdJF3TCeZta/jD2YMKTYV67uYtG/6FyGtH5v9v0ElTY=; fh=E1fo2IoakCsND4Z1T+2sQQRs8VNzX6aoehAGQmx3eks=; b=TxJPliLi0o+is0GaZK1vWKF7v/v5/8Vl3Vi8tTlARqjyYyiuGsgZyzWa+s7sXdJ0/Q N5XYCcR1xqDdY+nYgPQ/QIqLpw3REx8rqvoY572kFQCbn71ZBLQNJpHvshaSxfQYUAFE QrunLX3cLUwARPHp2ATVJ1Do02kp9nX+CXVohA6AxSF/EOqXYlXEud6jT/F77HKwHTGo uQ2bOk2gfN0IrpDG0POTaGmyLef4ZlbEJfBTfVd2+1BNlBErfMZwe90S5SJesVqPau4Q uckTh30ORtM7kJNw1Xv1omCyaVNmq2BJTUkBKpDdB6/K5Brnr2R5fFkczZGyve5e3jH1 uPgA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id jf19-20020a170903269300b001d0626761c5si3237plb.217.2023.12.01.01.01.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 01:01:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id D3C02809B778; Fri, 1 Dec 2023 01:00:58 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377946AbjLAJAn (ORCPT + 99 others); Fri, 1 Dec 2023 04:00:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377952AbjLAJAj (ORCPT ); Fri, 1 Dec 2023 04:00:39 -0500 Received: from out30-124.freemail.mail.aliyun.com (out30-124.freemail.mail.aliyun.com [115.124.30.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FFF9171A for ; Fri, 1 Dec 2023 01:00:44 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R191e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046056;MF=jiapeng.chong@linux.alibaba.com;NM=1;PH=DS;RN=13;SR=0;TI=SMTPD_---0VxZuzXd_1701421234; Received: from localhost(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0VxZuzXd_1701421234) by smtp.aliyun-inc.com; Fri, 01 Dec 2023 17:00:42 +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] drm/amd/display: Simplify the calculation of variables Date: Fri, 1 Dec 2023 17:00:32 +0800 Message-Id: <20231201090032.131030-1-jiapeng.chong@linux.alibaba.com> X-Mailer: git-send-email 2.20.1.7.g153144c MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Fri, 01 Dec 2023 01:00:59 -0800 (PST) ./drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c:964:49-51: WARNING !A || A && B is equivalent to !A || B. Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7671 Signed-off-by: Jiapeng Chong --- drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c b/drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c index fa8fe5bf7e57..519db4931b8d 100644 --- a/drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c +++ b/drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c @@ -961,7 +961,7 @@ static bool get_plane_id(struct dml2_context *dml2, const struct dc_state *conte if (context->streams[i]->stream_id == stream_id) { for (j = 0; j < context->stream_status[i].plane_count; j++) { if (context->stream_status[i].plane_states[j] == plane && - (!is_plane_duplicate || (is_plane_duplicate && (j == plane_index)))) { + (!is_plane_duplicate || (j == plane_index))) { *plane_id = (i << 16) | j; return true; } -- 2.20.1.7.g153144c