Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

hwmon: (asus_atk0110) 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: Luca Tettamanti <kronos.it@gmail.com>
Cc: Jean Delvare <jdelvare@suse.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: linux-hwmon@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>

authored by

Greg Kroah-Hartman and committed by
Guenter Roeck
08d09d80 228b9e19

+3 -20
+3 -20
drivers/hwmon/asus_atk0110.c
··· 789 789 static void atk_debugfs_init(struct atk_data *data) 790 790 { 791 791 struct dentry *d; 792 - struct dentry *f; 793 792 794 793 data->debugfs.id = 0; 795 794 796 795 d = debugfs_create_dir("asus_atk0110", NULL); 797 - if (!d || IS_ERR(d)) 798 - return; 799 796 800 - f = debugfs_create_x32("id", 0600, d, &data->debugfs.id); 801 - if (!f || IS_ERR(f)) 802 - goto cleanup; 803 - 804 - f = debugfs_create_file_unsafe("gitm", 0400, d, data, 805 - &atk_debugfs_gitm); 806 - if (!f || IS_ERR(f)) 807 - goto cleanup; 808 - 809 - f = debugfs_create_file("ggrp", 0400, d, data, 810 - &atk_debugfs_ggrp_fops); 811 - if (!f || IS_ERR(f)) 812 - goto cleanup; 797 + debugfs_create_x32("id", 0600, d, &data->debugfs.id); 798 + debugfs_create_file_unsafe("gitm", 0400, d, data, &atk_debugfs_gitm); 799 + debugfs_create_file("ggrp", 0400, d, data, &atk_debugfs_ggrp_fops); 813 800 814 801 data->debugfs.root = d; 815 - 816 - return; 817 - cleanup: 818 - debugfs_remove_recursive(d); 819 802 } 820 803 821 804 static void atk_debugfs_cleanup(struct atk_data *data)