i915: no need to check return value of debugfs_create functions
Subsystems (2)
PATCH 1/1 i915: no need to check return value of debugfs_create functions
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 Jani Nikula <[email protected]>
Cc Joonas Lahtinen <[email protected]>
Cc Rodrigo Vivi <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Signed-off-by Greg Kroah-Hartman <[email protected]>
--- drivers/gpu/drm/i915/i915_debugfs.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +7 -13
@@ -4648,23 +4648,17 @@ static const struct i915_debugfs_files {int i915_debugfs_register (struct drm_i915_private *dev_priv) {struct drm_minor *minor = dev_priv->drm.primary; -struct dentry *ent;int i; - ent =debugfs_create_file ("i915_forcewake_user" ,S_IRUSR , - minor->debugfs_root,to_i915 (minor->dev), - &i915_forcewake_fops); -if (!ent) -return -ENOMEM ; +debugfs_create_file ("i915_forcewake_user" ,S_IRUSR , minor->debugfs_root, +to_i915 (minor->dev), &i915_forcewake_fops);for (i =0 ; i <ARRAY_SIZE (i915_debugfs_files); i++) { - ent =debugfs_create_file (i915_debugfs_files[i].name, -S_IRUGO |S_IWUSR , - minor->debugfs_root, -to_i915 (minor->dev), - i915_debugfs_files[i].fops); -if (!ent) -return -ENOMEM ; +debugfs_create_file (i915_debugfs_files[i].name, +S_IRUGO |S_IWUSR , + minor->debugfs_root, +to_i915 (minor->dev), + i915_debugfs_files[i].fops); } return drm_debugfs_create_files(i915_debugfs_list,
Signature · 6 lines
2.22.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Jani Nikula
maintainerQuoted 4 lines · Greg Kroah-Hartman
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.
Quoted 8 lines
Cc Jani Nikula <[email protected]>Cc Joonas Lahtinen <[email protected]>Cc Rodrigo Vivi <[email protected]>Cc David Airlie <[email protected]>Cc Daniel Vetter <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>
Thanks, looks good, but for some reason this was not picked up by our CI. I resent it with hopes we'll get some test results too.
BR,
Jani.
Quoted 39 lines
--- drivers/gpu/drm/i915/i915_debugfs.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-)drivers/gpu/drm/i915/i915_debugfs.c +7
-13@@ -4648,23 +4648,17 @@ static const struct i915_debugfs_files {int i915_debugfs_register (struct drm_i915_private *dev_priv) {struct drm_minor *minor = dev_priv->drm.primary; -struct dentry *ent;int i; - ent =debugfs_create_file ("i915_forcewake_user" ,S_IRUSR , - minor->debugfs_root,to_i915 (minor->dev), - &i915_forcewake_fops); -if (!ent) -return -ENOMEM ; +debugfs_create_file ("i915_forcewake_user" ,S_IRUSR , minor->debugfs_root, +to_i915 (minor->dev), &i915_forcewake_fops);for (i =0 ; i <ARRAY_SIZE (i915_debugfs_files); i++) { - ent =debugfs_create_file (i915_debugfs_files[i].name, -S_IRUGO |S_IWUSR , - minor->debugfs_root, -to_i915 (minor->dev), - i915_debugfs_files[i].fops); -if (!ent) -return -ENOMEM ; +debugfs_create_file (i915_debugfs_files[i].name, +S_IRUGO |S_IWUSR , + minor->debugfs_root, +to_i915 (minor->dev), + i915_debugfs_files[i].fops); } return drm_debugfs_create_files(i915_debugfs_list,
Signature · 5 lines
Jani Nikula, Intel Open Source Graphics Center _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel