Message ID | 20230517183350.314082-1-hamza.mahfooz@amd.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1344504vqo; Wed, 17 May 2023 11:39:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ49HdZqqTrHeVZXBZxBK/et0G/OePuf6oBPy2pf8LAis2UVPfVLEveggkbCm9qspEUFBXVb X-Received: by 2002:a05:6a21:3299:b0:100:6863:8be7 with SMTP id yt25-20020a056a21329900b0010068638be7mr41858328pzb.62.1684348744211; Wed, 17 May 2023 11:39:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1684348744; cv=pass; d=google.com; s=arc-20160816; b=CF33/IM/iKvk7m28zUgN+J5gpbLl4v6TjfhMxjEH1DLGXC2FkvCLyIwiJB3yITXWxj EHmDwnq3YDeJTNttZ8rlIGrdR73a1+Kvj77yDaT3WFhUbtcZsnPdr+b8tsUijmFy0Xrl +q0oXAXNkbgpPgpxpirSh+peSJYmSXdMkxxbQ9VMWBatV1dpcu6aFTgb6eaP9XPEg7pD YdsQrFPdadDqOZTjPdYW7P2JqCYadM3Mzztebr5nnJ5c/hSYaU03JnCT635BHUArALYO wuuvxjKsDdR+RcfKfw5tykitwZNBxKCqWv24ttal3zSOI7JiNL4Fxz2hPkvMv0uEnAdK Gs+w== ARC-Message-Signature: i=2; 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:dkim-signature; bh=Jhbo/StYlLnJNWpVlS+CXRHr66jym3+B2/ZPhrPK+0o=; b=UeXKtor+q5CU2UuvVxwlSMsznWgaHx41ErZa61LpseoCAV80rEBWzd5ePea4vd51la G4ZSZcxhHIsgefEZlSB/dZcKARBD7ESYWBroYi2+ipqyl9laplwRZGQcMlmhTYe13VHa Blubx4jaIDXwi2HXqjrQoJeMqMVrhhKUaxzRGHowLewXdQt60LNLISQqb8EJ1Izs9w1g LYDh9HrvAO5LHIE4VCJTrrEbv7K617992/92k0wd6j5VgauEYwbmfeU5GzhTf1z/qiRy qnc6vnCeD92erzXtqIcymA4aTq6POztp0/j8wzxUWtIh4QutcQTqHvCbdT5rRt1HY+4o A1XA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=Qugm8fAm; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h18-20020aa796d2000000b00648628d3104si18432361pfq.390.2023.05.17.11.38.50; Wed, 17 May 2023 11:39:04 -0700 (PDT) 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=pass header.i=@amd.com header.s=selector1 header.b=Qugm8fAm; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229638AbjEQSei (ORCPT <rfc822;abdi.embedded@gmail.com> + 99 others); Wed, 17 May 2023 14:34:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229483AbjEQSeg (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 17 May 2023 14:34:36 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2046.outbound.protection.outlook.com [40.107.243.46]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 192DE59F6 for <linux-kernel@vger.kernel.org>; Wed, 17 May 2023 11:34:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JYPbCejWiP/4rDAhzW6qmDSb3X+z50LITwusbPfDe2GVemNq76oU/respW4ykkPatAvUJlSQ/7ZHAV6SpugztGRYKHBVUjK8FtIQSGVrMYgLja+yJ6r0J91t8EyreY6ZdrKdfz1W9aIRnD1bdHbO9QPs8bYkw7cjkIe5awi18ySZDs2TkPjydmD/S0dcQsOWxr58Bln+eqSBydlaSuFDyI58GOS8dmpaSc56hygh13RN3zi93j7eeD6xkpaOgjkIBiOd67Ag9vb5EtElOWndpAr0tpVhdihiQ4/xrbrnBDXKr/tCz6YTK47mSIYCwfkFYoPoMpwb705tXw/TXLRYew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Jhbo/StYlLnJNWpVlS+CXRHr66jym3+B2/ZPhrPK+0o=; b=eyiyfci0DD7hpGhXDG4QmUrFsmdP9QQV4H2l79dKpC3+/8EjXOxHoQDiQnUvH0PXvzTG6AvjsZICeX2ydJPANx9V0Dy2nrj8hvioP71f01UDK1J+X2c8qGOtw8hYA1KHpGJn6WqHeoSiwyzSA5nTmlZGcmDBQkQZOX2STfrXavvT7F8YYzGmlluvbCw0UYRTxFr5Gv6/XwcYz/JnIRfRrPejX+G2vXdhJR7ZvZZ0vBR7bel2apDxdq5TYnIxhR1N3lkBSR/1sDLdkmLL2DH0aazCDopWxQzdxfAkdUW2vmh6sF50PoGTm45VeqK6PZSPij0stgQT9aTLqihUfD9BGQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Jhbo/StYlLnJNWpVlS+CXRHr66jym3+B2/ZPhrPK+0o=; b=Qugm8fAmGdKlQW00rU/XDSnmep9weyLSUKk+lxQtP0cFxbyRf6A5SwevZXYwuz0ACuHMDqZYik8Zm5bk/Umss2A2Ofn6my2E+xQhmR+8xvkSy6RMAWZs5VAVHRPx0sIhZcyT/7+q2QohrM5rq1t22kcxeyUlM3mbhmQ1gmaN1zA= Received: from DM6PR02CA0063.namprd02.prod.outlook.com (2603:10b6:5:177::40) by BN9PR12MB5164.namprd12.prod.outlook.com (2603:10b6:408:11d::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.33; Wed, 17 May 2023 18:34:31 +0000 Received: from DM6NAM11FT032.eop-nam11.prod.protection.outlook.com (2603:10b6:5:177:cafe::fc) by DM6PR02CA0063.outlook.office365.com (2603:10b6:5:177::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.33 via Frontend Transport; Wed, 17 May 2023 18:34:31 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT032.mail.protection.outlook.com (10.13.173.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6411.18 via Frontend Transport; Wed, 17 May 2023 18:34:30 +0000 Received: from hamza-pc.localhost (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Wed, 17 May 2023 13:34:28 -0500 From: Hamza Mahfooz <hamza.mahfooz@amd.com> To: <amd-gfx@lists.freedesktop.org> CC: Hamza Mahfooz <hamza.mahfooz@amd.com>, Christophe JAILLET <christophe.jaillet@wanadoo.fr>, Harry Wentland <harry.wentland@amd.com>, "Leo Li" <sunpeng.li@amd.com>, Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>, "Alex Deucher" <alexander.deucher@amd.com>, =?utf-8?q?Christian_K=C3=B6nig?= <christian.koenig@amd.com>, "Pan, Xinhui" <Xinhui.Pan@amd.com>, David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>, Qingqing Zhuo <qingqing.zhuo@amd.com>, Aurabindo Pillai <aurabindo.pillai@amd.com>, "Hans de Goede" <hdegoede@redhat.com>, Hersen Wu <hersenxs.wu@amd.com>, Stylon Wang <stylon.wang@amd.com>, Jun Lei <Jun.Lei@amd.com>, Wenjing Liu <wenjing.liu@amd.com>, Leon Huang <Leon.Huang1@amd.com>, Mike Hsieh <Mike.Hsieh@amd.com>, Cruise Hung <Cruise.Hung@amd.com>, Nasir Osman <nasir.osman@amd.com>, pengfuyuan <pengfuyuan@kylinos.cn>, <dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org> Subject: [PATCH 1/3] drm/amd/display: drop redundant memset() in get_available_dsc_slices() Date: Wed, 17 May 2023 14:33:45 -0400 Message-ID: <20230517183350.314082-1-hamza.mahfooz@amd.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT032:EE_|BN9PR12MB5164:EE_ X-MS-Office365-Filtering-Correlation-Id: 7834d83d-9ac2-4fca-9dcb-08db57055aa8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: esHtKSzpycsP+oYRNdKv4qphocZsEzn5lMwSJi0mTyxQNNqEuG4UUll/WgqN0cgx5IROjSxbDFUQMbP1xqZgynfzo6st7YfsoVMo+DNinfL6oeFA7vOMo+U2eGc7qReRY8Co0/ANXI2tSD52hR/fthGIz5aaftnfGNUKgk0p3ZZysrHIw0DwNf5f24HgdUGJEjYeuFXWcUEL1AHqwJ1/r1xPxpcrZjIHipidXINrGqF3ymVcLF3AiWZm609vMsDRIEVyuWIZWcL9xeo+v31ah+LnTfhx7PiER7O5xznf+E/z7iDNIIV8fx9684YRgQJ8HfzTDQYncgSuXIdt/jjWu9hlE+uaWaIqnMuTBuvn9pG6wROlkrnpTdwJqmt4NF18+9/GVv9Q2Qz2lElkWHEUMSewacziJin954YINZaxA9ZM4ua/n+xhkyON/D7ihjN75FoGpmfyaHx+zAT0d+cYSeU1NmQMeoR5yYuwDjK69eDYMHNLs5zJdp9GYuzG61J45vAjaEVq42kUKUmg+fg4T/gqVEEp3w1GipLhtqfnSFe66ZEKVyjP7+iS+VKNhYKJON3VLSnbIE737lRPUUBOJyjPs9puSDH4xPG7z57XzMnuNXIZ1CMdHFnNwEVIay0TwFIrTg1U72Vm24osgSHjOPFrjHURUOs6eoc9xb77Xh2rAkJxEslu4uo2XnPld5frKp93EXAQlPSgmJ9lqEddHWjv/QCYxolwk+2tCtf4ZYNgZf8Cr9GvEgpJyC1gPLJ6OB6UA3R69VW9b/Kg58o1VBqBumEjJk1coJru3FpLgOtmJW35hRo+LZe+a9nsKMH6 X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(136003)(396003)(346002)(376002)(39860400002)(451199021)(46966006)(40470700004)(36840700001)(40460700003)(70586007)(70206006)(4326008)(6916009)(478600001)(316002)(54906003)(36756003)(86362001)(83380400001)(47076005)(2616005)(16526019)(186003)(1076003)(26005)(40480700001)(36860700001)(426003)(336012)(44832011)(5660300002)(8936002)(8676002)(2906002)(6666004)(82310400005)(82740400003)(81166007)(356005)(41300700001)(16060500005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 May 2023 18:34:30.9885 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7834d83d-9ac2-4fca-9dcb-08db57055aa8 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT032.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5164 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no 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?1766167669067869735?= X-GMAIL-MSGID: =?utf-8?q?1766167669067869735?= |
Series |
[1/3] drm/amd/display: drop redundant memset() in get_available_dsc_slices()
|
|
Commit Message
Hamza Mahfooz
May 17, 2023, 6:33 p.m. UTC
get_available_dsc_slices() returns the number of indices set, and all of
the users of get_available_dsc_slices() don't cross the returned bound
when iterating over available_slices[]. So, the memset() in
get_available_dsc_slices() is redundant and can be dropped.
Fixes: 97bda0322b8a ("drm/amd/display: Add DSC support for Navi (v2)")
Reported-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
---
drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c | 2 --
1 file changed, 2 deletions(-)
Comments
On 5/17/23 12:33, Hamza Mahfooz wrote: > get_available_dsc_slices() returns the number of indices set, and all of > the users of get_available_dsc_slices() don't cross the returned bound > when iterating over available_slices[]. So, the memset() in > get_available_dsc_slices() is redundant and can be dropped. > > Fixes: 97bda0322b8a ("drm/amd/display: Add DSC support for Navi (v2)") > Reported-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> > Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com> > --- > drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c b/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c > index b9a05bb025db..58dd62cce4bb 100644 > --- a/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c > +++ b/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c > @@ -645,8 +645,6 @@ static int get_available_dsc_slices(union dsc_enc_slice_caps slice_caps, int *av > { > int idx = 0; > > - memset(available_slices, -1, MIN_AVAILABLE_SLICES_SIZE); > - > if (slice_caps.bits.NUM_SLICES_1) > available_slices[idx++] = 1; > Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Le 17/05/2023 à 20:33, Hamza Mahfooz a écrit : > get_available_dsc_slices() returns the number of indices set, and all of > the users of get_available_dsc_slices() don't cross the returned bound > when iterating over available_slices[]. So, the memset() in > get_available_dsc_slices() is redundant and can be dropped. > > Fixes: 97bda0322b8a ("drm/amd/display: Add DSC support for Navi (v2)") > Reported-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> > Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com> > --- > drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c b/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c > index b9a05bb025db..58dd62cce4bb 100644 > --- a/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c > +++ b/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c > @@ -645,8 +645,6 @@ static int get_available_dsc_slices(union dsc_enc_slice_caps slice_caps, int *av > { > int idx = 0; > > - memset(available_slices, -1, MIN_AVAILABLE_SLICES_SIZE); > - > if (slice_caps.bits.NUM_SLICES_1) > available_slices[idx++] = 1; > Thanks for it, it went off my radar. FWIW: Reviewed-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
diff --git a/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c b/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c index b9a05bb025db..58dd62cce4bb 100644 --- a/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c +++ b/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c @@ -645,8 +645,6 @@ static int get_available_dsc_slices(union dsc_enc_slice_caps slice_caps, int *av { int idx = 0; - memset(available_slices, -1, MIN_AVAILABLE_SLICES_SIZE); - if (slice_caps.bits.NUM_SLICES_1) available_slices[idx++] = 1;