mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: "Bernard Zhao" <bernard@vivo.com>,
	"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 König" <christian.koenig@amd.com>,
	"Pan, Xinhui" <Xinhui.Pan@amd.com>,
	"David Airlie" <airlied@linux.ie>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/amd/display: cleanup the code a bit
Date: Tue, 16 Nov 2021 10:19:41 +0100	[thread overview]
Message-ID: <88328288-ef1f-ef8b-987f-43dc8dc69ee7@gmail.com> (raw)
In-Reply-To: <20211116013438.26517-1-bernard@vivo.com>

Am 16.11.21 um 02:34 schrieb Bernard Zhao:
> In function dc_sink_destruct, kfree will check pointer, no need
> to check again.
> This change is to cleanup the code a bit.
>
> Signed-off-by: Bernard Zhao <bernard@vivo.com>

This one and the other patch are Acked-by: Christian König 
<christian.koenig@amd.com>

> ---
>   drivers/gpu/drm/amd/display/dc/core/dc_sink.c | 10 +---------
>   1 file changed, 1 insertion(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_sink.c b/drivers/gpu/drm/amd/display/dc/core/dc_sink.c
> index a249a0e5edd0..4b5e4d8e7735 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_sink.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_sink.c
> @@ -33,14 +33,6 @@
>    * Private functions
>    ******************************************************************************/
>   
> -static void dc_sink_destruct(struct dc_sink *sink)
> -{
> -	if (sink->dc_container_id) {
> -		kfree(sink->dc_container_id);
> -		sink->dc_container_id = NULL;
> -	}
> -}
> -
>   static bool dc_sink_construct(struct dc_sink *sink, const struct dc_sink_init_data *init_params)
>   {
>   
> @@ -75,7 +67,7 @@ void dc_sink_retain(struct dc_sink *sink)
>   static void dc_sink_free(struct kref *kref)
>   {
>   	struct dc_sink *sink = container_of(kref, struct dc_sink, refcount);
> -	dc_sink_destruct(sink);
> +	kfree(sink->dc_container_id);
>   	kfree(sink);
>   }
>   


  reply	other threads:[~2021-11-16  9:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-16  1:34 Bernard Zhao
2021-11-16  9:19 ` Christian König [this message]
2021-11-17 21:37   ` Alex Deucher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=88328288-ef1f-ef8b-987f-43dc8dc69ee7@gmail.com \
    --to=ckoenig.leichtzumerken@gmail.com \
    --cc=Rodrigo.Siqueira@amd.com \
    --cc=Xinhui.Pan@amd.com \
    --cc=airlied@linux.ie \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=bernard@vivo.com \
    --cc=christian.koenig@amd.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=harry.wentland@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sunpeng.li@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®