diff options
| author | Mark Brown <broonie@kernel.org> | 2020-12-28 14:20:15 +0000 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2020-12-28 14:20:15 +0000 |
| commit | 8db90aa36063f471bea1e65e23185913043852dc (patch) | |
| tree | 32f765852c4663ae28751bd2ab32463da6591701 /lib/test_firmware.c | |
| parent | a590370d918fc66c62df6620445791fbe840344a (diff) | |
| parent | 5c8fe583cce542aa0b84adc939ce85293de36e5e (diff) | |
Merge tag 'v5.11-rc1' into spi-5.11
Linux 5.11-rc1
Diffstat (limited to 'lib/test_firmware.c')
| -rw-r--r-- | lib/test_firmware.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/test_firmware.c b/lib/test_firmware.c index 2baa275a6ddf..b6fe89add9fe 100644 --- a/lib/test_firmware.c +++ b/lib/test_firmware.c @@ -364,18 +364,15 @@ static ssize_t test_dev_config_show_int(char *buf, int val) static int test_dev_config_update_u8(const char *buf, size_t size, u8 *cfg) { + u8 val; int ret; - long new; - ret = kstrtol(buf, 10, &new); + ret = kstrtou8(buf, 10, &val); if (ret) return ret; - if (new > U8_MAX) - return -EINVAL; - mutex_lock(&test_fw_mutex); - *(u8 *)cfg = new; + *(u8 *)cfg = val; mutex_unlock(&test_fw_mutex); /* Always return full write size even if we didn't consume all */ |
