* [PATCH] sti: no need to check return value of debugfs_create functions
@ 2019-06-13 11:46 Greg Kroah-Hartman
2019-06-13 15:40 ` Benjamin Gaignard
0 siblings, 1 reply; 2+ messages in thread
From: Greg Kroah-Hartman @ 2019-06-13 11:46 UTC (permalink / raw)
To: Benjamin Gaignard, Vincent Abriou, David Airlie, Daniel Vetter; +Cc: dri-devel
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.
Cc: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Cc: Vincent Abriou <vincent.abriou@st.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/sti/sti_drv.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c
index a525fd899f68..4797e46bf384 100644
--- a/drivers/gpu/drm/sti/sti_drv.c
+++ b/drivers/gpu/drm/sti/sti_drv.c
@@ -95,7 +95,6 @@ static struct drm_info_list sti_drm_dbg_list[] = {
static int sti_drm_dbg_init(struct drm_minor *minor)
{
- struct dentry *dentry;
int ret;
ret = drm_debugfs_create_files(sti_drm_dbg_list,
@@ -104,13 +103,8 @@ static int sti_drm_dbg_init(struct drm_minor *minor)
if (ret)
goto err;
- dentry = debugfs_create_file("fps_show", S_IRUGO | S_IWUSR,
- minor->debugfs_root, minor->dev,
- &sti_drm_fps_fops);
- if (!dentry) {
- ret = -ENOMEM;
- goto err;
- }
+ debugfs_create_file("fps_show", S_IRUGO | S_IWUSR, minor->debugfs_root,
+ minor->dev, &sti_drm_fps_fops);
DRM_INFO("%s: debugfs installed\n", DRIVER_NAME);
return 0;
--
2.22.0
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] sti: no need to check return value of debugfs_create functions
2019-06-13 11:46 [PATCH] sti: no need to check return value of debugfs_create functions Greg Kroah-Hartman
@ 2019-06-13 15:40 ` Benjamin Gaignard
0 siblings, 0 replies; 2+ messages in thread
From: Benjamin Gaignard @ 2019-06-13 15:40 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: David Airlie, Vincent Abriou, ML dri-devel
Le jeu. 13 juin 2019 à 13:46, Greg Kroah-Hartman
<gregkh@linuxfoundation.org> a écrit :
>
> 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.
>
> Cc: Benjamin Gaignard <benjamin.gaignard@linaro.org>
> Cc: Vincent Abriou <vincent.abriou@st.com>
> Cc: David Airlie <airlied@linux.ie>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Applied on drm-misc-next.
Thanks,
Benjamin
> ---
> drivers/gpu/drm/sti/sti_drv.c | 10 ++--------
> 1 file changed, 2 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c
> index a525fd899f68..4797e46bf384 100644
> --- a/drivers/gpu/drm/sti/sti_drv.c
> +++ b/drivers/gpu/drm/sti/sti_drv.c
> @@ -95,7 +95,6 @@ static struct drm_info_list sti_drm_dbg_list[] = {
>
> static int sti_drm_dbg_init(struct drm_minor *minor)
> {
> - struct dentry *dentry;
> int ret;
>
> ret = drm_debugfs_create_files(sti_drm_dbg_list,
> @@ -104,13 +103,8 @@ static int sti_drm_dbg_init(struct drm_minor *minor)
> if (ret)
> goto err;
>
> - dentry = debugfs_create_file("fps_show", S_IRUGO | S_IWUSR,
> - minor->debugfs_root, minor->dev,
> - &sti_drm_fps_fops);
> - if (!dentry) {
> - ret = -ENOMEM;
> - goto err;
> - }
> + debugfs_create_file("fps_show", S_IRUGO | S_IWUSR, minor->debugfs_root,
> + minor->dev, &sti_drm_fps_fops);
>
> DRM_INFO("%s: debugfs installed\n", DRIVER_NAME);
> return 0;
> --
> 2.22.0
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-06-13 15:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-13 11:46 [PATCH] sti: no need to check return value of debugfs_create functions Greg Kroah-Hartman
2019-06-13 15:40 ` Benjamin Gaignard
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.