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>
This commit is contained in:
Scott Branden 2020-04-14 17:25:17 -07:00 committed by Greg Kroah-Hartman
parent ab7c1e163b
commit 55623260bb

View File

@ -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);
}