Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3616424pxk; Mon, 21 Sep 2020 20:10:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwz7thKnfyR7QstyIAN3KBQtD+j10LhcAWIws1Gezl4RnXhzXIztiEHna0mMyd5L0/kX8Qn X-Received: by 2002:a17:906:cd0d:: with SMTP id oz13mr2655164ejb.212.1600744221114; Mon, 21 Sep 2020 20:10:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600744221; cv=none; d=google.com; s=arc-20160816; b=hV7g+4z2zOoesq8blsSfX31qXtTu12lbdmxqrKAbw7uMqPT/ERCvyNzvW58zzAQDnE v2PZh+jrP9u88HiVOVjRw44YfURCHuooHNbr4PtyQTJUhC/gTn8IXCmpM7I1W2y+/D07 jd7zl2lJAH/pfEOp835ba/08VZcdRMsH5MAumx6is539LpjlAhqnxa7HpgVoQsKlZjfH k0rAea8Qh7Mi0ia28qA+t1nzJRH8u6mDI0tSB02j0/shg+qRzI2U1g+qrbgBPOBqJ/iL 0zB7OY95OeNB4V04glBR3fjdBnwA1wZRhavhWOApb2gtwhaKoixSWswYgrz3vYIfBYy6 WEEw== 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=ZjutF0tJtYhDE5v3bY1xjHafsuatZrwelXYDA3+F67k=; b=s+8vkD/WL3BowA+s3Dbl/8GM/aLrWvCmGKklx1UWReyUe1XDkZvgVXOyo/GceGxmQH FUUF1X1Kwm/pBugRAJPA+b/pWUxXzE+BPtgqtLNeoB7yEfKBcGSwoBfI9ONbqcgLWADM lGj6Ri2mayPdrYr90PSLxMS/AHK0i6tL5w1rk5OeM1bkvi/uyn0YGIDJabYGrDPdWF+a 7cdHsvGh0f8s/NgSpdd3iDVVwcmJKAINNcdBdb29bwD7qKBMNVOi53lqxIOFLCE/5VpM b0CtSziprHUqRltkAOzhh6W3SG59vw0INZgSM0XBlkTNs1ec8lpgqjcuzalkjvd4JvGc 9FLA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v1si7094208ejw.413.2020.09.21.20.09.57; Mon, 21 Sep 2020 20:10:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729498AbgIVCLR (ORCPT + 99 others); Mon, 21 Sep 2020 22:11:17 -0400 Received: from mail-m17613.qiye.163.com ([59.111.176.13]:41825 "EHLO mail-m17613.qiye.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728776AbgIVCLR (ORCPT ); Mon, 21 Sep 2020 22:11:17 -0400 Received: from ubuntu.localdomain (unknown [157.0.31.124]) by mail-m17613.qiye.163.com (Hmail) with ESMTPA id A31534827CA; Tue, 22 Sep 2020 10:11:13 +0800 (CST) From: Bernard Zhao To: Harry Wentland , Leo Li , Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , David Airlie , Daniel Vetter , Rodrigo Siqueira , Jun Lei , Aric Cyr , Wenjing Liu , Brandon Syu , Michael Strauss , abdoulaye berthe , Martin Leung , Bernard Zhao , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: opensource.kernel@vivo.com Subject: [PATCH v2] drm/amd/display: optimize code runtime a bit Date: Mon, 21 Sep 2020 19:11:03 -0700 Message-Id: <20200922021106.24733-1-bernard@vivo.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgYFAkeWUFZS1VLWVdZKFlBSE83V1ktWUFJV1kPCR oVCBIfWUFZSh5ISRhJSB5CQ0kaVkpNS0tMT0tNTE9LTEhVEwETFhoSFyQUDg9ZV1kWGg8SFR0UWU FZT0tIVUpKS0hKTFVKS0tZBg++ X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6Pkk6EQw*Qj8hPA8PMEkONSJJ GQNPCxdVSlVKTUtLTE9LTUxPTk1PVTMWGhIXVRkeCRUaCR87DRINFFUYFBZFWVdZEgtZQVlKTkxV S1VISlVKSU9ZV1kIAVlBSElNQzcG X-HM-Tid: 0a74b3944a0993bakuwsa31534827ca Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In the function dal_ddc_service_query_ddc_data, get rid of dal_ddc_i2c_payloads_destroy, call dal_vector_destruct() directly. This change is to make the code run a bit fast. Signed-off-by: Bernard Zhao Changes since V1: *get rid of dal_ddc_i2c_payloads_destroy, call dal_vector_destruct() directly. Link for V1: *https://lore.kernel.org/patchwork/patch/1309014/ --- drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c index b984eecca58b..dec12de37642 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c @@ -148,14 +148,6 @@ static uint32_t dal_ddc_i2c_payloads_get_count(struct i2c_payloads *p) return p->payloads.count; } -static void dal_ddc_i2c_payloads_destroy(struct i2c_payloads *p) -{ - if (!p) - return; - - dal_vector_destruct(&p->payloads); -} - #define DDC_MIN(a, b) (((a) < (b)) ? (a) : (b)) void dal_ddc_i2c_payloads_add( @@ -582,7 +574,7 @@ bool dal_ddc_service_query_ddc_data( ddc->link, &command); - dal_ddc_i2c_payloads_destroy(&payloads); + dal_vector_destruct(&payloads.payloads); } return success; -- 2.28.0