Re: [Nouveau] [PATCH] nouveau: no need to check return value of debugfs_create functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2/9/20 2:55 AM, Greg Kroah-Hartman wrote:
> When calling debugfs functions, there is no need to ever check the
> return value.  The function can work or not, but the code logic should
> never do something different based on this.
> 

Should we follow that line of reasoning further, and simply return void
from the debugfs functions--rather than playing whack-a-mole with this
indefinitely?


thanks,
-- 
John Hubbard
NVIDIA

> Cc: Ben Skeggs <bskeggs@xxxxxxxxxx>
> Cc: David Airlie <airlied@xxxxxxxx>
> Cc: Daniel Vetter <daniel@xxxxxxxx>
> Cc: dri-devel@xxxxxxxxxxxxxxxxxxxxx
> Cc: nouveau@xxxxxxxxxxxxxxxxxxxxx
> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> ---
>  drivers/gpu/drm/nouveau/nouveau_debugfs.c | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/nouveau/nouveau_debugfs.c b/drivers/gpu/drm/nouveau/nouveau_debugfs.c
> index 080e964d49aa..d1c82fc45a68 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_debugfs.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_debugfs.c
> @@ -224,14 +224,10 @@ nouveau_drm_debugfs_init(struct drm_minor *minor)
>  	struct dentry *dentry;
>  	int i;
>  
> -	for (i = 0; i < ARRAY_SIZE(nouveau_debugfs_files); i++) {
> -		dentry = debugfs_create_file(nouveau_debugfs_files[i].name,
> -					     S_IRUGO | S_IWUSR,
> -					     minor->debugfs_root, minor->dev,
> -					     nouveau_debugfs_files[i].fops);
> -		if (!dentry)
> -			return -ENOMEM;
> -	}
> +	for (i = 0; i < ARRAY_SIZE(nouveau_debugfs_files); i++)
> +		debugfs_create_file(nouveau_debugfs_files[i].name,
> +				    S_IRUGO | S_IWUSR, minor->debugfs_root,
> +				    minor->dev, nouveau_debugfs_files[i].fops);
>  
>  	drm_debugfs_create_files(nouveau_debugfs_list,
>  				 NOUVEAU_DEBUGFS_ENTRIES,
> 
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux