From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.3 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B39C5C4363C for ; Mon, 21 Sep 2020 19:33:34 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 654BC20757 for ; Mon, 21 Sep 2020 19:33:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dTQiKQxb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 654BC20757 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=amd-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DF30989C89; Mon, 21 Sep 2020 19:33:33 +0000 (UTC) Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0F79289C89; Mon, 21 Sep 2020 19:33:33 +0000 (UTC) Received: by mail-wm1-x344.google.com with SMTP id b79so600053wmb.4; Mon, 21 Sep 2020 12:33:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tyqvRKFdtD8PMSb4v0LigIpVlIKZ32P+rPNhgG6iABo=; b=dTQiKQxbEPtUs+n52KETE43PkUq3kWFrLO2K1V7yfsGbLkbhi33Nye5NJcd55y9s1A PLJXb0CAjqa96NUyoZWQsPEE10VwZp5yypF+Xf6vj9/UpaHGw1sl9gwqVIirXEkML9S6 lZcCbV/WEIlkz89V3iJoIMIUfAfUagbDJ5BqRkpk5/nbLEVvvHczBJ+h+lful/czbpGo dHLKeKsD0Mqp3Yy8ZqDR7l3a/fEC72RgaA4Qv0ugdP2g1L97jDJ1cjk1nc6s0oi5tJIo hVrlfA4JLKhhBSgn+4uQWkdsXUDBndi+CJTtwQN3ING5Wl9XdZeT1N8Z7WpbyZMmatCu d+dA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tyqvRKFdtD8PMSb4v0LigIpVlIKZ32P+rPNhgG6iABo=; b=K3QRa3usxreo9G6oISuFxLRjoj5sOawEBG8Jg/pVcI62UEbcNVbT7Crr6qg/ILiVmG 3vHR4oKLcP9cKfPsENCtxLxDAzlq5hCC3anjaewVMmS85CeXyuxMLUy4klZ1RpbyI1Mu a/xmP9CfMOBgv40cKmWQ6RrLEmB8ksLx8shBIhdX7kFhKeYV5s4qHFeT94F6eH4FoWJC 7hcfGgA/1aEvRL9TR5F+IJqiarrnmfiDVJAUA0R+6EAYcAU4FcJC8pF9wqy92AIBlbTX 0KIBEk30lt1oU/uX8pvRfTmFg67C3vWkc2lqzxp38q873lNy8zsP/BPjDl6atYamDlLL kqEw== X-Gm-Message-State: AOAM5312sQUISNKjOGajNzsFvbqkYAa/3bZFnXUFLFZnpZd1T12NfY+O 7ZMx2nMrQAwMikvZfKaIGLhkyzPcgwx+b8+aqnI= X-Google-Smtp-Source: ABdhPJz9ExPKuXj4QoQ/WsmFt1o/wLN8n6bfP18yT+wpV/WCvYVUcTDZXQdaVyPM7AYXRszBry3ZzoSD0AdJ9D+X3Ao= X-Received: by 2002:a1c:a953:: with SMTP id s80mr885650wme.70.1600716811772; Mon, 21 Sep 2020 12:33:31 -0700 (PDT) MIME-Version: 1.0 References: <20200921114244.20506-1-bernard@vivo.com> In-Reply-To: <20200921114244.20506-1-bernard@vivo.com> From: Alex Deucher Date: Mon, 21 Sep 2020 15:33:20 -0400 Message-ID: Subject: Re: [PATCH] drm/amd/display: optimize code runtime a bit To: Bernard Zhao X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: opensource.kernel@vivo.com, Aric Cyr , Leo Li , Wenjing Liu , Martin Leung , Rodrigo Siqueira , LKML , amd-gfx list , David Airlie , Brandon Syu , Michael Strauss , Maling list - DRI developers , Daniel Vetter , abdoulaye berthe , Alex Deucher , Jun Lei , Harry Wentland , =?UTF-8?Q?Christian_K=C3=B6nig?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" On Mon, Sep 21, 2020 at 9:14 AM Bernard Zhao wrote: > > Static function dal_ddc_i2c_payloads_destroy is only called > in dal_ddc_service_query_ddc_data, the parameter is &payloads > , there is no point NULL risk, so no need to check. > This change is to make the code run a bit fast. > How about just getting rid of dal_ddc_i2c_payloads_destroy() and just call dal_vector_destruct() directly. Alex > Signed-off-by: Bernard Zhao > --- > drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c | 3 --- > 1 file changed, 3 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..6dcc666738fc 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 > @@ -150,9 +150,6 @@ static uint32_t dal_ddc_i2c_payloads_get_count(struct i2c_payloads *p) > > static void dal_ddc_i2c_payloads_destroy(struct i2c_payloads *p) > { > - if (!p) > - return; > - > dal_vector_destruct(&p->payloads); > } > > -- > 2.28.0 > > _______________________________________________ > amd-gfx mailing list > amd-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/amd-gfx _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx