radeon: no need to check return value of debugfs_create functions
Subsystems (2)
PATCH 1/1 radeon: 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/radeon/radeon_ttm.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-)
drivers/gpu/drm/radeon/radeon_ttm.c +8 -13
@@ -1056,19 +1056,14 @@ static int radeon_ttm_debugfs_init(struct radeon_device *rdev)unsigned count;struct drm_minor *minor = rdev->ddev->primary; -struct dentry *ent, *root = minor->debugfs_root; - - ent =debugfs_create_file ("radeon_vram" ,S_IFREG |S_IRUGO , root, - rdev, &radeon_ttm_vram_fops); -if (IS_ERR (ent)) -return PTR_ERR (ent); - rdev->mman.vram = ent; - - ent =debugfs_create_file ("radeon_gtt" ,S_IFREG |S_IRUGO , root, - rdev, &radeon_ttm_gtt_fops); -if (IS_ERR (ent)) -return PTR_ERR (ent); - rdev->mman.gtt = ent; +struct dentry *root = minor->debugfs_root; + + rdev->mman.vram =debugfs_create_file ("radeon_vram" ,S_IFREG |S_IRUGO , + root, rdev, + &radeon_ttm_vram_fops); + + rdev->mman.gtt =debugfs_create_file ("radeon_gtt" ,S_IFREG |S_IRUGO , + root, rdev, &radeon_ttm_gtt_fops); count =ARRAY_SIZE (radeon_ttm_debugfs_list);
Signature · 6 lines
2.22.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Alex Deucher
AppliedQuoted 5 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 Alex Deucher <[email protected]>Cc "Christian König" <[email protected]>Cc "David (ChunMing) Zhou" <[email protected]>Cc David Airlie <[email protected]>Cc Daniel Vetter <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>
Applied all the radeon and amdgpu patches. Thanks!
Alex
Quoted 39 lines
--- drivers/gpu/drm/radeon/radeon_ttm.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-)drivers/gpu/drm/radeon/radeon_ttm.c +8
-14@@ -1056,19 +1056,14 @@ static int radeon_ttm_debugfs_init(struct radeon_device *rdev)unsigned count;struct drm_minor *minor = rdev->ddev->primary; -struct dentry *ent, *root = minor->debugfs_root; - - ent =debugfs_create_file ("radeon_vram" ,S_IFREG |S_IRUGO , root, - rdev, &radeon_ttm_vram_fops); -if (IS_ERR (ent)) -return PTR_ERR (ent); - rdev->mman.vram = ent; - - ent =debugfs_create_file ("radeon_gtt" ,S_IFREG |S_IRUGO , root, - rdev, &radeon_ttm_gtt_fops); -if (IS_ERR (ent)) -return PTR_ERR (ent); - rdev->mman.gtt = ent; +struct dentry *root = minor->debugfs_root; + + rdev->mman.vram =debugfs_create_file ("radeon_vram" ,S_IFREG |S_IRUGO , + root, rdev, + &radeon_ttm_vram_fops); + + rdev->mman.gtt =debugfs_create_file ("radeon_gtt" ,S_IFREG |S_IRUGO , + root, rdev, &radeon_ttm_gtt_fops); count =ARRAY_SIZE (radeon_ttm_debugfs_list); --2.22.0
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel