Message ID | Y+YYZ4SbMQBcpTZP@ubun2204.myguest.virtualbox.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp873027wrn; Fri, 10 Feb 2023 02:28:26 -0800 (PST) X-Google-Smtp-Source: AK7set+9vlgBLzNsjJ/Y0pr7zcGVYllGIPG5l21Ad5JJFurVK7e5MVs3xBgstxdQpH5PRt/1tmdW X-Received: by 2002:a17:902:f253:b0:196:5cd3:d891 with SMTP id j19-20020a170902f25300b001965cd3d891mr11153068plc.27.1676024906479; Fri, 10 Feb 2023 02:28:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676024906; cv=none; d=google.com; s=arc-20160816; b=AYcpIZeGrm+sECwB8shHwh6Ov/DM0hWgPhHysvSDhrSTtSEUra/kaR+2QXFKl3+L/S WZvc12IgY6/ZtmMNpej2dWwZJnL9qFzgsHmN5it8Ac/Rn+lypbO03dQ/KmhN+pIizlIg bNhAv5OtZxyxNSRHHeUkbQu+lc/xTS9nuXp974xyfWnAcr3YeNCKghFXpD9kekFuNnwn payeD9/UVCFMlVyd4XNrfRJg1MdqQpdpLyUtfgiVlUtRqUX+qG4zf8Nwsqf+A2/xAUXo nyin69XWCU/IKLoREAZTdoelwAd2MBakV1WxMH5G109fe3fn0/X3BjzfbvBM1f9YmjDh PFmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=fzAbNGmMOUw2LgZDBkBorGNpW1owDAmdMiPkVJBl8DI=; b=pYulsSXtmgoWOyLhjdMsyKn93wGii4j4il5SVyOThlGEtRozHS1uiEXNsC01sOA8XZ UgQIfV4YPTl4xIzVQ3Hjuf9cYkpyUWFkTN3PZvxS1FmvKMlHoKSIbV07GachTr3aQg2f UpQEIEyqt06xPzMmvCzonri1XNuNn3765ZI3J/w2n/evD1Qw4SPCGUTlABwZJ0eqS1OB feKRXZQTlE2DZZvJS8RpmBKUsNkShMkDVYBXAq9jgKi5mNOh3M/ZzHuQTDsBw4AUc3OG EEXMwUdKmXklo8O6eBZfoOfDUjRWHGPrMxEJpJC8w5Isc/Gup9/UVUmETJOygfLJiFsy bUKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=JnXbx6Rg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w11-20020a170902c78b00b00194c2209db3si3944127pla.306.2023.02.10.02.28.14; Fri, 10 Feb 2023 02:28:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=JnXbx6Rg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231269AbjBJKMG (ORCPT <rfc822;ybw1215001957@gmail.com> + 99 others); Fri, 10 Feb 2023 05:12:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229537AbjBJKME (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 10 Feb 2023 05:12:04 -0500 Received: from msg-4.mailo.com (msg-4.mailo.com [213.182.54.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 880221E29D for <linux-kernel@vger.kernel.org>; Fri, 10 Feb 2023 02:12:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1676023916; bh=x+ol1GuNj8lUXdFUy7nxKOB8qI/lJjjjqxkzLP1nqOw=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:MIME-Version: Content-Type; b=JnXbx6RggW44GxhVaoNgfRgYHxNza8uwi30lCmECTQeL5hBiD78bdPbO8uGkkllb8 OjdBvGsgiIyVmEFnnbBkMq45PZXtEpzc5IYJTRmUWB0C497vNK217KAzFDawAbLPf7 daOtlp1doW7rLqvbyYgBkp5yY/7Sv1mSpooczEko= Received: by b-2.in.mailobj.net [192.168.90.12] with ESMTP via ip-206.mailobj.net [213.182.55.206] Fri, 10 Feb 2023 11:11:56 +0100 (CET) X-EA-Auth: Sbo/qh16eOqtAod7achHJ2BQWyUw0RzOgHfBeqtWPLNJkGnX2y+0U4r0fl9kq+vO9W22HHcxNd2Jf7pKXsZKrnu39qbRGlxE Date: Fri, 10 Feb 2023 15:41:51 +0530 From: Deepak R Varma <drv@mailo.com> To: Harry Wentland <harry.wentland@amd.com>, Leo Li <sunpeng.li@amd.com>, Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>, Alex Deucher <alexander.deucher@amd.com>, Christian =?iso-8859-1?q?K=F6nig?= <christian.koenig@amd.com>, "Pan, Xinhui" <Xinhui.Pan@amd.com>, David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Saurabh Singh Sengar <ssengar@microsoft.com>, Praveen Kumar <kumarpraveen@linux.microsoft.com>, Deepak R Varma <drv@mailo.com> Subject: [PATCH] drm/amd/display: Remove duplicate/repeating expression Message-ID: <Y+YYZ4SbMQBcpTZP@ubun2204.myguest.virtualbox.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757439492134788529?= X-GMAIL-MSGID: =?utf-8?q?1757439492134788529?= |
Series |
drm/amd/display: Remove duplicate/repeating expression
|
|
Commit Message
Deepak R Varma
Feb. 10, 2023, 10:11 a.m. UTC
Remove duplicate or repeating expressions in the if condition
evaluation. Issue identified using doubletest.cocci Coccinelle semantic
patch.
Signed-off-by: Deepak R Varma <drv@mailo.com>
---
.../gpu/drm/amd/display/dc/dml/dcn314/display_rq_dlg_calc_314.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On 2/10/23 05:11, Deepak R Varma wrote: > Remove duplicate or repeating expressions in the if condition > evaluation. Issue identified using doubletest.cocci Coccinelle semantic > patch. > > Signed-off-by: Deepak R Varma <drv@mailo.com> Reviewed-by: Harry Wentland <harry.wentland@amd.com> Harry > --- > .../gpu/drm/amd/display/dc/dml/dcn314/display_rq_dlg_calc_314.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_rq_dlg_calc_314.c b/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_rq_dlg_calc_314.c > index 61ee9ba063a7..6576b897a512 100644 > --- a/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_rq_dlg_calc_314.c > +++ b/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_rq_dlg_calc_314.c > @@ -51,7 +51,7 @@ static bool CalculateBytePerPixelAnd256BBlockSizes( > *BytePerPixelDETC = 0; > *BytePerPixelY = 4; > *BytePerPixelC = 0; > - } else if (SourcePixelFormat == dm_444_16 || SourcePixelFormat == dm_444_16) { > + } else if (SourcePixelFormat == dm_444_16) { > *BytePerPixelDETY = 2; > *BytePerPixelDETC = 0; > *BytePerPixelY = 2;
On Fri, Feb 10, 2023 at 10:22:00AM -0500, Harry Wentland wrote: > On 2/10/23 05:11, Deepak R Varma wrote: > > Remove duplicate or repeating expressions in the if condition > > evaluation. Issue identified using doubletest.cocci Coccinelle semantic > > patch. > > > > Signed-off-by: Deepak R Varma <drv@mailo.com> > > Reviewed-by: Harry Wentland <harry.wentland@amd.com> Thank you Harry. There is another similar patch I submitted for a different file. Could you please also review that and share your feedback? Thank you, ./drv > > Harry > > > --- > > .../gpu/drm/amd/display/dc/dml/dcn314/display_rq_dlg_calc_314.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_rq_dlg_calc_314.c b/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_rq_dlg_calc_314.c > > index 61ee9ba063a7..6576b897a512 100644 > > --- a/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_rq_dlg_calc_314.c > > +++ b/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_rq_dlg_calc_314.c > > @@ -51,7 +51,7 @@ static bool CalculateBytePerPixelAnd256BBlockSizes( > > *BytePerPixelDETC = 0; > > *BytePerPixelY = 4; > > *BytePerPixelC = 0; > > - } else if (SourcePixelFormat == dm_444_16 || SourcePixelFormat == dm_444_16) { > > + } else if (SourcePixelFormat == dm_444_16) { > > *BytePerPixelDETY = 2; > > *BytePerPixelDETC = 0; > > *BytePerPixelY = 2; >
Applied. Thanks! On Fri, Feb 10, 2023 at 10:22 AM Harry Wentland <harry.wentland@amd.com> wrote: > > On 2/10/23 05:11, Deepak R Varma wrote: > > Remove duplicate or repeating expressions in the if condition > > evaluation. Issue identified using doubletest.cocci Coccinelle semantic > > patch. > > > > Signed-off-by: Deepak R Varma <drv@mailo.com> > > Reviewed-by: Harry Wentland <harry.wentland@amd.com> > > Harry > > > --- > > .../gpu/drm/amd/display/dc/dml/dcn314/display_rq_dlg_calc_314.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_rq_dlg_calc_314.c b/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_rq_dlg_calc_314.c > > index 61ee9ba063a7..6576b897a512 100644 > > --- a/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_rq_dlg_calc_314.c > > +++ b/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_rq_dlg_calc_314.c > > @@ -51,7 +51,7 @@ static bool CalculateBytePerPixelAnd256BBlockSizes( > > *BytePerPixelDETC = 0; > > *BytePerPixelY = 4; > > *BytePerPixelC = 0; > > - } else if (SourcePixelFormat == dm_444_16 || SourcePixelFormat == dm_444_16) { > > + } else if (SourcePixelFormat == dm_444_16) { > > *BytePerPixelDETY = 2; > > *BytePerPixelDETC = 0; > > *BytePerPixelY = 2; >
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_rq_dlg_calc_314.c b/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_rq_dlg_calc_314.c index 61ee9ba063a7..6576b897a512 100644 --- a/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_rq_dlg_calc_314.c +++ b/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_rq_dlg_calc_314.c @@ -51,7 +51,7 @@ static bool CalculateBytePerPixelAnd256BBlockSizes( *BytePerPixelDETC = 0; *BytePerPixelY = 4; *BytePerPixelC = 0; - } else if (SourcePixelFormat == dm_444_16 || SourcePixelFormat == dm_444_16) { + } else if (SourcePixelFormat == dm_444_16) { *BytePerPixelDETY = 2; *BytePerPixelDETC = 0; *BytePerPixelY = 2;