From b6b996b6cdeecf7e1646c87422e04e446ddce124 Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Tue, 19 Dec 2017 10:15:07 -0800 Subject: treewide: Use DEVICE_ATTR_RW Convert DEVICE_ATTR uses to DEVICE_ATTR_RW where possible. Done with perl script: $ git grep -w --name-only DEVICE_ATTR | \ xargs perl -i -e 'local $/; while (<>) { s/\bDEVICE_ATTR\s*\(\s*(\w+)\s*,\s*\(?(\s*S_IRUGO\s*\|\s*S_IWUSR|\s*S_IWUSR\s*\|\s*S_IRUGO\s*|\s*0644\s*)\)?\s*,\s*\1_show\s*,\s*\1_store\s*\)/DEVICE_ATTR_RW(\1)/g; print;}' Signed-off-by: Joe Perches Acked-by: Felipe Balbi Acked-by: Andy Shevchenko Acked-by: Bartlomiej Zolnierkiewicz Acked-by: Zhang Rui Acked-by: Jarkko Nikula Acked-by: Jani Nikula Signed-off-by: Greg Kroah-Hartman --- lib/test_kmod.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'lib/test_kmod.c') diff --git a/lib/test_kmod.c b/lib/test_kmod.c index 337f408b4de6..e372b97eee13 100644 --- a/lib/test_kmod.c +++ b/lib/test_kmod.c @@ -694,8 +694,7 @@ static ssize_t config_test_driver_show(struct device *dev, return config_test_show_str(&test_dev->config_mutex, buf, config->test_driver); } -static DEVICE_ATTR(config_test_driver, 0644, config_test_driver_show, - config_test_driver_store); +static DEVICE_ATTR_RW(config_test_driver); static ssize_t config_test_fs_store(struct device *dev, struct device_attribute *attr, @@ -726,8 +725,7 @@ static ssize_t config_test_fs_show(struct device *dev, return config_test_show_str(&test_dev->config_mutex, buf, config->test_fs); } -static DEVICE_ATTR(config_test_fs, 0644, config_test_fs_show, - config_test_fs_store); +static DEVICE_ATTR_RW(config_test_fs); static int trigger_config_run_type(struct kmod_test_device *test_dev, enum kmod_test_case test_case, @@ -1012,8 +1010,7 @@ static ssize_t config_num_threads_show(struct device *dev, return test_dev_config_show_int(test_dev, buf, config->num_threads); } -static DEVICE_ATTR(config_num_threads, 0644, config_num_threads_show, - config_num_threads_store); +static DEVICE_ATTR_RW(config_num_threads); static ssize_t config_test_case_store(struct device *dev, struct device_attribute *attr, @@ -1037,8 +1034,7 @@ static ssize_t config_test_case_show(struct device *dev, return test_dev_config_show_uint(test_dev, buf, config->test_case); } -static DEVICE_ATTR(config_test_case, 0644, config_test_case_show, - config_test_case_store); +static DEVICE_ATTR_RW(config_test_case); static ssize_t test_result_show(struct device *dev, struct device_attribute *attr, @@ -1049,7 +1045,7 @@ static ssize_t test_result_show(struct device *dev, return test_dev_config_show_int(test_dev, buf, config->test_result); } -static DEVICE_ATTR(test_result, 0644, test_result_show, test_result_store); +static DEVICE_ATTR_RW(test_result); #define TEST_KMOD_DEV_ATTR(name) &dev_attr_##name.attr -- cgit v1.2.3-58-ga151