armada: no need to check return value of debugfs_create functions
Subsystems (2)
PATCH 1/1 armada: 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.
--- drivers/gpu/drm/armada/armada_debugfs.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-)
drivers/gpu/drm/armada/armada_debugfs.c +4 -10
@@ -109,7 +109,6 @@ static struct drm_info_list armada_debugfs_list[] = {int armada_drm_debugfs_init (struct drm_minor *minor) { -struct dentry *de;int ret; ret = drm_debugfs_create_files(armada_debugfs_list,
@@ -118,15 +117,10 @@ int armada_drm_debugfs_init(struct drm_minor *minor)if (ret)return ret; - de =debugfs_create_file ("reg" ,S_IFREG |S_IRUSR , - minor->debugfs_root, minor->dev, &fops_reg_r); -if (!de) -return -ENOMEM ; - - de =debugfs_create_file ("reg_wr" ,S_IFREG |S_IWUSR , - minor->debugfs_root, minor->dev, &fops_reg_w); -if (!de) -return -ENOMEM ; +debugfs_create_file ("reg" ,S_IFREG |S_IRUSR , minor->debugfs_root, + minor->dev, &fops_reg_r); +debugfs_create_file ("reg_wr" ,S_IFREG |S_IWUSR , minor->debugfs_root, + minor->dev, &fops_reg_w);return 0 ; }
Signature · 6 lines
2.22.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Russell King - ARM Linux admin
maintainerQuoted 3 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.
Please don't merge this patch - I have a change that conflicts with this which switches us over to using drm_debugfs_create_files(), thereby eliminating this code.
Quoted 46 lines
Cc Russell King <[email protected]>Cc David Airlie <[email protected]>Cc Daniel Vetter <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- drivers/gpu/drm/armada/armada_debugfs.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-)drivers/gpu/drm/armada/armada_debugfs.c +4
-10@@ -109,7 +109,6 @@ static struct drm_info_list armada_debugfs_list[] = {int armada_drm_debugfs_init (struct drm_minor *minor) { -struct dentry *de;int ret; ret = drm_debugfs_create_files(armada_debugfs_list,@@ -118,15 +117,10 @@ int armada_drm_debugfs_init(struct drm_minor *minor)if (ret)return ret; - de =debugfs_create_file ("reg" ,S_IFREG |S_IRUSR , - minor->debugfs_root, minor->dev, &fops_reg_r); -if (!de) -return -ENOMEM ; - - de =debugfs_create_file ("reg_wr" ,S_IFREG |S_IWUSR , - minor->debugfs_root, minor->dev, &fops_reg_w); -if (!de) -return -ENOMEM ; +debugfs_create_file ("reg" ,S_IFREG |S_IRUSR , minor->debugfs_root, + minor->dev, &fops_reg_r); +debugfs_create_file ("reg_wr" ,S_IFREG |S_IWUSR , minor->debugfs_root, + minor->dev, &fops_reg_w);return 0 ; }Signature · 1 line
2.22.0
Signature · 7 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up According to speedtest.net: 11.9Mbps down 500kbps up _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 8 lines · Russell King - ARM Linux admin
Quoted 3 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.
Please don't merge this patch - I have a change that conflicts with this which switches us over to using
drm_debugfs_create_files(), thereby eliminating this code.
Isn't it "first received, first applied?" That's how it is for my subsystems...
Anyway, I have a much larger patch for all users of drm_debugfs_create_files coming, but I'll wait for all of these tiny ones to land before sending that out :)
thanks,
greg k-h
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Russell King - ARM Linux admin
maintainerQuoted 6 lines · Greg Kroah-Hartman
Quoted 5 lines · Russell King - ARM Linux admin
Quoted 3 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 6 lines
Quoted 3 lines
Please don't merge this patch - I have a change that conflicts with this which switches us over to using
drm_debugfs_create_files(), thereby eliminating this code.Isn't it "first received, first applied?" That's how it is for my subsystems...
When I started working on the kernel in the 1990s, it was "the most technically correct approach of competing approaches". If we've now switched to "first received, first applied" that can only be harmful and demotivating to those who wish to do a good job.
If someone has a better approach ready to go, why should the inferior approach be applied and then the better approach have to be rebased on top of the inferior approach? This makes no sense.
Signature · 7 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up According to speedtest.net: 11.9Mbps down 500kbps up _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 14 lines · Russell King - ARM Linux admin
Quoted 6 lines · Greg Kroah-Hartman
Quoted 5 lines · Russell King - ARM Linux admin
Quoted 3 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 6 lines
Quoted 3 lines
Please don't merge this patch - I have a change that conflicts with this which switches us over to using
drm_debugfs_create_files(), thereby eliminating this code.Isn't it "first received, first applied?" That's how it is for my subsystems...
Quoted 8 lines
When I started working on the kernel in the 1990s, it was "the most technically correct approach of competing approaches". If we've now switched to "first received, first applied" that can only be harmful and demotivating to those who wish to do a good job.
If someone has a better approach ready to go, why should the inferior approach be applied and then the better approach have to be rebased on top of the inferior approach? This makes no sense.
If you have a better approach ready to go, please post it and I will be glad to rebase my patch on top of yours.
greg k-h
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel