Wambui Karuga
2020-Feb-18 17:28 UTC
[Nouveau] [PATCH] drm/nouveau: remove checks for return value of debugfs functions
As there is no need to check for the return value of debugfs_create_file and drm_debugfs_create_files, remove unnecessary checks and error handling in nouveau_drm_debugfs_init. Signed-off-by: Wambui Karuga <wambui.karugax at gmail.com> --- drivers/gpu/drm/nouveau/nouveau_debugfs.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_debugfs.c b/drivers/gpu/drm/nouveau/nouveau_debugfs.c index 7dfbbbc1beea..15a3d40edf02 100644 --- a/drivers/gpu/drm/nouveau/nouveau_debugfs.c +++ b/drivers/gpu/drm/nouveau/nouveau_debugfs.c @@ -222,22 +222,18 @@ nouveau_drm_debugfs_init(struct drm_minor *minor) { struct nouveau_drm *drm = nouveau_drm(minor->dev); struct dentry *dentry; - int i, ret; + 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; + debugfs_create_file(nouveau_debugfs_files[i].name, + S_IRUGO | S_IWUSR, + minor->debugfs_root, minor->dev, + nouveau_debugfs_files[i].fops); } - ret = drm_debugfs_create_files(nouveau_debugfs_list, - NOUVEAU_DEBUGFS_ENTRIES, - minor->debugfs_root, minor); - if (ret) - return ret; + drm_debugfs_create_files(nouveau_debugfs_list, + NOUVEAU_DEBUGFS_ENTRIES, + minor->debugfs_root, minor); /* Set the size of the vbios since we know it, and it's confusing to * userspace if it wants to seek() but the file has a length of 0 -- 2.25.0
Ben Skeggs
2020-Feb-19 05:39 UTC
[Nouveau] [PATCH] drm/nouveau: remove checks for return value of debugfs functions
On Wed, 19 Feb 2020 at 03:28, Wambui Karuga <wambui.karugax at gmail.com> wrote:> > As there is no need to check for the return value of debugfs_create_file > and drm_debugfs_create_files, remove unnecessary checks and error > handling in nouveau_drm_debugfs_init.Thanks!> > Signed-off-by: Wambui Karuga <wambui.karugax at gmail.com> > --- > drivers/gpu/drm/nouveau/nouveau_debugfs.c | 20 ++++++++------------ > 1 file changed, 8 insertions(+), 12 deletions(-) > > diff --git a/drivers/gpu/drm/nouveau/nouveau_debugfs.c b/drivers/gpu/drm/nouveau/nouveau_debugfs.c > index 7dfbbbc1beea..15a3d40edf02 100644 > --- a/drivers/gpu/drm/nouveau/nouveau_debugfs.c > +++ b/drivers/gpu/drm/nouveau/nouveau_debugfs.c > @@ -222,22 +222,18 @@ nouveau_drm_debugfs_init(struct drm_minor *minor) > { > struct nouveau_drm *drm = nouveau_drm(minor->dev); > struct dentry *dentry; > - int i, ret; > + 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; > + debugfs_create_file(nouveau_debugfs_files[i].name, > + S_IRUGO | S_IWUSR, > + minor->debugfs_root, minor->dev, > + nouveau_debugfs_files[i].fops); > } > > - ret = drm_debugfs_create_files(nouveau_debugfs_list, > - NOUVEAU_DEBUGFS_ENTRIES, > - minor->debugfs_root, minor); > - if (ret) > - return ret; > + drm_debugfs_create_files(nouveau_debugfs_list, > + NOUVEAU_DEBUGFS_ENTRIES, > + minor->debugfs_root, minor); > > /* Set the size of the vbios since we know it, and it's confusing to > * userspace if it wants to seek() but the file has a length of 0 > -- > 2.25.0 > > _______________________________________________ > Nouveau mailing list > Nouveau at lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/nouveau
Apparently Analagous Threads
- [PATCH v2 11/17] drm/nouveau: make nouveau_drm_debugfs_init() return 0
- [PATCH 09/21] drm/nouveau: remove checks for return value of debugfs functions
- [PATCH] nouveau: no need to check return value of debugfs_create functions
- [PATCH 0/2] drm/nouveau: Allow parsing vbios.rom with nvbios from debugfs
- [PATCH] nouveau: no need to check return value of debugfs_create functions