diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/kobject.c | 4 | ||||
-rw-r--r-- | lib/kobject_uevent.c | 3 | ||||
-rw-r--r-- | lib/test_firmware.c | 17 | ||||
-rw-r--r-- | lib/test_kmod.c | 14 |
4 files changed, 14 insertions, 24 deletions
diff --git a/lib/kobject.c b/lib/kobject.c index 06b849eee0ca..afd5a3fc6123 100644 --- a/lib/kobject.c +++ b/lib/kobject.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * kobject.c - library routines for handling generic kernel objects * @@ -5,9 +6,6 @@ * Copyright (c) 2006-2007 Greg Kroah-Hartman <greg@kroah.com> * Copyright (c) 2006-2007 Novell Inc. * - * This file is released under the GPLv2. - * - * * Please see the file Documentation/kobject.txt for critical information * about using the kobject interface. */ diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c index 2615074d3de5..9fe6ec8fda28 100644 --- a/lib/kobject_uevent.c +++ b/lib/kobject_uevent.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * kernel userspace event delivery * @@ -5,8 +6,6 @@ * Copyright (C) 2004 Novell, Inc. All rights reserved. * Copyright (C) 2004 IBM, Inc. All rights reserved. * - * Licensed under the GNU GPL v2. - * * Authors: * Robert Love <rml@novell.com> * Kay Sievers <kay.sievers@vrfy.org> diff --git a/lib/test_firmware.c b/lib/test_firmware.c index 64a4c76cba2b..078a61480573 100644 --- a/lib/test_firmware.c +++ b/lib/test_firmware.c @@ -96,7 +96,7 @@ struct test_config { struct device *device); }; -struct test_config *test_fw_config; +static struct test_config *test_fw_config; static ssize_t test_fw_misc_read(struct file *f, char __user *buf, size_t size, loff_t *offset) @@ -359,7 +359,7 @@ static ssize_t config_name_show(struct device *dev, { return config_test_show_str(buf, test_fw_config->name); } -static DEVICE_ATTR(config_name, 0644, config_name_show, config_name_store); +static DEVICE_ATTR_RW(config_name); static ssize_t config_num_requests_store(struct device *dev, struct device_attribute *attr, @@ -371,6 +371,7 @@ static ssize_t config_num_requests_store(struct device *dev, if (test_fw_config->reqs) { pr_err("Must call release_all_firmware prior to changing config\n"); rc = -EINVAL; + mutex_unlock(&test_fw_mutex); goto out; } mutex_unlock(&test_fw_mutex); @@ -388,8 +389,7 @@ static ssize_t config_num_requests_show(struct device *dev, { return test_dev_config_show_u8(buf, test_fw_config->num_requests); } -static DEVICE_ATTR(config_num_requests, 0644, config_num_requests_show, - config_num_requests_store); +static DEVICE_ATTR_RW(config_num_requests); static ssize_t config_sync_direct_store(struct device *dev, struct device_attribute *attr, @@ -411,8 +411,7 @@ static ssize_t config_sync_direct_show(struct device *dev, { return test_dev_config_show_bool(buf, test_fw_config->sync_direct); } -static DEVICE_ATTR(config_sync_direct, 0644, config_sync_direct_show, - config_sync_direct_store); +static DEVICE_ATTR_RW(config_sync_direct); static ssize_t config_send_uevent_store(struct device *dev, struct device_attribute *attr, @@ -428,8 +427,7 @@ static ssize_t config_send_uevent_show(struct device *dev, { return test_dev_config_show_bool(buf, test_fw_config->send_uevent); } -static DEVICE_ATTR(config_send_uevent, 0644, config_send_uevent_show, - config_send_uevent_store); +static DEVICE_ATTR_RW(config_send_uevent); static ssize_t config_read_fw_idx_store(struct device *dev, struct device_attribute *attr, @@ -445,8 +443,7 @@ static ssize_t config_read_fw_idx_show(struct device *dev, { return test_dev_config_show_u8(buf, test_fw_config->read_fw_idx); } -static DEVICE_ATTR(config_read_fw_idx, 0644, config_read_fw_idx_show, - config_read_fw_idx_store); +static DEVICE_ATTR_RW(config_read_fw_idx); static ssize_t trigger_request_store(struct device *dev, 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 |