mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Wambui Karuga <wambui.karugax@gmail.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	ck.hu@mediatek.com, p.zabel@pengutronix.de, airlied@linux.ie,
	daniel@ffwll.ch
Subject: Re: [Outreachy][PATCH] drm/mediatek: remove cast to pointers passed to kfree
Date: Thu, 24 Oct 2019 14:12:35 +0200	[thread overview]
Message-ID: <20191024121235.GC11828@phenom.ffwll.local> (raw)
In-Reply-To: <20191023111107.9972-1-wambui.karugax@gmail.com>

On Wed, Oct 23, 2019 at 02:11:07PM +0300, Wambui Karuga wrote:
> Remove unnecessary casts to pointer types passed to kfree.
> Issue detected by coccinelle:
> @@
> type t1;
> expression *e;
> @@
> 
> -kfree((t1 *)e);
> +kfree(e);
> 
> Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>

Applied to drm-misc-next, thanks for your patch.
-Daniel

> ---
>  drivers/gpu/drm/mediatek/mtk_drm_gem.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_gem.c b/drivers/gpu/drm/mediatek/mtk_drm_gem.c
> index ca672f1d140d..b04a3c2b111e 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_gem.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_gem.c
> @@ -271,7 +271,7 @@ void *mtk_drm_gem_prime_vmap(struct drm_gem_object *obj)
>  			       pgprot_writecombine(PAGE_KERNEL));
>  
>  out:
> -	kfree((void *)sgt);
> +	kfree(sgt);
>  
>  	return mtk_gem->kvaddr;
>  }
> @@ -285,5 +285,5 @@ void mtk_drm_gem_prime_vunmap(struct drm_gem_object *obj, void *vaddr)
>  
>  	vunmap(vaddr);
>  	mtk_gem->kvaddr = 0;
> -	kfree((void *)mtk_gem->pages);
> +	kfree(mtk_gem->pages);
>  }
> -- 
> 2.23.0
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

      reply	other threads:[~2019-10-24 12:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-23 11:11 Wambui Karuga
2019-10-24 12:12 ` Daniel Vetter [this message]

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=20191024121235.GC11828@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=airlied@linux.ie \
    --cc=ck.hu@mediatek.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=wambui.karugax@gmail.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

Powered by JetHome