lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <862358e67a6f118b11ba16fb94828e9d1635cb66.camel@pengutronix.de>
Date:   Mon, 17 Jul 2023 11:51:16 +0200
From:   Lucas Stach <l.stach@...gutronix.de>
To:     Sui Jingfeng <sui.jingfeng@...ux.dev>,
        Russell King <linux+etnaviv@...linux.org.uk>,
        Christian Gmeiner <christian.gmeiner@...il.com>,
        David Airlie <airlied@...il.com>,
        Daniel Vetter <daniel@...ll.ch>
Cc:     loongson-kernel@...ts.loongnix.cn,
        Sui Jingfeng <suijingfeng@...ngson.cn>,
        etnaviv@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 3/8] drm/etnaviv: Drop the second argument of the
 etnaviv_gem_new_impl()

Hi Jingfeng,

Am Freitag, dem 23.06.2023 um 18:08 +0800 schrieb Sui Jingfeng:
> From: Sui Jingfeng <suijingfeng@...ngson.cn>
> 
> Because it is not used by the etnaviv_gem_new_impl() function,
> no functional change.
> 
I think it would make sense to move into the opposite direction: in
both callsites of etnaviv_gem_new_impl we immediately call
drm_gem_object_init with the size. A better cleanup would be to make
use of the size parameter and move this object init call into
etnaviv_gem_new_impl.

Regards,
Lucas

> Signed-off-by: Sui Jingfeng <suijingfeng@...ngson.cn>
> ---
>  drivers/gpu/drm/etnaviv/etnaviv_gem.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem.c b/drivers/gpu/drm/etnaviv/etnaviv_gem.c
> index b5f73502e3dd..be2f459c66b5 100644
> --- a/drivers/gpu/drm/etnaviv/etnaviv_gem.c
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_gem.c
> @@ -542,7 +542,7 @@ static const struct drm_gem_object_funcs etnaviv_gem_object_funcs = {
>  	.vm_ops = &vm_ops,
>  };
>  
> -static int etnaviv_gem_new_impl(struct drm_device *dev, u32 size, u32 flags,
> +static int etnaviv_gem_new_impl(struct drm_device *dev, u32 flags,
>  	const struct etnaviv_gem_ops *ops, struct drm_gem_object **obj)
>  {
>  	struct etnaviv_gem_object *etnaviv_obj;
> @@ -591,8 +591,7 @@ int etnaviv_gem_new_handle(struct drm_device *dev, struct drm_file *file,
>  
>  	size = PAGE_ALIGN(size);
>  
> -	ret = etnaviv_gem_new_impl(dev, size, flags,
> -				   &etnaviv_gem_shmem_ops, &obj);
> +	ret = etnaviv_gem_new_impl(dev, flags, &etnaviv_gem_shmem_ops, &obj);
>  	if (ret)
>  		goto fail;
>  
> @@ -627,7 +626,7 @@ int etnaviv_gem_new_private(struct drm_device *dev, size_t size, u32 flags,
>  	struct drm_gem_object *obj;
>  	int ret;
>  
> -	ret = etnaviv_gem_new_impl(dev, size, flags, ops, &obj);
> +	ret = etnaviv_gem_new_impl(dev, flags, ops, &obj);
>  	if (ret)
>  		return ret;
>  

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ