summaryrefslogtreecommitdiff
path: root/lib/test_firmware.c
diff options
context:
space:
mode:
authorScott Branden <scott.branden@broadcom.com>2020-04-14 17:25:17 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-04-17 09:59:39 +0200
commit55623260bb33e2ab849af76edf2253bc04cb241f (patch)
tree087d8d89f9d2f9830e2b65693b93fcc411865724 /lib/test_firmware.c
parentab7c1e163b525316a870a494dd4ea196e7a6c455 (diff)
test_firmware: remove unnecessary test_fw_mutex in test_dev_config_show_xxx
Remove unnecessary use of test_fw_mutex in test_dev_config_show_xxx functions that show simple bool, int, and u8. Signed-off-by: Scott Branden <scott.branden@broadcom.com> Reviewed-by: Kees Cook <keescook@chromium.org> Reviewed-by: Luis Chamberlain <mcgrof@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Link: https://lore.kernel.org/r/20200415002517.4328-1-scott.branden@broadcom.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib/test_firmware.c')
-rw-r--r--lib/test_firmware.c26
1 files changed, 3 insertions, 23 deletions
diff --git a/lib/test_firmware.c b/lib/test_firmware.c
index 0c7fbcf07ac5..9fee2b93a8d1 100644
--- a/lib/test_firmware.c
+++ b/lib/test_firmware.c
@@ -310,27 +310,13 @@ static int test_dev_config_update_bool(const char *buf, size_t size,
return ret;
}
-static ssize_t
-test_dev_config_show_bool(char *buf,
- bool config)
+static ssize_t test_dev_config_show_bool(char *buf, bool val)
{
- bool val;
-
- mutex_lock(&test_fw_mutex);
- val = config;
- mutex_unlock(&test_fw_mutex);
-
return snprintf(buf, PAGE_SIZE, "%d\n", val);
}
-static ssize_t test_dev_config_show_int(char *buf, int cfg)
+static ssize_t test_dev_config_show_int(char *buf, int val)
{
- int val;
-
- mutex_lock(&test_fw_mutex);
- val = cfg;
- mutex_unlock(&test_fw_mutex);
-
return snprintf(buf, PAGE_SIZE, "%d\n", val);
}
@@ -354,14 +340,8 @@ static int test_dev_config_update_u8(const char *buf, size_t size, u8 *cfg)
return size;
}
-static ssize_t test_dev_config_show_u8(char *buf, u8 cfg)
+static ssize_t test_dev_config_show_u8(char *buf, u8 val)
{
- u8 val;
-
- mutex_lock(&test_fw_mutex);
- val = cfg;
- mutex_unlock(&test_fw_mutex);
-
return snprintf(buf, PAGE_SIZE, "%u\n", val);
}